Re: Socket issues

2009-01-17 Thread Gary M. Josack
twistedduck9 wrote: Hi all I've been trying to set up sockets on my server (running Apache/2.2.3) using python and I'm confused as to why it doesn't work. I set up a simple listening script which runs without error, and works if a connecting script is run on the same server. However, if I try t

Re: can someone tell me why this doesn't work please python 3

2009-01-14 Thread Gary M. Josack
Ben Kaplan wrote: On Jan 14, 2009, at 9:44 AM, "Gary M. Josack" wrote: garywood wrote: def ask_ok(prompt, retries=4, complaint="Yes or no, please!"): while True: password = input("enter something") if password in ('y', 'ye&#x

Re: can someone tell me why this doesn't work please python 3

2009-01-14 Thread Gary M. Josack
garywood wrote: def ask_ok(prompt, retries=4, complaint="Yes or no, please!"): while True: password = input("enter something") if password in ('y', 'ye', 'yes'): return True if password in ('n', 'no', 'nope'): return False retries = retries - 1 if retri

Re: strange dict issue

2009-01-12 Thread Gary M. Josack
--- -- http://mail.python.org/mailman/listinfo/python-list 'NAME' is the value, and 'key' is the key. Your dictionary has two keys mapped to two values: 'value' -> 'Route66' 'key' -> 'NAME'

Re: parsing csv files class

2008-12-27 Thread Gary M. Josack
int c.bufferp -- А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я -- А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я -- http://mail.python.org/mailman/listinfo/python-list Do you know that there is a csv module in the standard library already? Thanks, Gary M. Josack -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to get the name of an application ?

2008-10-04 Thread Gary M. Josack
/listinfo/python-list Is sys.argv[0] what you want? If so, then os.path.basename(sys.argv[0]) is probably what you want. Thanks, Gary M. Josack -- http://mail.python.org/mailman/listinfo/python-list

Re: [BaseHTTPServer/SimpleHTTPServer] Remove "Server:" header

2008-10-03 Thread Gary M. Josack
you've got ?self.send_header('Server', self.version_string()) in the send_response method of the BaseHTTPRequestHandler class in the BaseHTTPServer module. Long story, short, it's going to be a lot of work to get rid of. [EMAIL PROTECTED] wrote: Hello. I'm using SimpleHTTPServer (work well)

Re: list to tuple conversion

2008-10-01 Thread Gary M. Josack
sc wrote: clp: Thanx to a recent thread I am able to have a print string with a variable number of formatters -- what I now lack for the creation of an elegant print statement is a tuple -- following is the code, the last line of which does not work: #!/usr/bin/python import xml.sax import e

Re: __buitins__ key added during eval()

2008-09-30 Thread Gary M. Josack
William Purcell wrote: I want to use eval to evaluate wx.TextCtrl inputs. How can I keep python from adding the __builtins__ key to mydict when I use it with eval? Other wise I have to __delitem__('__builtins__') everytime I use eval? >>> mydict = {'a':2,'b':3} >>> eval('a*b',mydict) 6 >>> my

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Gary M. Josack wrote: Aaron "Castironpi" Brady wrote: On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Aaron "Castironpi" Brady wrote: On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Chris Rebert wrote: On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose