help please

2005-02-12 Thread gargonx
would anyone like to help to fugure out this problem i'm having here's a portion of my code: """ I have three dictionaries along with this(you can probally spot what they are), but just in case here are some testers: """ std = { "b":"bo" } ext = { "aa":"i" } punc = { ",":"!"

help please!!

2007-02-11 Thread darren112
Hi Im new to python and I desperately need help with this task This is everything of what I need to do... The program to be written in Python obviously.. The program should support brute-forcing of the authentication process for a Telnet server via a dictionary attack. The python pro

Re: help please

2005-02-12 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: UnboundLocalError: local variable 't2' referenced before assignment ... t2="" def Proc(text): # "text" is some random text or use OrigText for word in text: for letter in word: if letter in std.keys(): letter=std[letter]

Re: help please

2005-02-12 Thread Steven Bethard
[EMAIL PROTECTED] wrote: t2="" def Proc(text): # "text" is some random text or use OrigText for word in text: for letter in word: if letter in std.keys(): letter=std[letter] t2=t2+letter # the problem is referene to this elif lett

Re: help please

2005-02-12 Thread Steven Bethard
Erik Max Francis wrote: [EMAIL PROTECTED] wrote: UnboundLocalError: local variable 't2' referenced before assignment ... t2="" def Proc(text): # "text" is some random text or use OrigText ... The fix is to declare t2 global at the top of Proc: def Proc(text): global t2 .

Re: help please

2005-02-12 Thread [EMAIL PROTECTED]
add just below the procedure declaration 'global t2' as you're referring to a global variable ... -- http://mail.python.org/mailman/listinfo/python-list

Re: help please

2005-02-12 Thread gargonx
This works much better, aside from the fact that it does'nt work for the std dictionary. the letters used from here stay the same. that dictionary looks like this: std = { "A":"Z", "Z":"A", "B":"Y", "Y":"B", "C":"X", "X":"C", "E":"V", "V":"E", "H":"S", "S":"

Re: help please

2005-02-12 Thread gargonx
Thanks that works very well -- http://mail.python.org/mailman/listinfo/python-list

Re: help please

2005-02-12 Thread Peter Hansen
[EMAIL PROTECTED] wrote: add just below the procedure declaration 'global t2' as you're referring to a global variable ... More specifically, *modifying* it. Just referring to it doesn't require a "global" declaration... -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: help please

2005-02-13 Thread Steven Bethard
gargonx wrote: This works much better, aside from the fact that it does'nt work for the std dictionary. the letters used from here stay the same. that dictionary looks like this: std = { "A":"Z", "Z":"A", "B":"Y", "Y":"B", "C":"X", "X":"C", "E":"V", "V":"E", "H":

Re: help please

2005-02-13 Thread gargonx
yes the items in std are always single to single, and ext single to double. basicly the ext are refernce to the std itmes. the second character in ext is a number depending on how far it is from the item in std. this is just a simple encoding program. -- http://mail.python.org/mailman/listinfo/py

Re: help please

2005-02-13 Thread Steven Bethard
gargonx wrote: yes the items in std are always single to single, and ext single to double. basicly the ext are refernce to the std itmes. the second character in ext is a number depending on how far it is from the item in std. this is just a simple encoding program. If your keys are always single c

Re: help please

2005-02-13 Thread gargonx
Well that seems to work like a champion, but my prob then would be; how do i get the double character values of ext to turn back to the single character keys. The reversed (decode if you will). Thanks a lot Steve this has been a great learning! -- http://mail.python.org/mailman/listinfo/python-li

Re: help please

2005-02-13 Thread Steven Bethard
gargonx wrote: Well that seems to work like a champion, but my prob then would be; how do i get the double character values of ext to turn back to the single character keys. The reversed (decode if you will). It's unclear what you want to do here. If you have say: ext = dict(aa='A', ab='B', bb='C'

Re: help please

2005-02-13 Thread gargonx
let's take the word "dogs" ext = dict("D":"V1", "O":"M1", "G":"S1") std = dict("S":"H") encode("DOGS") # proc() we'll get: "V1M1S1H" let's say i want to do just the opposite word: "V1M1S1H" decode("V1M1S1H") #how do i decode "V1" to "D", how do i keep the "V1" together? and get: "DOGS

Re: help please

2005-02-13 Thread Steven Bethard
gargonx wrote: let's take the word "dogs" ext = dict("D":"V1", "O":"M1", "G":"S1") std = dict("S":"H") encode("DOGS") # proc() we'll get: "V1M1S1H" let's say i want to do just the opposite word: "V1M1S1H" decode("V1M1S1H") #how do i decode "V1" to "D", how do i keep the "V1" together? an

Re: help please

2005-02-20 Thread gargonx
I think there's a problem with the code: py> decode_replacements.update([(std[key], key) for key in std]) py> decode_replacements.update([(ext[key], key) for key in ext]) when i run this i get an error: AttributeError: keys I can't get that figured out -- http://mail.python.org/mailman/list

Re: help please

2005-02-20 Thread Steven Bethard
gargonx wrote: I think there's a problem with the code: py> decode_replacements.update([(std[key], key) for key in std]) py> decode_replacements.update([(ext[key], key) for key in ext]) when i run this i get an error: AttributeError: keys I can't get that figured out Can you show the part of you

Re: help please

2005-02-20 Thread gargonx
Even if i put it in exactly the way you did: >>> import re >>> charmatcher = re.compile(r' [A-Z] [\d]?') >>> >>> ext = dict(D="V1", O="M1", G="S1") >>> std = dict(S="H") >>> >>> decode_replacements ={} >>> decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call las

Re: help please

2005-02-20 Thread Steven Bethard
gargonx wrote: Even if i put it in exactly the way you did: import re charmatcher = re.compile(r' [A-Z] [\d]?') ext = dict(D="V1", O="M1", G="S1") std = dict(S="H") decode_replacements ={} decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call last): File "", lin

Re: help please

2005-02-20 Thread Steven Bethard
Dennis Lee Bieber wrote: On 20 Feb 2005 20:12:50 -0800, "gargonx" <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: decode_replacements.update([(std[key], key) for key in std]) Traceback (most recent call last): File "", line 1, in ? AttributeError: keys Did you read the reference

Re: help please

2005-02-21 Thread rzed
"gargonx" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Even if i put it in exactly the way you did: > > >>> import re > >>> charmatcher = re.compile(r' [A-Z] [\d]?') > >>> > >>> ext = dict(D="V1", O="M1", G="S1") > >>> std = dict(S="H") > >>> > >>> decode_replacements ={} > >>> de

SMTP help please

2005-06-06 Thread Ivan Shevanski
I really can't figure out anything about the SMTP module. . .I think I'm in over my head( Im pretty new to python). Can someone show me a really(and I mean REALLY) basic tutorial for smtp or explain it? program: I want to make my program have a feedback form attached to it at the end which se

UnicodeDecodeError help please?

2006-04-07 Thread Robin Haswell
Okay I'm getting really frustrated with Python's Unicode handling, I'm trying everything I can think of an I can't escape Unicode(En|De)codeError no matter what I try. Could someone explain to me what I'm doing wrong here, so I can hope to throw light on the myriad of similar problems I'm having?

wxPython help please

2006-12-16 Thread Jive Dadson
I hope someone can help me with a couple of wxPython questions, or point me to the right newsgroup for the questions. I am trying to modify the floatcanvas demo program. I want to load an image from a file (jpg or whatever), then do a kind of color-picker action on it. I haven't tried yet to

scipy.optimize.lbfgsb help please!!!

2007-01-20 Thread mclaugb
Does anyone out there have a piece of code that demonstrates the use of the lbfgsb multivariate, bounded solver in the scipy.optimize toolkit? An example would get me started because my code below does not seem to work. Thanks alot, Bryan I have tried to use the LBFGSB optimisation algorithm w

Re: help please!!

2007-02-11 Thread hg
darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process > for a Telnet server via a di

Re: help please!!

2007-02-11 Thread azrael
well, this sounds funn. 1) dont expect someone to do your homework. 2) dont expect someone to do dirty homework 3) dont expect someone to do your home work especially when it's something that could make you problems, or the person that is helping you 4) from your message i can "read" that you need

Re: help please!!

2007-02-11 Thread Jonathan Curran
On Sunday 11 February 2007 13:40, darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process

Re: help please!!

2007-02-11 Thread Gabriel Genellina
En Sun, 11 Feb 2007 16:40:45 -0300, darren112 <[EMAIL PROTECTED]> escribió: > The program should support brute-forcing of the authentication process > for a Telnet server via a dictionary attack. You should first read the Python Tutorial. After you get proficient with the basic programming st

Re: help please!!

2007-02-11 Thread azrael
Hey yo kiddie, I hope that you are using the web for some time. So you can get the meaning from my post.: LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL, ROTF, LOL,

Re: help please!!

2007-02-11 Thread James Stroud
darren112 wrote: > Hi Im new to python and I desperately need help with this task > This is everything of what I need to do... > > The program to be written in Python obviously.. > > The program should support brute-forcing of the authentication process > for a Telnet server via a dic

Tkinter help, please...

2007-05-24 Thread Medi Ochre
I've been away from Python for some time, and I'm just starting to look at Tkinter. Just so you know, I'm coming from Visual Basic, where this would, I *think*, not have been a problem, so it must be a case of getting my head around the Tkinter way of doing things. In a nutshell, I've written a

Re: SMTP help please

2005-06-07 Thread Simon Brunning
On 6/7/05, Ivan Shevanski <[EMAIL PROTECTED]> wrote: > I really can't figure out anything about the SMTP module. . .I think I'm in > over my head( Im pretty new to python). Can someone show me a really(and I > mean REALLY) basic tutorial for smtp or explain it?

Re: SMTP help please

2005-06-07 Thread Martin Franklin
Ivan Shevanski wrote: > I really can't figure out anything about the SMTP module. . .I think I'm > in over my head( Im pretty new to python). Can someone show me a > really(and I mean REALLY) basic tutorial for smtp or explain it? > > program: > I want to make my program have a feedback form at

Re: SMTP help please

2005-06-07 Thread Tim Williams
- Original Message - From: "Martin Franklin" <[EMAIL PROTECTED]> > server.sendmail(fromaddr, toaddrs, msg) You can use this if you don't need to worry about whether the email was successfully sent to all recipients. Otherwise, you need something like this (untested and partly copied

Re: SMTP help please

2005-06-07 Thread Tim Williams
- Original Message - From: "Tim Williams" <[EMAIL PROTECTED]> > > try: > s.close() > except > pass Typo!! That should be s.quit() not s.close() :) -- http://mail.python.org/mailman/listinfo/python-list

Re: SMTP help please

2005-06-07 Thread Martin Franklin
Tim Williams wrote: > - Original Message - > From: "Tim Williams" <[EMAIL PROTECTED]> > >>try: >>s.close() >>except >>pass > > > Typo!! > > That should be s.quit() not s.close() > > :) > > > > and perhaps put into a finally: Mart -- http://mail.python.org/mailma

Re: SMTP help please

2005-06-07 Thread Larry Bates
I have found that the SmtpWriter class "hides" all the complexity in creating emails like you want to send. Check it out here: http://motion.sourceforge.net/related/send_jpg.py HTH, Larry Bates Syscon, Inc. Ivan Shevanski wrote: > I really can't figure out anything about the SMTP module. . .I

Re: SMTP help please

