Crypto and export laws

2009-09-24 Thread Austin Bingham
I'm trying to get a handle on how python intersects with crypto-related export control laws in the US and elsewhere. My current understanding, per the PSF's wiki, is that any crypto related and potentially export-sensitive code is in the ssl wrapper, and that, in fact, this only links to the actual

Re: Poll: Do you use csv.Sniffer?

2009-09-24 Thread John Machin
On Sep 25, 2:00 pm, Alex_Gaynor wrote: > On Sep 24, 10:26 pm, s...@pobox.com wrote: > > If you are a csv module user, I have a question for you:  Do you use the > > csv.Sniffer class? > > I just used it yesterday :)  Not having it would mean I'd need to add > another dependency to my project so th

Distributing Python-programs to Ubuntu users

2009-09-24 Thread Olof Bjarnason
Hi! I write small games in Python/PyGame. I want to find a way to make a downloadable package/installer/script to put on my webpage, especially for Ubuntu users. I've skimmed a couple of tutorials on how to generate .deb-files, but, wow, it's a whole new skill set to do that! Does anyone have an

Re: easy question, how to double a variable

2009-09-24 Thread devilkin
On 9月22日, 上午4时49分, daggerdvm wrote: > you brain needs error checking! this kid knows error checking...may be he know exceptions as well -- http://mail.python.org/mailman/listinfo/python-list

Re: Twisted: 1 thread in the reactor pattern

2009-09-24 Thread jacopo
On Sep 24, 7:54 pm, exar...@twistedmatrix.com wrote: > On 07:10 am, jacopo.pe...@gmail.com wrote: > > > > > > >On Sep 23, 5:57 pm, exar...@twistedmatrix.com wrote: > >[snip] > > >>It isn't possible.  While the remote methods are running, other events > >>are not being serviced.  This is what is mea

Re: Finding application data after install - a solution?

2009-09-24 Thread Gabriel Genellina
En Thu, 24 Sep 2009 08:21:59 -0300, Wolodja Wentland escribió: You should probably raise this issue at the distutils-sig mailing list: http://www.python.org/community/sigs/current/distutils-sig/ I already did [1] but the distutils developers are quite busy discussing a the new format for se

Re: Anyone with Experience Using WinTV Capture Cards?

2009-09-24 Thread W. eWatson
W. eWatson wrote: A friend is looking for some help with how to use Python to access a WinTV (Go Plus) capture card, and how to display an image from it. Is there some facility that might help him, or does anyone have experience with such use that might suggest sources? Win XP OS. Any general

Re: Poll: Do you use csv.Sniffer?

2009-09-24 Thread Alex_Gaynor
On Sep 24, 10:26 pm, s...@pobox.com wrote: > If you are a csv module user, I have a question for you:  Do you use the > csv.Sniffer class? > >     o Yes, frequently >     o Yes, on occasion >     o I tried it a few times but don't use it now >     o No, I don't need it >     o No, never heard of it

Re: Poll: Do you use csv.Sniffer?

2009-09-24 Thread Mensanator
On Sep 24, 9:26�pm, s...@pobox.com wrote: > If you are a csv module user, I have a question for you: �Do you use the > csv.Sniffer class? > > � � o Yes, frequently > � � o Yes, on occasion > � � o I tried it a few times but don't use it now > � � X No, I don't need it > � � o No, never heard of it

Re: ARP Request/reply in Python

2009-09-24 Thread Join hack
you can use pylibpcap . 2009/9/23 Nattapong Limprungpattanakit > Hello all. > > I want check Mac Address Client on network which alive help me please. > > Thanks. > > -- > Windows Live ??? ? ??? >

Re: Poll: Do you use csv.Sniffer?

2009-09-24 Thread Sean DiZazzo
On Sep 24, 7:26 pm, s...@pobox.com wrote: > If you are a csv module user, I have a question for you:  Do you use the > csv.Sniffer class? > >     o Yes, frequently >     o Yes, on occasion >     o I tried it a few times but don't use it now >     o No, I don't need it >     o No, never heard of it

Re: PExpect on Windows System Using Cygwin

2009-09-24 Thread Sean DiZazzo
On Sep 24, 4:37 pm, Dave Angel wrote: > Kevin Holleran wrote: > > Hello, > > > I downloaded and installed the pexpect module and wrote a script.  All is > > well and good, but the script proved to be pretty useful and now I was asked > > to run it as a scheduled task up on a server to run periodic

Re: Screencapture of a video

2009-09-24 Thread koranthala
On Sep 24, 12:38 pm, koranthala wrote: > Hi, >     I was trying to capture the video which I was viewing using > Imagegrab module in PIL (windows). But, I found that the video was not > captured at all. A quick googling tells me that it is because the > windows does not have access to the viewing

Poll: Do you use csv.Sniffer?

2009-09-24 Thread skip
If you are a csv module user, I have a question for you: Do you use the csv.Sniffer class? o Yes, frequently o Yes, on occasion o I tried it a few times but don't use it now o No, I don't need it o No, never heard of it o No (some other reason) If you don't use it, how do

Re: Re: Re: Date using input

2009-09-24 Thread flebber . crue
I don't think I am using re.compile properly, but thought as this would make my output an object it would be better for later, is that correct? #Obtain date def ObtainDate(date): date = raw_input("Type Date dd/mm/year: ") re.split('[/]+', date) date year = date[-1] month = date[1] day = date[0]

Re: Evaluate coding and style

2009-09-24 Thread Esmail
Brown, Rodrick wrote: I recently started playing with Python about 3 days now (Ex Perl guy) and wanted some input on style and structure of what I'm doing before I really start picking up some bad habits here is a simple test tool I wrote to validate home dirs on my system. Please evaluate an

Anyone with Experience Using WinTV Capture Cards?

2009-09-24 Thread W. eWatson
A friend is looking for some help with how to use Python to access a WinTV (Go Plus) capture card, and how to display an image from it. Is there some facility that might help him, or does anyone have experience with such use that might suggest sources? -- http://mail.python.org/mailman/listinfo

Re: Date using input

2009-09-24 Thread Sean DiZazzo
On Sep 24, 7:49 am, flebber wrote: > On Sep 24, 11:10 pm, flebber wrote: > > > > > On Sep 24, 10:58 pm, Dave Angel wrote: > > > > flebber.c...@gmail.com wrote: > > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > > > class or instructor, I am learning this myself. I ha

Re: IDE for python similar to visual basic

2009-09-24 Thread J Sisson
On Sun, Sep 13, 2009 at 6:25 AM, Nobody wrote: > On Fri, 11 Sep 2009 05:27:59 -0700, r wrote: > > > Sounds like "somebody" failed to get input > > from their users at design time. Or "somebody" has the inability to > > relate to their end users. > > You're assuming that there is some "right" an

Re: Doubley imported module caused devastating bug

2009-09-24 Thread Daniel Stutzbach
On Thu, Sep 24, 2009 at 2:51 PM, Ethan Furman wrote: > I believe that modules are imported only once > That's *mostly* true, but try this one: A.py: print 'Importing A' import B B.py: print 'Importing B' import A Cashew:/tmp$ python2.5 B.py Importing B Importing A Importing B -- Daniel Stutz

Re: PExpect on Windows System Using Cygwin

2009-09-24 Thread Dave Angel
Kevin Holleran wrote: Hello, I downloaded and installed the pexpect module and wrote a script. All is well and good, but the script proved to be pretty useful and now I was asked to run it as a scheduled task up on a server to run periodically. I was intending on simply packaging it up with Py

Re: Regex trouble

2009-09-24 Thread Simon Forman
On Thu, Sep 24, 2009 at 6:31 PM, Rhodri James wrote: > On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman > wrote: > >> FWIW this problem is too simple (IMHO) for regular expressions. >> Simply carve off the first three digits and check against sets of the >> prefixes you're interested in: >> >> >>

Re: Re: Date using input

2009-09-24 Thread flebber . crue
Okay, thanks for the advice that sounds a good place to start. I used %2.os was an attempt to define width and precision to stop typo errors eg the user accidentally inputing 101/09/2009 or similar error. So that the __/__/ was adhered to. I will go back to the start get the basics happ

Re: Regex trouble

2009-09-24 Thread Rhodri James
On Thu, 24 Sep 2009 19:45:37 +0100, Simon Forman wrote: FWIW this problem is too simple (IMHO) for regular expressions. Simply carve off the first three digits and check against sets of the prefixes you're interested in: #any number starting with these prefixes is not long distance local_pr

Re: iterate over list while changing it

2009-09-24 Thread Rhodri James
On Thu, 24 Sep 2009 21:32:53 +0100, Torsten Mohr wrote: Hello, a = [1, 2, 3, 4, 5, 6] for i, x in enumerate(a): if x == 3: a.pop(i) continue if x == 4: a.push(88) print "i", i, "x", x I'd like to iterate over a list and change that list while iterating.

Re: Intercepting binding?

2009-09-24 Thread Rhodri James
On Thu, 24 Sep 2009 13:39:57 +0100, andrew cooke wrote: On Sep 24, 5:20 am, Steven D'Aprano wrote: Speaking as a user (although not of Andrew's domain specific language), I'd like to say to developers PLEASE PLEASE PLEASE don't try to "help me" with half-baked unreliable solutions that onl

Re: iterate over list while changing it

2009-09-24 Thread Simon Forman
On Thu, Sep 24, 2009 at 4:32 PM, Torsten Mohr wrote: > Hello, > > a = [1, 2, 3, 4, 5, 6] > > for i, x in enumerate(a): >    if x == 3: >        a.pop(i) >        continue > >    if x == 4: >        a.push(88) > >    print "i", i, "x", x > > I'd like to iterate over a list and change that list whil

Re: Evaluate coding and style

2009-09-24 Thread Rhodri James
On Thu, 24 Sep 2009 21:11:36 +0100, Brown, Rodrick wrote: I recently started playing with Python about 3 days now (Ex Perl guy) and wanted some input on style and structure of what I'm doing before I really start picking up some bad habits here is a simple test tool I wrote to validate

Re: urllib, can't seem to get form post right

2009-09-24 Thread Jon Clements
On 24 Sep, 22:18, "Adam W." wrote: > I'm trying to scrape some historical data from NOAA's website, but I > can't seem to feed it the right form values to get the data out of > it.  Heres the code: > > import urllib > import urllib2 > > ## The source pagehttp://www.erh.noaa.gov/bgm/climate/bgm.sht

Re: Evaluate coding and style

2009-09-24 Thread Jon Clements
On 24 Sep, 21:11, "Brown, Rodrick " wrote: > I recently started playing with Python about 3 days now (Ex Perl guy) and > wanted some input on style and structure of what I'm doing before I really > start picking up some bad habits here is a simple test tool I wrote to > validate home dirs on my

Re: Doubley imported module caused devastating bug

2009-09-24 Thread Terry Reedy
Zac Burns wrote: On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote: On Sep 24, 10:26 am, Zac Burns wrote: Currently it is possible to import a file of one path to more than one 'instance' of a module. One notable example is "import __init__" from a package. Seehttp://stackoverflow.com/questi

urllib, can't seem to get form post right

2009-09-24 Thread Adam W.
I'm trying to scrape some historical data from NOAA's website, but I can't seem to feed it the right form values to get the data out of it. Heres the code: import urllib import urllib2 ## The source page http://www.erh.noaa.gov/bgm/climate/bgm.shtml url = 'http://www.erh.noaa.gov/bgm/climate/pic

Re: When is divmod(a,b)[0] == floor(a/b)-1 ?

2009-09-24 Thread kj
In Robert Kern writes: >On 2009-09-24 14:40 PM, kj wrote: >> >> The docs for divmod include the following: >> >> divmod(a, b) >> ...For floating point numbers the result is (q, a % b), where q >> is usually math.floor(a / b) but may be 1 less than that. ... >> >> I know that floa

Re: Evaluate coding and style

2009-09-24 Thread Ethan Furman
Brown, Rodrick wrote: I recently started playing with Python about 3 days now (Ex Perl guy) and wanted some input on style and structure of what I'm doing before I really start picking up some bad habits here is a simple test tool I wrote to validate home dirs on my system. Please evaluate an

Re: iterate over list while changing it

2009-09-24 Thread Terry Reedy
Torsten Mohr wrote: Hello, a = [1, 2, 3, 4, 5, 6] for i, x in enumerate(a): If you change a list while iterating over, start at the tail. ...reversed(enumerate(a)) if x == 3: a.pop(i) del a[i] # you already have the item continue if x == 4: a.push(88)

Re: When is divmod(a,b)[0] == floor(a/b)-1 ?

2009-09-24 Thread Robert Kern
On 2009-09-24 14:40 PM, kj wrote: The docs for divmod include the following: divmod(a, b) ...For floating point numbers the result is (q, a % b), where q is usually math.floor(a / b) but may be 1 less than that. ... I know that floating point math can sometimes produce "unexpect

Re: Doubley imported module caused devastating bug

2009-09-24 Thread Zac Burns
On Thu, Sep 24, 2009 at 1:38 PM, Carl Banks wrote: > On Sep 24, 10:26 am, Zac Burns wrote: >> Currently it is possible to import a file of one path to more than one >> 'instance' of a module. One notable example is "import __init__" from >> a package. >> Seehttp://stackoverflow.com/questions/436

help wanted with list

2009-09-24 Thread Xavier Lapointe
Not sure I understand well, but let say I did.. list[list.index('a')+1] Le 14:59, Ahmed Shamim a écrit : list = [ 'a', '1', 'b', '2'] what would be the logic, if I input a to get output 1. -- http://mail.python.org/mailman/listinfo/python-list

Re: help wanted with list

2009-09-24 Thread Simon Brunning
2009/9/24 Ahmed Shamim : > list = [ 'a', '1', 'b', '2'] > what would be the logic, if I input a to get output 1. Turn it into a dictionary first: >>> mylist = [ 'a', '1', 'b', '2'] >>> mydict = dict(zip(mylist[::2], mylist[1::2])) >>> mydict['a'] '1' -- Cheers, Simon B. -- http://mail.python.o

iterate over list while changing it

2009-09-24 Thread Torsten Mohr
Hello, a = [1, 2, 3, 4, 5, 6] for i, x in enumerate(a): if x == 3: a.pop(i) continue if x == 4: a.push(88) print "i", i, "x", x I'd like to iterate over a list and change that list while iterating. I'd still like to work on all items in that list, which is n

Re: Doubley imported module caused devastating bug

2009-09-24 Thread Carl Banks
On Sep 24, 10:26 am, Zac Burns wrote: > Currently it is possible to import a file of one path to more than one > 'instance' of a module. One notable example is "import __init__" from > a package. > Seehttp://stackoverflow.com/questions/436497/python-import-the-containin... > > This recently cause

Re: help wanted with list

2009-09-24 Thread Iuri
You should use a dictionary. dic = {'a':1, 'b':2} Use dic['a'] to get output 1. []s iurisilvio On Thu, Sep 24, 2009 at 5:31 PM, Ahmed Shamim wrote: > list = [ 'a', '1', 'b', '2'] > what would be the logic, if I input a to get output 1. > -- > http://mail.python.org/mailman/listinfo/python-lis

help wanted with list

2009-09-24 Thread Ahmed Shamim
list = [ 'a', '1', 'b', '2'] what would be the logic, if I input a to get output 1. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looger object only prints "ERROR"s

2009-09-24 Thread Vinay Sajip
On Sep 24, 2:27 pm, daved170 wrote: > hi everybody, > I took your adviced and used theloggingobject. > I copied the example in 16.6.15.2 - "usingloggingin multiple > modules" > fromhttp://docs.activestate.com/activepython/3.1/python/library/logging.html. > > unfortunattly it only prints to file t

Evaluate coding and style

2009-09-24 Thread Brown, Rodrick
I recently started playing with Python about 3 days now (Ex Perl guy) and wanted some input on style and structure of what I'm doing before I really start picking up some bad habits here is a simple test tool I wrote to validate home dirs on my system. Please evaluate and let me know what could

Re: Doubley imported module caused devastating bug

2009-09-24 Thread Ethan Furman
Zac Burns wrote: Currently it is possible to import a file of one path to more than one 'instance' of a module. One notable example is "import __init__" from a package. See http://stackoverflow.com/questions/436497/python-import-the-containing-package This recently caused a devastating bug in s

Repeated output when logging exceptions

2009-09-24 Thread John Gordon
I wrote some code to handle and log exceptions in my application. It works well, but it produces double output for each exception. How can I fix this? Here's the pared-down code: - main.py import exceptionLogger import doStuff exlog = exceptionLogger.exceptionLogger() stuff = doStuff.doStuf

When is divmod(a,b)[0] == floor(a/b)-1 ?

2009-09-24 Thread kj
The docs for divmod include the following: divmod(a, b) ...For floating point numbers the result is (q, a % b), where q is usually math.floor(a / b) but may be 1 less than that. ... I know that floating point math can sometimes produce "unexpected" results, so the above caveat is n

PExpect on Windows System Using Cygwin

2009-09-24 Thread Kevin Holleran
Hello, I downloaded and installed the pexpect module and wrote a script. All is well and good, but the script proved to be pretty useful and now I was asked to run it as a scheduled task up on a server to run periodically. I was intending on simply packaging it up with Py2Exe and moving it to th

Re: pycopg2 build problems

2009-09-24 Thread devaru
On Sep 24, 2:14 am, phi...@semanchuk.com wrote: > Quoting Wolodja Wentland : > > > > > On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote: > >> I'm trying to install psycopg2 on my system. I followed the > >> instruction in INSTALL file and gave the command > >> python setup.py build > >> running bu

Re: DBHandler class for logging?

2009-09-24 Thread kj
In Vinay Sajip writes: >See my answer to a question on Stack Overflow, which has the source >code for a simple handler which writes to a database using the Python >DB-API 2.0: >http://stackoverflow.com/questions/935930/creating-a-logging-handler-to-connect-to-oracle/1014450#1014450 >Although

Re: Python-URL! - weekly Python news and links (Sep 17)

2009-09-24 Thread Cameron Laird
In article , Gabriel Genellina wrote (but I edited): . . . >More ways to define an empty function that you ever imagined: >http://groups.google.com/group/comp.lang.python/t/c9f494b6745c7d74/

Re: Regex trouble

2009-09-24 Thread Simon Forman
On Thu, Sep 24, 2009 at 10:43 AM, Support Desk wrote: > I am trying to loop over a dictionary  of phone numbers and using a python > regex to determine if they are long distance or local and then adding them > to their appropriate dictionary, My regex doesn't appear to be working > though. "doesn

test_sys failed

2009-09-24 Thread Eno Compton 3
On a new python 3 installation on a fedora 7 box, I get a test_sys failure. Here is the console spew. Couldn't find any discussion about this. Suspect I have fouled up but I don' t know how to proceed. Ideas? 853 test_sys 854 test test_sys failed -- Traceback (most recent call last): 8

Re: Date using input

2009-09-24 Thread Dave Angel
flebber wrote: On Sep 24, 11:10 pm, flebber wrote: On Sep 24, 10:58 pm, Dave Angel wrote: flebber.c...@gmail.com wrote: I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python

Doubley imported module caused devastating bug

2009-09-24 Thread Zac Burns
Currently it is possible to import a file of one path to more than one 'instance' of a module. One notable example is "import __init__" from a package. See http://stackoverflow.com/questions/436497/python-import-the-containing-package This recently caused a devastating bug in some of my code. Wha

Re: Twisted: 1 thread in the reactor pattern

2009-09-24 Thread exarkun
On 07:10 am, jacopo.pe...@gmail.com wrote: On Sep 23, 5:57�pm, exar...@twistedmatrix.com wrote: [snip] It isn't possible. �While the remote methods are running, other events are not being serviced. �This is what is meant when people describe Twisted as a "*cooperative* multitasking" syste

Re: Dynamic Form

2009-09-24 Thread Brian Victor
victorsubervi wrote: > On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote: >> Is your web browser re-submitting the form with the same data if you >> refresh the screen? > yes I'm surprised no one has mentioned this before, but the standard approach to this problem is to redirect after a successful

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-24 Thread Tony Schmidt
Hi, Marc-Andre - well, so far you seem to be the only one suggesting that cross-database joins is the way to go - everyone else has been telling me to build a warehouse. I initially was trying to avoid the warehouse idea to "avoid going through the external temporary resource", as you say. But th

Re: Dynamic Form

2009-09-24 Thread BJ Swope
1. Did you try the headers for no-caching of the page? 2. If you wish to avoid dupes in a DB, Primary Keys are the tool to prevent duplicates. On Thu, Sep 24, 2009 at 11:01 AM, victorsubervi wrote: > in line... > > On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote: > >> What is your code not doin

Re: IDE for python similar to visual basic

2009-09-24 Thread brian huggins
> You can also try Eclipse + PyDev. It's not the same as Visual Studio, and I   > am not sure about the GUI builder, but I think it's what you want. I really like Eclipse + Pydev. It is not a GUI builder at all but it has a nice debugger, code completion and that kind of thing. And its free! B

Re: Regex trouble

2009-09-24 Thread MRAB
Support Desk wrote: I am trying to loop over a dictionary of phone numbers and using a python regex to determine if they are long distance or local and then adding them to their appropriate dictionary, My regex doesn't appear to be working though. My regex's are these international__iregex=

Re: Most "active" coroutine library project?

2009-09-24 Thread Michele Simionato
On Aug 23, 5:02 pm, Phillip B Oldham wrote: > I've been taking a look at the multitude of coroutine libraries > available for Python, but from the looks of the projects they all seem > to be rather "quiet". I'd like to pick one up to use on a current > project but can't deduce which is the most po

setting up dynamic descriptors in Python

2009-09-24 Thread brian huggins
Hello, I want to set up descriptors at runtine, but it isn't working the way i would expect. Does anybody know if this is possible? Here is an example: class Descriptor(object): def __init__(self, name) : self.val=0 self.name = name def __get__(self, obj, objtype):

Re: logging.handlers.SMTPHandler question

2009-09-24 Thread Vinay Sajip
On Sep 24, 4:14 am, akonsu wrote: > hello, > > SMTPHAndler seems to email every single record separately. is there a > way to collect all log output and then send it in a single email > message? or do i have to do it manually? > > thanks > konstantin See also http://pypi.python.org/pypi/mailinglo

Re: Date using input

2009-09-24 Thread Tim Chase
Surely getting it tottally mixed up from datetime import date def ObtainDate(params): date = raw_input("Type Date dd/mm/year: %2.0r%2.0r/%2.0r%2.0r/%4.0r %4.0r%4.0r%4.0r") print date.datetime(year-month-day) By setting "date = raw_input(...)", you mask the datetime.date object preventing yo

Re: Dynamic Form

2009-09-24 Thread victorsubervi
in line... On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote: > What is your code not doing? > see below > > Are you winding up with duplicate data in the DB? > yes > > Is your web browser re-submitting the form with the same data if you > refresh the screen? > yes > > Is your web browser pr

Regex trouble

2009-09-24 Thread Support Desk
I am trying to loop over a dictionary of phone numbers and using a python regex to determine if they are long distance or local and then adding them to their appropriate dictionary, My regex doesn't appear to be working though. My regex's are these international__iregex=r'^1?(011|001)' #A

Re: Date using input

2009-09-24 Thread flebber
On Sep 24, 11:10 pm, flebber wrote: > On Sep 24, 10:58 pm, Dave Angel wrote: > > > > > flebber.c...@gmail.com wrote: > > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > > class or instructor, I am learning this myself. I have Hetlands book > > > "Beginning Python Novice

Regex trouble

2009-09-24 Thread Support Desk
I am trying to loop over a dictionary of phone numbers and using a python regex to determine if they are long distance or local and then adding them to their appropriate dictionary, My regex doesn't appear to be working though. My regex's are these international__iregex=r'^1?(011|001)' local__ire

Re: Looger object only prints "ERROR"s

2009-09-24 Thread Jean-Michel Pichavant
Jean-Michel Pichavant wrote: daved170 wrote: hi everybody, I took your adviced and used the logging object. I copied the example in 16.6.15.2 - "using logging in multiple modules" from http://docs.activestate.com/activepython/3.1/python/library/logging.html. unfortunattly it only prints to

Re: Looger object only prints "ERROR"s

2009-09-24 Thread Jean-Michel Pichavant
daved170 wrote: hi everybody, I took your adviced and used the logging object. I copied the example in 16.6.15.2 - "using logging in multiple modules" from http://docs.activestate.com/activepython/3.1/python/library/logging.html. unfortunattly it only prints to file the ERROR level's messages a

Re: Most "active" coroutine library project?

2009-09-24 Thread Antoine Pitrou
Grant Edwards invalid.invalid> writes: > > Back when I worked on one of the first hand-held cellular > mobile phones, it used co-routines where the number of > coroutines was fixed at 2 (one for each register set in a Z80 > CPU). Gotta love the lightning-fast EXX instruction. :-) Regards Antoi

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread D'Arcy J.M. Cain
On Thu, 24 Sep 2009 15:03:26 +0200 Tino Wildenhain wrote: > > In any case, I have a strong philosophical objection to using the same > > name to refer to two different things regardless of any operational > > issues. The manager.firstname and employee.firstname are not the same > > thing and shou

Re: easy question, how to double a variable