2005-06-07 Thread Ivan Shevanski
>From: Larry Bates <[EMAIL PROTECTED]> >To: Ivan Shevanski <[EMAIL PROTECTED]> >Subject: Re: SMTP help please >Date: Tue, 07 Jun 2005 07:39:01 -0500 > >I have found that the SmtpWriter class "hides" all the >complexity in creating emails like you

Re: SMTP help please

2005-06-07 Thread Mike Meyer
Martin Franklin <[EMAIL PROTECTED]> writes: > server = smtplib.SMTP("mailserver.somewhere.com") Why are you beating up Kee's mail server (hint: "whois somewhere.com")? See RFC 2606 http://www.ietf.org/rfc/rfc2606.txt > and search for "example.com" for how to pick example domain names properly.

Re: UnicodeDecodeError help please?

2006-04-07 Thread Robert Kern
Robin Haswell wrote: > Okay I'm getting really frustrated with Python's Unicode handling, I'm > trying everything I can think of an I can't escape Unicode(En|De)codeError > no matter what I try. Have you read any of the documentation about Python's Unicode support? E.g., http://effbot.org/zone/

Re: UnicodeDecodeError help please?

2006-04-07 Thread Fredrik Lundh
Robin Haswell wrote: > Could someone explain to me what I'm doing wrong here, so I can hope to > throw light on the myriad of similar problems I'm having? Thanks :-) > > Python 2.4.1 (#2, May 6 2005, 11:22:24) > [GCC 3.3.6 (Debian 1:3.3.6-2)] on linux2 > Type "help", "copyright", "credits" or "li

Re: UnicodeDecodeError help please?

2006-04-07 Thread Paul Boddie
Robin Haswell wrote: > Okay I'm getting really frustrated with Python's Unicode handling, I'm > trying everything I can think of an I can't escape Unicode(En|De)codeError > no matter what I try. If you follow a few relatively simple rules, the days of Unicode errors will be over. Let's take a look

Re: UnicodeDecodeError help please?

2006-04-07 Thread Ben C
On 2006-04-07, Robin Haswell <[EMAIL PROTECTED]> wrote: > Okay I'm getting really frustrated with Python's Unicode handling, I'm > trying everything I can think of an I can't escape Unicode(En|De)codeError > no matter what I try. > > Could someone explain to me what I'm doing wrong here, so I can h

Re: wxPython help please

2006-12-16 Thread Sandra-24
Try the wxPython mailing list, which you can find on their site. And the best wxPython reference is the book (also available as an e-book) by Robin Dunn, who created wxPython. Seeing wxPython from his perspective is well worth the money. If I recall correctly he devoted an entire chapter to drawing

Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote: > Try the wxPython mailing list, which you can find on their site. And > the best wxPython reference is the book (also available as an e-book) > by Robin Dunn, who created wxPython. Seeing wxPython from his > perspective is well worth the money. If I recall correctly he devoted > a

Re: wxPython help please

2006-12-16 Thread Jive Dadson
Sandra-24 wrote: > Try the wxPython mailing list, which you can find on their site. And > the best wxPython reference is the book (also available as an e-book) > by Robin Dunn, who created wxPython. Seeing wxPython from his > perspective is well worth the money. If I recall correctly he devoted > a

Re: wxPython help please

2006-12-16 Thread Sandra-24
On Dec 16, 8:43 pm, Jive Dadson <[EMAIL PROTECTED]> wrote: >I bought the ebook. Searching for "pixel", all I came up with was a > method called GetPixel in a "device context." I know there must be a > device context buried in there somewhere, so now I need to winkle it out. You are right that yo

List comparison help please

2006-08-20 Thread Bucco
I am trying to compare a list of items to the list of files generated by os.listdir. I am having trouble getting this to work and think I may be going down the wrong path. Please let me know if hter is a better way to do this. THis is what I have for my class so far: import os, sys class Match

Re: scipy.optimize.lbfgsb help please!!!

2007-01-20 Thread Robert Kern
mclaugb wrote: > Does anyone out there have a piece of code that demonstrates the use of the > lbfgsb multivariate, bounded solver in the scipy.optimize toolkit? An > example would get me started because my code below does not seem to work. You will probably get better/faster/more answers on th

Re: scipy.optimize.lbfgsb help please!!!

2007-01-20 Thread mclaugb
Just to clarify--this is a multivariate algorithm. I changed the function Permmin to simply take the absolute value of (xmin, ymin) so that it returns one value. Unfortunately, the error remains--it still returns this error: " x, f, d = lbfgsb.fmin_l_bfgs_b(Permmin, x0, Jacobi, params, bounds

Re: scipy.optimize.lbfgsb help please!!!

2007-01-20 Thread Robert Kern
mclaugb wrote: > Just to clarify--this is a multivariate algorithm. Yes. That means that the domain of the objective function is multivariate. The image is still a scalar. RR^n -f-> RR > I changed the function > Permmin to simply take the absolute value of (xmin, ymin) so that it returns >

Re: scipy.optimize.lbfgsb help please!!!

2007-01-20 Thread Robert Kern
mclaugb wrote: > " x, f, d = lbfgsb.fmin_l_bfgs_b(Permmin, x0, Jacobi, params, > bounds=[(.001,100),(-50,-.001)] , maxfun=500) > File "C:\Python24\lib\site-packages\scipy\optimize\lbfgsb.py", line 197, > in fmin_l_bfgs_b > isave, dsave) > ValueError: failed to initialize intent(inout) array

Re: Tkinter help, please...

2007-05-24 Thread John McMonagle
I've made a couple of minor changes to your code from the Cribbage class down: class Cribbage: def __init__(self, win): self.parent = win# < make the toplevel Tk window an # < attribute of the class #Draw the interface

Re: Tkinter help, please...

2007-05-24 Thread Medi Ochre
John McMonagle wrote: > I've made a couple of minor changes to your code from the Cribbage class > down: > > class Cribbage: > def __init__(self, win): > ... > score = run.play() > if score >= best: best = score > time.sleep(1) <--- short sleep to see what's

need some cgi help please

2005-06-07 Thread nephish
Hey there. Here is the deal i have a script that is supposed to open a file based on criteria from a web form. i cant seem to get it to work though. here is the code: form = cgi.FieldStorage() DataRecord = form['DataTime'].value Customer = form['CustName'].value # should be automatically fill

Help please using telnetlib module

2006-12-23 Thread dudds
Hi Guys, I just started learning Python a couple of days ago and to put some of what I learnt into practice. As such I thought I might try and write a simple program (based on examples I had seen) that would allow me to log into a Cisco router, enter configuration mode, change an interface descrip

Re: List comparison help please

2006-08-20 Thread Felipe Almeida Lessa
20 Aug 2006 14:47:14 -0700, Bucco <[EMAIL PROTECTED]>: > I am trying to compare a list of items to the list of files generated > by os.listdir. I am having trouble getting this to work and think I > may be going down the wrong path. Please let me know if hter is a > better way to do this. THis i

Re: List comparison help please

2006-08-20 Thread Simon Forman
Bucco wrote: > I am trying to compare a list of items to the list of files generated > by os.listdir. I am having trouble getting this to work and think I > may be going down the wrong path. Please let me know if hter is a > better way to do this. THis is what I have for my class so far: > > imp

Re: List comparison help please

2006-08-20 Thread Bucco
Simon Forman wrote: > 1) Don't use "dir", "file", and "list" as variable names, those are > already python built in objects (the dir() function, list type, and > file type, respectively.) Thanks. My own stupidity on this one. > 2) 'r' is the default for open(), omit it. "self.flist = > open(

Re: List comparison help please

2006-08-25 Thread Simon Forman
Bucco wrote: > Simon Forman wrote: > > > 1) Don't use "dir", "file", and "list" as variable names, those are > > already python built in objects (the dir() function, list type, and > > file type, respectively.) > > Thanks. My own stupidity on this one. > > > > 2) 'r' is the default for open(), omi

Newbie wxpython staticbitmap help please

2006-06-14 Thread janama
Hi, how do i go about having my little gui (boa) app updating (changing) the bitmap used in a StaticBitmap automatically. In the example below when i click the button the app check checks to see if a file exists and if so it swaps the StaticBitmap in the gui to another bitmap. Can somewho

Re: need some cgi help please

2005-06-08 Thread nephish
no takers? -- http://mail.python.org/mailman/listinfo/python-list

Re: need some cgi help please

2005-06-08 Thread Douglas Soares de Andrade
Hi ! Im a python begginer, but... > form = cgi.FieldStorage() > DataRecord = form['DataTime'].value > Customer = form['CustName'].value # should be automatically filled in > Can you try this ? print "Content-Type: text/html\n\n" print WorkingFile = open("/var/www/stretch/web_root/SidCrops/"+C

Help please with binary file read

2006-01-01 Thread Stewart Arnold
I'm trying to convert a Real Basic routine into Python and I can't read the long integer data from a file. Here is the Real Basic code: b=f.OpenAsBinaryFile b.LittleEndian=True i=b.ReadByte titles=b.ReadLong shows=b.ReadLong i=b.ReadLong And here is my code:

Re: need some cgi help please

2005-06-08 Thread Greg Ewing
[EMAIL PROTECTED] wrote: > IOError: [Errno 2] No such file or directory: > '/var/www/stretch/web_root/SidCrops/tenderloin/Tue Jun 7 20:13:35 > 2005.txt' > args = (2, 'No such file or directory') The web server isn't running in a chrooted environment or anything, is it? Are there any other

Re: need some cgi help please

2005-06-08 Thread nephish
i fixed it. the program was going nuts because there were spaces in the name of the file. go figgure. anyway, i changed the way i format the timestamp that becomes the file name and removed the spaces. working all better now. thanks -- http://mail.python.org/mailman/listinfo/python-list

Strings and % sign fails - Help Please

2006-03-23 Thread siasookhteh
I also posted this in Django Users group, but figured it probably has more relevance for python group. It seems like a freak problem to me. I spent a long hour to track the problem down and here it is: The following statement fails because it has the '%' sign in it. cursor.execute("select '%'")

Re: Help please using telnetlib module

2006-12-24 Thread Birdman
Simplest explanation is that you can't do a 'show run' from global configuration mode try something like #exit global configuration mode tn.write('end\n') print tn.read_until('#') #disable pause after 24 lines tn.write('term len 0\n') tn.read_until('#') #now show the entire running-config t

Re: Newbie wxpython staticbitmap help please

2006-06-14 Thread jean-michel bain-cornu
janama a écrit : > Can somewhone add a wx.Timer example to this to make it check > if the file exists every minute or so , instead of clicking the button > to check and update this? Or is there a better way of auto updating my > little gui apps StaticBitmap if a file exists? Why won't you

Re: Newbie wxpython staticbitmap help please

2006-06-15 Thread janama
jean-michel bain-cornu wrote: > Why won't you write it yourself using the demo ? > It's clear and well documented. > Regards, > jm Hi, have been just trying for 5 hours with the timer demo in wx, i just havnt clicked with how to tie it in together, I know (think) i need the following features fr

Re: Newbie wxpython staticbitmap help please

2006-06-15 Thread jean-michel bain-cornu
> Thanks for any help with any of this I have no time at the moment. I'm going to try to give you an answer tomorrow morning (june 16) (if nobody did of course). See you jm -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie wxpython staticbitmap help please