2009-09-24 Thread Pablo Torres N.
On Sep 24, 5:51 am, Iain King wrote: > On Sep 23, 7:36 pm, David C Ullrich wrote: > > > > > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > > > >> But you actually want to return twice the value. I don't see how to do >

Looger object only prints "ERROR"s

2009-09-24 Thread daved170
hi everybody, I took your adviced and used the logging object. I copied the example in 16.6.15.2 - "using logging in multiple modules" from http://docs.activestate.com/activepython/3.1/python/library/logging.html. unfortunattly it only prints to file the ERROR level's messages and ignore the othe

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread D'Arcy J.M. Cain
On Thu, 24 Sep 2009 08:49:02 -0400 Joe Riopel wrote: > On Wed, Sep 23, 2009 at 4:21 PM, D'Arcy J.M. Cain wrote: > > In any case, I have a strong philosophical objection to using the same > > name to refer to two different things regardless of any operational > > issues.  The manager.firstname and

Re: Finding application data after install - a solution?

2009-09-24 Thread Tim Golden
Wolodja Wentland wrote: On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote: Wolodja Wentland wrote: Is CSIDL_COMMON_APPDATA and environment variable set on all Windows flavours? Just to clarify, now that I read your post more carefully, there *is* an environment variable APPDATA which is t

Re: Date using input

2009-09-24 Thread flebber
On Sep 24, 10:58 pm, Dave Angel wrote: > flebber.c...@gmail.com wrote: > > I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no > > class or instructor, I am learning this myself. I have Hetlands book > > "Beginning Python Novice to Professional and online documentation > > books so

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread Tino Wildenhain
Hi, ... code, even that is not needed, as the columns are returned in the order specified so code /knows/ that the first column is from /this/ table and the other column with is from /that/ table). Unless you get a dictionary return. In any case, I have a strong philosophical objection to

Re: Finding application data after install - a solution?

2009-09-24 Thread Wolodja Wentland
On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote: > Wolodja Wentland wrote: > >Is CSIDL_COMMON_APPDATA and environment variable set on all Windows > >flavours? > > Certainly all those which Python currently supports. There are > some small subtleties which have changed between older and > new

Re: Date using input

2009-09-24 Thread Dave Angel
flebber.c...@gmail.com wrote: I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python Novice to Professional and online documentation books so Dive into Python, python.org etc. Using the SPE edi

Re: Solved - Python: automate input to MySQL query

2009-09-24 Thread Joe Riopel
On Wed, Sep 23, 2009 at 4:21 PM, D'Arcy J.M. Cain wrote: > In any case, I have a strong philosophical objection to using the same > name to refer to two different things regardless of any operational > issues.  The manager.firstname and employee.firstname are not the same > thing and should have d

Re: Intercepting binding?

2009-09-24 Thread andrew cooke
On Sep 24, 5:20 am, Steven D'Aprano wrote: > Speaking as a user (although not of Andrew's domain specific language), > I'd like to say to developers PLEASE PLEASE PLEASE don't try to "help me" > with half-baked unreliable solutions that only work sometimes. > > There's few things worse than unreli

Re: Re: Date using input

2009-09-24 Thread flebber . crue
I am using python 2.6.2, I haven't updated to 3.0 yet. No I have no class or instructor, I am learning this myself. I have Hetlands book "Beginning Python Novice to Professional and online documentation books so Dive into Python, python.org etc. Using the SPE editor. I have currently only

Re: Average of entries in a list of lists

2009-09-24 Thread Dave Angel
Evora wrote: Hello, I'm a bit of a newbie to python, so this may very well be a basic question: I have a list of lists, with around 1000 lists looking like this: ['0.000744', '0.480106', 'B']. I need the average of the first to entries of all the lists, can anybody help how me to do this? Tha

Re: Date using input

2009-09-24 Thread Dave Angel
flebber wrote: Sorry to ask a simple question but I am a little confused how to combine the input function and the date time module. Simply at the start of the program I want to prompt the user to enter the date, desirably in the format dd/mm/year. However I want to make sure that python underst

Re: Intercepting binding?

2009-09-24 Thread andrew cooke
On Sep 24, 7:12 am, Carl Banks wrote: >     with capture_changed_bindings() as changed: >         b = 5 >         c = 4 >         d = 6 >     print changed > > test() > > Quick and dirty, not robust at all.  But you get the idea. > > Carl Banks brilliant. using the with context is an excellent i