2006-06-16 Thread jean-michel bain-cornu
Hi, janama a écrit : > jean-michel bain-cornu wrote: >> Why won't you write it yourself using the demo ? >> It's clear and well documented. >> Regards, >> jm > > Hi, have been just trying for 5 hours with the timer demo in wx, i just > havnt clicked with how to tie it in together, > > I know (thi

Re: Newbie wxpython staticbitmap help please

2006-06-16 Thread janama
Thanks Jean this now makes sense, really appreciate your time and effort mate. def __init__(self, parent): self._init_ctrls(parent) self.t1 = wx.Timer(self) self.t1.Start(2000) # 2 seconds self.Bind(wx.EVT_TIMER, self.OnTest1Timer) self.OnTest1Timer(sel

Entry Value won't get updated...Help please

2005-04-19 Thread Clara
I tried to print the value of my entry widget by passing the result of controlvariable.get() in Tkinter to a function. However, I kept printing empty string (eventhough I've written something inside the entry widget). But if I first set the value of the entry widget using .set,...I can get the val

Re: Help please with binary file read

2006-01-01 Thread Grant Edwards
On 2006-01-01, Stewart Arnold <[EMAIL PROTECTED]> wrote: > I'm trying to convert a Real Basic routine into Python and I > can't read the long integer data from a file. http://docs.python.org/lib/module-struct.html -- Grant Edwards grante Yow! Here I am in 53

Re: Help please with binary file read

2006-01-01 Thread Stewart Arnold
Grant Perfect! Thanks :) Stewart "Grant Edwards" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 2006-01-01, Stewart Arnold <[EMAIL PROTECTED]> wrote: > >> I'm trying to convert a Real Basic routine into Python and I >> can't read the long integer data from a file. > > http://d

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > The following statement fails because it has the '%' sign in it. > cursor.execute("select '%'") > > The error is: IndexError: list index out of range > > How do I address this problem? Use "%%". -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, a

Re: Strings and % sign fails - Help Please

2006-03-23 Thread siasookhteh
heh.. It works except I am using psycopg.Binary(somebinarystructure), and I am not really doing it by hand to just add the extra %, and psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg package. Any quick way to project a string from freak '%' problems? Thanks, Sia Jorge Godoy w

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > heh.. It works except I am using psycopg.Binary(somebinarystructure), > and I am not really doing it by hand to just add the extra %, and > psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg > package. Any quick way to project a string from freak '%' pro

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
Jorge Godoy wrote: > [EMAIL PROTECTED] writes: > >> heh.. It works except I am using psycopg.Binary(somebinarystructure), >> and I am not really doing it by hand to just add the extra %, and >> psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg >> package. Any quick way to project

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
Erik Max Francis <[EMAIL PROTECTED]> writes: > Raw strings don't have anything to do with format specifiers. I know. I'm just trying to see if there might be some magic going on with his driver... -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
Jorge Godoy wrote: > I know. I'm just trying to see if there might be some magic going on with his > driver... Since raw strings have no effect on format specifiers, that won't tell you anything. >>> r'%' == '%' True His problem is that cursor.execute does format expansion with %, so a sin

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Christoph Zwerschke
Erik Max Francis wrote: > His problem is that cursor.execute does format expansion with %, so a > single % is not legal. Yes, I think psycopg uses paramstyle='pyformat', i.e. it expands parameters in your sql in the usual Python way where % has a special meaning. If you really mean the % sign o

Re: Strings and % sign fails - Help Please

2006-03-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > heh.. It works except I am using psycopg.Binary(somebinarystructure), > and I am not really doing it by hand to just add the extra %, and > psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg > package. or a bug in your use of Binary. what exactly are you

Re: Strings and % sign fails - Help Please

2006-03-24 Thread Siah
Problem Solved. The problem was with psycopg.Binary whose mere job is to convert bytes into clear text for sql statement. I'll be filing a bug. Thanks everyone, Sia -- http://mail.python.org/mailman/listinfo/python-list

Re: Strings and % sign fails - Help Please

2006-03-24 Thread Fredrik Lundh
Siah wrote: > Problem Solved. The problem was with psycopg.Binary whose mere job is > to convert bytes into clear text for sql statement. no, its job is to wrap strings that contain binary blobs, so that data binding works properly. you're supposed to do cursor.execute(statement, Binary(da

HELP PLEASE: What is wrong with this?

2006-04-14 Thread Ralph H. Stoos Jr.
File "autotp.py", line 21 ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") ^ -- http://mail.python.org/mailman/listinfo/python-list

Help Please: 'module' object has no attribute 'compile'

2006-01-06 Thread livin
my log... INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On %2C+100&x=4&y=6'})) INFO INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen INFO File "Q:\python\python23.zlib\urllib.py", line 159, in op

Re: HELP PLEASE: What is wrong with this?

2006-04-14 Thread David Isaac
"Ralph H. Stoos Jr." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > HELP PLEASE: What is wrong with this?File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ Probably the parenthe

Re: HELP PLEASE: What is wrong with this?

2006-04-14 Thread Steve Bergman
Welcome to Python! :-) You may find this mailing list useful: http://mail.python.org/mailman/listinfo/tutor -- http://mail.python.org/mailman/listinfo/python-list