Re: Finding application data after install - a solution?

2009-09-24 Thread Tim Golden
Wolodja Wentland wrote: I think many Windows users would say WTF!? when seeing those directories - and send cordial greetings to you, your parents and your whole family :) That is probably true, but Windows has a 'etc' directory (c:\windows\system32\drivers\etc) which AFAIK contains the hosts f

Re: Intercepting binding?

2009-09-24 Thread Carl Banks
On Sep 23, 7:41 pm, andrew cooke wrote: > On Sep 23, 10:11 pm, Dave Angel wrote: > > > This comes up periodically in this list, and the answer is always > > something like:  you can't get there from here. > > Well, I'm both flexible and desperate, so this is a possible route > (perhaps near enoug

Re: Finding application data after install - a solution?

2009-09-24 Thread Wolodja Wentland
On Thu, Sep 24, 2009 at 04:07 -0300, Gabriel Genellina wrote: > >I do not intentionally focus on UNIX type systems, but I have grown up > >with *nix and I rather follow one scheme than none at all. But the > >proposed way works on Windows as well, although the users might find > >previously unseen

Re: Average of entries in a list of lists

2009-09-24 Thread Xavier Ho
On Thu, Sep 24, 2009 at 8:54 PM, Evora wrote: > > Hello, > > I'm a bit of a newbie to python, so this may very well be a basic question: > > I have a list of lists, with around 1000 lists looking like this: > ['0.000744', '0.480106', 'B']. > > I need the average of the first to entries of all the

Re: Intercepting binding?

2009-09-24 Thread Carl Banks
On Sep 23, 5:49 pm, "Rhodri James" wrote: > On Thu, 24 Sep 2009 01:34:35 +0100, andrew cooke wrote: > > > For example, I assume it's possible to somehow access the dictionary > > for the current block, but I can't see how to do this after > > assignment.  If I do it in the Foo constructor, for ex

Re: custom data warehouse in python vs. out-of-the-box ETL tool

2009-09-24 Thread M.-A. Lemburg
snfctech wrote: > @Lemburg: Thanks for the suggestion. I'm sure you make a fine > product, but my development platform is Linux, and I don't want any > additional Windows servers to deal with (than the ones I'm already > stuck with.) Strange, EasySoft used to support their product on Linux as wel

Re: very weird python bug..

2009-09-24 Thread Christian Heimes
Sampsa Riikonen wrote: > => If I start the program in directory "paska2", everythings OK, but if the > directory name happens to be "python", the importation of the modules goes > nuts! What's inside the python/ subdirectory? Do you happen to have a file called struct.py inside it? -- http://ma

Re: Download and save a picture - urllib

2009-09-24 Thread Piet van Oostrum
> MRAB (M) wrote: >M> mattia wrote: >>> You were right, the problem was with the print function, using a normal >>> write everythong works fine. >>> >M> You should open the output file as binary (it doesn't matter on >M> Linux/Unix, but is a good idea anyway for portability). It probably DO

Re: easy question, how to double a variable

2009-09-24 Thread Iain King
On Sep 23, 7:36 pm, David C Ullrich wrote: > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > > >> But you actually want to return twice the value. I don't see how to do > >> that. > > > What? > > > Seriously? > > You're sa

Average of entries in a list of lists

2009-09-24 Thread Evora
Hello, I'm a bit of a newbie to python, so this may very well be a basic question: I have a list of lists, with around 1000 lists looking like this: ['0.000744', '0.480106', 'B']. I need the average of the first to entries of all the lists, can anybody help how me to do this? Thanks in advance

Re: Creating a local variable scope.

2009-09-24 Thread Albert van der Horst
In article <65e8a017-abcb-49ad-8867-bc473f83e...@s39g2000yqj.googlegroups.com>, Bearophile wrote: >Steven D'Aprano: > >> (3) Create an inner function, then call that. > >Several people after someone gives this anwer. > > >> My personal opinion is that if you really need a local scope >> inside a

very weird python bug..

2009-09-24 Thread Sampsa Riikonen
Dear List, Maybe someone could help out with this mysterious bug.. starting a python program in a directory named "python", makes the importation of modules sometimes impossible with cryptic error messages.. sam...@linux-912g:~> mkdir paska2 sam...@linux-912g:~> sam...@linux-912g:~> echo "import

  1   2   >