Re: HELP PLEASE: What is wrong with this?

2006-04-15 Thread Sybren Stuvel
Ralph H. Stoos Jr. enlightened us with: > File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ Please post the entire traceback, so we can see the actual error message. Posting the context of the bad line also wouldn't hurt. Sybren -- The probl

Re: HELP PLEASE: What is wrong with this?

2006-04-15 Thread Thomas Jollans
Ralph H. Stoos Jr. wrote: > File "autotp.py", line 21 > ready = raw_input("Ready to proceed ? TYPE (y)es or (n)o: ") > ^ please post the entire output and the surrounding code (as much as reasonable). It may well be some paranthesis error, as alreasy stated. -- Thomas Jollans - http:

Re: Help Please: 'module' object has no attribute 'compile'

2006-01-06 Thread Kent Johnson
livin wrote: > my log... > > INFO urllib.urlopen('http://192.168.1.11/hact/kitchen.asp', > urllib.urlencode({'Action': 'hs.ExecX10ByName+Kitchen+Lights%2C+On > %2C+100&x=4&y=6'})) > INFO > INFO File "Q:\python\python23.zlib\urllib.py", line 78, in urlopen > INFO File "Q:\python\python23.zli

Re: Help Please: 'module' object has no attribute 'compile'

2006-01-07 Thread livin
I beleive so... I cannot know for sure becasue the models are not separate... they are in the python23.zlib file... I'm no sure how to check the file, it looks as if it is compiled (I'm new to python so forgive my ignorance) "Kent Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROT

Re: Help Please: 'module' object has no attribute 'compile'

2006-01-07 Thread Kent Johnson
livin wrote: > I beleive so... I cannot know for sure becasue the models are not > separate... they are in the python23.zlib file... I'm no sure how to check > the file, it looks as if it is compiled (I'm new to python so forgive my > ignorance) Yes, there should be an re module in your Python

Re: Help Please: 'module' object has no attribute 'compile'

2006-01-08 Thread livin
Oh, no I did not create any modules, wish I had the knowledge to do so! I think I've moved beyond whatever that issue was and now getting a timeout. The info is below... any help you can give is appreciate! I'm running this code... import os, re, string, urllib, types data = urllib.urlencode({

opening new window in one window using Tkinter -- Help please

2005-04-24 Thread Clara
Hi,... I meant to write an application where there is a button in a window and when you click on the button, it will open a new window, but I want the first window to close, replaced by the second window. I open a login window and start the mainloop, when the user click on the login button, the __c

Help please: How to assign an object name at runtime

2005-06-29 Thread [EMAIL PROTECTED]
Good day: Probably the answer to my question is staring me in the face, but the solution escapes me. The following is the input line of the file: SoftDict-.csv: ca1017,GRPHScriptSet,ADD/REM,Adobe Acrobat 4.0=2005/06/14 I expected an instance of Machine() to be created with a name ca1017. Inste

  1   2   >