ANN: Gmatch, a tiny matcher of google-like queries

2009-02-02 Thread denis-bz-gg
Gmatch is a tiny matcher of google-like query patterns, called goopats: gm = Gmatch( color: blue - sky size: 100 ) if gm.match( record ): ... matching_records = [rec for rec in records if gm.match( rec )] A record is a dict, or namedtuple, or Dotdict, or anything with

AVC 0.7.0 released

2009-02-02 Thread Fabrizio Pollastri
Announcing AVC 0.7.0 Webpage: http://avc.inrim.it/ What is AVC? - AVC is a multiplatform, fully automatic, live connection among graphical interface widgets and application variables for the python language. AVC supports in a uniform way the most

ANN: gmpy 1.04 released

2009-02-02 Thread casevh
Everyone, A new version of gmpy is available. gmpy is a wrapper for the GMP multiple-precision arithmetic library. This version of gmpy also supports the MPIR multiple-precision arithmetic library. gmpy 1.04 is available for download from http://code.google.com/p/gmpy/ There are several new

Financial aid for PyCon 2009 is now available

2009-02-02 Thread Ted Pollari
I'm happy to announce that the Python Software Foundation has allocated funds to help people attend PyCon 2009! If you would like to come to PyCon but can't afford it, the PSF may be able to help you pay for registration, lodging/hotel costs and transportation (flight etc.). Please see

Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use')

2009-02-02 Thread Hendrik van Rooyen
Steve Holden s...@hol.eb.com wrote: My previous reply assumed you are running some UNIX-like operating system. If you are on Windows then Jean-Paul's advice stands, as Windows *does* allow several processes to listen on the same port and randomly delivers incoming connections to one of the

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
rd.mur...@bitdance.com wrote: You, sir, should be programming in some language other than Python. Why? - Python is object oriented, but I can write whole systems without defining a single class. By analogy, if data hiding is added to language, I could write a whole system without hiding

Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney bignose+hates-s...@benfinney.id.au wrote: rdmur...@bitdance.com writes: I don't even see Stephen Hansen's posts. My newsreader just shows the header and says [HTML part not displayed]. Likewise. Yeah, I know HTML is bad on newsgroups. I didn't

[2.5.1] Comparing dates?

2009-02-02 Thread Gilles Ganault
Hello I have data in an SQL database where one column contains a date formated as DD/MM/Y. I need to select all rows where the date is before, say Feb 1st 2009, ie. 01/02/2009. Is there a command in Python that does this easily, or should I look into whatever date() function the SQL

Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Sun, Feb 1, 2009 at 7:47 PM, Ben Finney bignose+hates-s...@benfinney.id.au wrote: rdmur...@bitdance.com writes: I don't even see Stephen Hansen's posts. My newsreader just shows the header and says [HTML part not displayed]. Likewise. Yeah, I know HTML is bad on newsgroups. I didn't

Re: Import without executing module

2009-02-02 Thread Taskinoor Hasan
On Mon, Feb 2, 2009 at 1:58 PM, Stephen Hansen apt.shan...@gmail.comwrote: On Sun, Feb 1, 2009 at 11:43 PM, Taskinoor Hasan taskinoor.ha...@csebuet.org wrote: Can anyone explain what is the necessity of executing whole script when importing. Isn't it enough to just put the module name in

Re: Import without executing module

2009-02-02 Thread Ray
Hi Stephen and everyone, On Feb 2, 4:36 pm, Stephen Hansen apt.shan...@gmail.com wrote: Maybe he can wrap the things he dont need inside if __name__ == '__main__': check. -- http://mail.python.org/mailman/listinfo/python-list Yeah but he said he doesn't want to modify the file

Re: is python Object oriented??

2009-02-02 Thread Stephen Hansen
You, sir, should be programming in some language other than Python. Why? - Python is object oriented, but I can write whole systems without defining a single class. By analogy, if data hiding is added to language, I could write a whole system without hiding a single item. Conversely, the

Exception error when accessing the class variable at the termination of the program

2009-02-02 Thread jwalana
Hi All, Here is a sample piece of code with which I am having a problem, with Python version 2.4.4 class Person: Count = 0 # This represents the count of objects of this class def __init__(self, name): self.name = name print name, ' is now created'

Extreme Yaro weirdness

2009-02-02 Thread Ron Garret
I'm running the following WSGI app under Yaro: def error(req): try: req.non_existent_key except: try: return cgitb.html(sys.exc_info()) except: return 'foo' The result of running this is 'foo'. In other words, the reference to the non-existent key generates an

Monitor Internet connections in XP/Vista

2009-02-02 Thread pranav
Hi Folks, I am designing a project for Windows XP/Vista, one part of which is a background process that monitors internet connections. If the user tries to connect to any particular site, say myDummySite.com in then some actions are taken, based on fixed policies. This can be thought of a mini

Re: [2.5.1] Comparing dates?

2009-02-02 Thread Ben Finney
Gilles Ganault nos...@nospam.com writes: I have data in an SQL database where one column contains a date formated as DD/MM/Y. I need to select all rows where the date is before, say Feb 1st 2009, ie. 01/02/2009. The Python data types for date and time are in the ‘datetime’ module

Re: Comparing dates?

2009-02-02 Thread John Machin
On Feb 2, 7:29 pm, Gilles Ganault nos...@nospam.com wrote: Hello         I have data in an SQL database where one column contains a date formated as DD/MM/Y. I need to select all rows where the date is before, say Feb 1st 2009, ie. 01/02/2009. Is there a command in Python that does

Re: English-like Python

2009-02-02 Thread Adelle Hartley
Joe Strout wrote: Aaron Brady wrote: Where functions are first-class objects, a bare function object isn't distinguishable either from its call. That depends not on whether functions are first-class objects, but on the *syntax* of function invocation vs. function reference. It just so

importing module-performance

2009-02-02 Thread S.Selvam Siva
Hi all, I have a small query, Consider there is a task A which i want to perform. To perform it ,i have two option. 1)Writing a small piece of code(approx. 50 lines) as efficient as possible. 2)import a suitable module to perform task A. I am eager to know,which method will produce best

Re: what IDE is the best to write python?

2009-02-02 Thread Aahz
In article 874ozd3cr3@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Just to register a contrary opinion: I *hate* syntax highlighting On what basis? It makes my eyes bleed -- Aahz (a...@pythoncraft.com) *

Re: Comparing dates?

2009-02-02 Thread John Machin
On Feb 2, 10:07 pm, Gilles Ganault nos...@nospam.com wrote: On Mon, 02 Feb 2009 20:06:02 +1100, Ben Finney bignose+hates-s...@benfinney.id.au wrote: The Python data types for date and time are in the ‘datetime’ module URL:http://www.python.org/doc/2.6/library/datetime. Create a ‘datetime’

the 'right way' to distribute and access data files in a packaged Python module

2009-02-02 Thread David Moss
Hi, I'm the author of netaddr :- http://pypi.python.org/pypi/netaddr/0.6 For release 0.6 I've added setuptools support so it can be distributed as a Python egg package using the easy_install tool. In 0.6, I've started bundling some data files from IEEE and IANA with the code below the

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
r..@bi...nce.com wrote: Quoth Hendrik van Rooyen m...@mi...orp.co.za: Now there are a LOT of dicey statements in the above passionate plea - python is a language, and not a philosophy, but I won't go into that, as that would lead off onto a tangent, of which there have been a

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
Hendrik: I wonder why the designers of processors do such silly things as having user and supervisor modes in the hardware - according to your arguments a code review would solve the problem, and then they could use the silicon saved to do other usefull stuff. - then any process could

Re: Monitor Internet connections in XP/Vista

2009-02-02 Thread Mike Driscoll
On Feb 2, 3:05 am, pranav pra...@gmail.com wrote: Hi Folks, I am designing a project for Windows XP/Vista, one part of which is a background process that monitors internet connections. If the user tries to connect to any particular site, say myDummySite.com in then some actions are taken,

Re: what IDE is the best to write python?

2009-02-02 Thread Joe Riopel
I typically use vim/vi, because it's usually already installed on the OS's I work with and vim for Windows works the same. Also, using the same editor across these different OS's, I don't have to worry too much soft/hard tabs. The contents of rc files on both Windows and UNIX/Linux are the same

Re: ElementTree and clone element toot

2009-02-02 Thread Gerard Flanagan
Gabriel Genellina wrote: En Mon, 02 Feb 2009 12:37:36 -0200, Gerard Flanagan grflana...@gmail.com escribió: e = ET.fromstring(s) def clone(elem): ret = elem.makeelement(elem.tag, elem.attrib) ret.text = elem.text for child in elem: ret.append(clone(child)) return

Re: Membership of multiple items to a list

2009-02-02 Thread Peter Pearson
Sorry to whine, but here's how this looks on slrn: On Mon, 2 Feb 2009 00:24:19 -0800 (PST), Stephen Hansen wrote: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) ---firegpg072eqfqovlg25y5x7pu7mz3 Content-Type: text/plain; format=flowed; charset=UTF-8 Content-Transfer-Encoding:

Re: Extreme Yaro weirdness

2009-02-02 Thread Ron Garret
In article mailman.8612.1233589195.3487.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 02 Feb 2009 06:59:16 -0200, Ron Garret rnospa...@flownet.com escribió: I'm running the following WSGI app under Yaro: def error(req): try:

Re: Import without executing module

2009-02-02 Thread John Machin
On Feb 2, 11:51 pm, pyt...@bdurham.com wrote: If the output is coming from a print command, couldn't the OP temporarily redirect STDIO to a file to prevent the output from being displayed? He could, but that'd be a kludge on top of a stuff-up. He should put the script-only statements inside

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring is not in the given

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring is not in the given

Re: is python Object oriented??

2009-02-02 Thread thmpsn . m . k
On Feb 2, 2:55 am, Stephen Hansen apt.shan...@gmail.com wrote: This is proven by your statement above, whereby you are driving a user away, simply because the language, in one small aspect, does not give him what he wants, and the tenor of this thread has been very much: That's how it is

Re: Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
I have also tried to do this with mechanize: import mechanize import time br = mechanize.Browser() br.open(URL) while True: br.reload() time.sleep(300) After a bunch of time, I get the following error: C:\SDE_KeepAlive-v2.py Traceback (most recent call last): File

Re: What is wrong in my list comprehension?

2009-02-02 Thread Stephen Hansen
str.find() returns -1 on failure (i.e. if the substring is not in the given string). -1 is considered boolean true by Python. That's an odd little quirk... never noticed that before. I just use regular expressions myself. Wouldn't this be something worth cleaning up? It's a little

Re: what IDE is the best to write python?

2009-02-02 Thread Thorsten Kampe
* Robert Comstock (Mon, 2 Feb 2009 06:06:02 -0800 (PST)) Why I like Vim: [...] 5. Can your text editor do this? Vim search and replace, with increment :let i=1 | g/foo/s//\=i.morestuff/ | let i=i+1 I hope my editor wouldn't let me do this... Thorsten --

Re: what IDE is the best to write python?

2009-02-02 Thread Thorsten Kampe
* Aahz (2 Feb 2009 06:30:00 -0800) In article 874ozd3cr3@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Just to register a contrary opinion: I *hate* syntax highlighting On what basis? It makes my eyes bleed Ever tried

Re: What is wrong in my list comprehension?

2009-02-02 Thread Peter Otten
J Kenneth King wrote: Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring

Re: is python Object oriented??

2009-02-02 Thread Bruno Desthuilliers
thmpsn@gmail.com a écrit : On Feb 2, 2:55 am, Stephen Hansen apt.shan...@gmail.com wrote: This is proven by your statement above, whereby you are driving a user away, simply because the language, in one small aspect, does not give him what he wants, and the tenor of this thread has been

Re: What is wrong in my list comprehension?

2009-02-02 Thread MRAB
J Kenneth King wrote: Chris Rebert c...@rebertia.com writes: Python 2.6 (r26:66714, Nov 18 2008, 21:48:52) [GCC 4.0.1 (Apple Inc. build 5484)] on darwin Type help, copyright, credits or license for more information. bool(-1) True str.find() returns -1 on failure (i.e. if the substring is

Re: what IDE is the best to write python?

2009-02-02 Thread Aahz
In article mpg.23f146877dac7c30989...@news.individual.de, Thorsten Kampe thors...@thorstenkampe.de wrote: * Aahz (2 Feb 2009 06:30:00 -0800) In article 874ozd3cr3@benfinney.id.au, Ben Finney bignose+hates-s...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: Just to register a

Re: the 'right way' to distribute and access data files in a packaged Python module

2009-02-02 Thread Diez B. Roggisch
David Moss wrote: Hi, I'm the author of netaddr :- http://pypi.python.org/pypi/netaddr/0.6 For release 0.6 I've added setuptools support so it can be distributed as a Python egg package using the easy_install tool. In 0.6, I've started bundling some data files from IEEE and IANA

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Stephen Hansen apt.shan...@gmail.com writes: str.find() returns -1 on failure (i.e. if the substring is not in the given string). -1 is considered boolean true by Python. That's an odd little quirk... never noticed that before. I just use regular expressions myself. Wouldn't this be

Combining several text files

2009-02-02 Thread Eric
This is my first post, so please advise if I'm not using proper etiquette. I've actually searched around a bit and while I think I can do this, I can't think of a clean elegant way. I'm pretty new to Python, but from what I've learned so far is that there is almost always an easier way. I have to

Re: nth root

2009-02-02 Thread Mensanator
On Feb 2, 1:01 am, casevh cas...@gmail.com wrote: On Feb 1, 10:02 pm, Mensanator mensana...@aol.com wrote: On Feb 1, 8:20 pm, casevh cas...@gmail.com wrote: On Feb 1, 1:04 pm, Mensanator mensana...@aol.com wrote: On Feb 1, 2:27 am, casevh cas...@gmail.com wrote: On Jan 31,

Re: is python Object oriented??

2009-02-02 Thread rdmurray
Quoth Hendrik van Rooyen m...@microcorp.co.za: rd.mur...@bitdance.com wrote: You, sir, should be programming in some language other than Python. Why? - Python is object oriented, but I can write whole systems without defining a single class. By analogy, if data hiding is added to

Re: Extreme Yaro weirdness

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 14:10:19 -0200, Ron Garret rnospa...@flownet.com escribió: In article mailman.8612.1233589195.3487.python-l...@python.org, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: [...] you hit a known bug in cgitb - see http://bugs.python.org/issue4643 for a solution. Aha!

Re: Refreshing an IE Webpage

2009-02-02 Thread K-Dawg
Please disregard... I was making it harder than it had to be I think. The following seems to be running fine. Whether its doing what I want I will know in a little bit if the page in my browser times out import win32com.client, pythoncom from time import sleep

Calling into Python from a C thread

2009-02-02 Thread Philip Semanchuk
Hi all, I'm trying call Python from inside of a C thread that's running in a Python extension I've written and I am not having much luck. My C thread function consists of simply this, and I get a segmentation fault from Python: void start_routine(union sigval foo) { PyGILState_STATE

faster scipy.percentileofscore ?

2009-02-02 Thread Vincent Davis
Currently I am using the following: pgrades = [scipy.percentileofscore(grades,x) for x in grades] I need the percentile of each number in grades. The problem is that it takes a long time (a few minutes) because there are 15,000 items in the list. does anyone know is there is a faster way? Thanks

Re: is python Object oriented??

2009-02-02 Thread Stephen Hansen
that an underscore convention is just as good, (It isn't), Why isn't it? Because it needs human intervention. Not necessarily at all: that's something that could be checked very readily with static analysis. Why isn't that a good enough tool if policy isn't sufficient? If you scan

Re: Combining several text files

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 9:48 AM, Eric eric.sh...@gmail.com wrote: This is my first post, so please advise if I'm not using proper etiquette. I've actually searched around a bit and while I think I can do this, I can't think of a clean elegant way. I'm pretty new to Python, but from what I've

Re: What is wrong in my list comprehension?

2009-02-02 Thread Stephen Hansen
I'm only curious if it's worth cleaning up because the OP's case is one where there is more than one way to do it. I just think at this point .find is just not the right method to use; substring in string is the way to determine what he wants is all. .find is useful for when you want the

Re: Import without executing module

2009-02-02 Thread python
If the output is coming from a print command, couldn't the OP temporarily redirect STDIO to a file to prevent the output from being displayed? Malcolm - Original message - From: Stephen Hansen apt.shan...@gmail.com To: Ray rayky...@gmail.com Cc: python-list@python.org Date: Sun, 1 Feb

Re: Membership of multiple items to a list

2009-02-02 Thread Duncan Booth
Stephen Hansen apt.shan...@gmail.com wrote: I'm re-sending this same message as the OpenPGP S/MIME attachment format -- just so test if its actually readable by news clients in general. I have absolutely no idea. Not touched a news client in years and years, as I said. It is readable in

Re: Get thread pid

2009-02-02 Thread Ove Svensson
Alejandro alejandro.weinst...@gmail.com writes: On Jan 30, 1:40 pm, Christian Heimes li...@cheimes.de wrote: May I ask why you want to get the TID? htop shows the TID of each thread. Knowing the TID allows me to know which thread is hogging the CPU. If there is a better way to do this, or

Re: faster scipy.percentileofscore ?

2009-02-02 Thread Robert Kern
On 2009-02-02 12:08, Vincent Davis wrote: Currently I am using the following: pgrades = [scipy.percentileofscore(grades,x) for x in grades] I need the percentile of each number in grades. The problem is that it takes a long time (a few minutes) because there are 15,000 items in the list. does

Re: Combining several text files

2009-02-02 Thread Scott David Daniels
Eric wrote: I have to parse several log files Then I can do one of two things. First I could combine them so that the resulting file ends up with the oldest on top and newest on the bottom. Otherwise, I could just iterate over the multiple files within my parser. I don't need working code

Re: Membership of multiple items to a list

2009-02-02 Thread Stephen Hansen
On Mon, Feb 2, 2009 at 10:21 AM, Duncan Booth duncan.bo...@invalid.invalidwrote: Stephen Hansen apt.shan...@gmail.com wrote: I'm re-sending this same message as the OpenPGP S/MIME attachment format -- just so test if its actually readable by news clients in general. I have absolutely no

Re: database wrapper ?

2009-02-02 Thread Stef Mientki
Chris Rebert wrote: On Sun, Feb 1, 2009 at 2:56 PM, Stef Mientki stef.mien...@gmail.com wrote: hello, Until now I used a simple wrapper around pysqlite and pyodbc to manage my databases. Now I'm looking for a better solution, because I've to support a (for this moment) unknown database, and

Reading text file with wierd file extension?

2009-02-02 Thread Lionel
Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: MyTextFile.slc.rsc My code is as follows: Filepath = C:\\MyTextFile.slc.rsc FileH = open(Filepath) The above throws an IOError exception. On a hunch I changed the filename

Re: Reading text file with wierd file extension?

2009-02-02 Thread Simon Brunning
2009/2/2 Lionel lionel.ke...@gmail.com: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: MyTextFile.slc.rsc Some kind of a resource fork, perhaps? Where did the file come from? Python doesn't do anything magic with

Re: Reading text file with wierd file extension?

2009-02-02 Thread Stephen Hansen
The above works well. I am able to open the file and read it's contents. I assume to read a file in text file mode the parameter is scanned for a .txt extension, otherwise the Python runtime doesn't know what version of open(...) to invoke. How do I pass the original filename

Threading / Queue management

2009-02-02 Thread Power Button
hi there, I wonder if anyone can help with the following. I have written a script which polls a server and if it finds and pending orders, it instantiates an new object (foo) - in a new thread and processes some data. In the new object (foo), there are also some long running processes so I am

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Scott David Daniels
Gabriel Rossetti wrote: ... Well, isn't tkinter being removed? (http://www.python.org/dev/peps/pep-3108/) To quote the referenced PEP: Rejected Ideas Modules that were originally suggested for removal ... * Tkinter o Would prevent IDLE from existing. o No

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 10:41 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: MyTextFile.slc.rsc My code is as follows:

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 11:20 am, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 10:41 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Dave Peterson
On Feb 1, 10:57 pm, David Lyon david.l...@preisshare.net wrote: What's wrong with Enstaller from Enthought ? for a start onhttps://svn.enthought.com/enthought/wiki/Enstaller it claims to be depracated... Hello, Actually it was version 2.x and earlier that was deprecated and we just

Re: Reading text file with wierd file extension?

2009-02-02 Thread Diez B. Roggisch
Hi Mike, maybe it's not a true text file? Opening it in Microsoft Notepad gives an unformatted view of the file (text with no line wrapping, just the end-of-line square box character followed by more text, end- of-line character, etc). Wordpad opens it properly i.e. respects the end-of-line

Re: Where to put configuration/data files

2009-02-02 Thread Aahz
In article mailman.7995.1232937535.3487.python-l...@python.org, Jay Bloodworth jbloodwo...@sc.rr.com wrote: Is there a nice cross-platform way to figure out the Right (tm) place to store configuration files and other data? For what purpose? Global program config, user config, what? -- Aahz

Re: Combining several text files

2009-02-02 Thread Eric
On Feb 2, 12:17 pm, Chris Rebert c...@rebertia.com wrote: On Mon, Feb 2, 2009 at 9:48 AM, Eric eric.sh...@gmail.com wrote: This is my first post, so please advise if I'm not using proper etiquette. I've actually searched around a bit and while I think I can do this, I can't think of a clean

Re: What is wrong in my list comprehension?

2009-02-02 Thread rdmurray
Quoth Stephen Hansen apt.shan...@gmail.com: I just think at this point .find is just not the right method to use; substring in string is the way to determine what he wants is all. .find is useful for when you want the actual position, not when you just want to determine if there's a match at

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Wooding
Jon Clements jon...@googlemail.com writes: The int() type gained a bit_length method that returns the number of bits necessary to represent its argument in binary: Any tips on how to get this in 2.5.2 as that's the production version I'm stuck with. def nbits(x): ## Special cases. if x

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 1:20 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 10:41 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming

Combining several text files

2009-02-02 Thread rdmurray
Quoth Eric eric.sh...@gmail.com: This is my first post, so please advise if I'm not using proper etiquette. I've actually searched around a bit and while I think I can do this, I can't think of a clean elegant way. I'm pretty new to Python, but from what I've learned so far is that there is

Re: what IDE is the best to write python?

2009-02-02 Thread Jeroen Ruigrok van der Werven
-On [20090201 15:18], Craig (fasteliteprogram...@yahoo.com) wrote: eclipse With the pydev plugin of course. Personally I prefer to just use vim and (i)python. But at work I am using Eclipse with pydev as well. -- Jeroen Ruigrok van der Werven asmodai(-at-)in-nomine.org / asmodai イェルーン ラウフロック

Re: Problem With py2exe and ConfigParser

2009-02-02 Thread Diez B. Roggisch
berserker...@gmail.com wrote: You can set an example? My English is bad, so I do not quite understand You need to give a proper path to the config.ini. It's not found, which most probably occurs because you give a relative path (config.ini) but that doesn't work because the current working

Re: Config files editor

2009-02-02 Thread Gabriel Genellina
En Sun, 01 Feb 2009 15:17:34 -0200, Tim Michelsen timmichel...@gmx-topmail.de escribió: Hello Python, does anyone know of a Python based project that has a GUI based functionality to edit config files read/written by ConfigParser? I think that people likes the ConfigParser format in part

Re: Does the Python community really follow the philospy of Community Matters?

2009-02-02 Thread Craig Allen
I think what you have found is a remarkable characteristic of this language. Somehow, perhaps something to do with guido or python itself, python has a very strong non-dogmatic streak. It's a relief really. If I were to pose a is python or its community really xyz? I would wonder about the one

Re: Comparing dates?

2009-02-02 Thread Jervis Whitley
Most will have functions like str[pf]time that could be used to similar effect. In mysql this is: str_to_date( '21/02/2008', '%d/%m/%Y') and oracle: to_date( '21/02/2008', 'dd-mm-') Cheers, -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 12:10 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 1:20 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 10:41 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm trying to

Source code for csv module

2009-02-02 Thread vsoler
Hi you all, I just discovered the csv module here in the comp.lang.python group. I have found its manual, which is publicly available, but since I am still a newby, learning techniques, I was wondering if the source code for this module is available. Is it possible to have a look at it? Thanks

Re: Source code for csv module

2009-02-02 Thread Jon Clements
On 2 Feb, 20:46, vsoler vicente.so...@gmail.com wrote: Hi you all, I just discovered the csv module here in the comp.lang.python group. I have found its manual, which is publicly available, but since I am still a newby, learning techniques, I was wondering if the source code for this module

Re: Where to host a (Python) project?

2009-02-02 Thread andrew cooke
On Feb 1, 8:45 pm, a...@pythoncraft.com (Aahz) wrote: [...] I for one won't participate in any list hosted on Google because of the need for a Google login. hi, just fyi, i investigated this and you can join any publicly readable group by sending an email to the -subscribe address. you do not

Re: Source code for csv module

2009-02-02 Thread Tim Chase
I just discovered the csv module here in the comp.lang.python group. It certainly makes life easier. I have found its manual, which is publicly available, but since I am still a newby, learning techniques, I was wondering if the source code for this module is available. Is it possible to

Re: Combining several text files

2009-02-02 Thread MRAB
Eric wrote: This is my first post, so please advise if I'm not using proper etiquette. I've actually searched around a bit and while I think I can do this, I can't think of a clean elegant way. I'm pretty new to Python, but from what I've learned so far is that there is almost always an

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Dickinson
On Jan 31, 7:03 am, Jon Clements jon...@googlemail.com wrote: Any tips on how to get this in 2.5.2 as that's the production version I'm stuck with. It's a bit cheeky, but: from decimal import _nbits as nbits should also work in 2.5.2 (but not in 2.5.1)! Mark --

Re: Source code for csv module

2009-02-02 Thread vsoler
On 2 feb, 21:51, Jon Clements jon...@googlemail.com wrote: On 2 Feb, 20:46, vsoler vicente.so...@gmail.com wrote: Hi you all, I just discovered the csv module here in the comp.lang.python group. I have found its manual, which is publicly available, but since I am still a newby,

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread David Lyon
Hi Dave, As of now, Enstaller 3.x is a command-line only tool but it does provide a lot of benefits over standard setuptools -- uninstall, update/upgrade command, found eggs aren't pre-pended to the full sys.path but instead inserted before the containing directory, etc. Sounds extremely

Re: database wrapper ?

2009-02-02 Thread Martin
Hi, 2009/2/1 Stef Mientki stef.mien...@gmail.com: Googling, I found SQLalchemy, which looks quit good. sqlalchemy was always enough for my needs, I recently found elixir which is yet another wrapper around sqlalchemy. I haven't played too much with it but it seems there are a couple of nice

Re: Reading text file with wierd file extension?

2009-02-02 Thread Diez B. Roggisch
Lionel schrieb: On Feb 2, 12:10 pm, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 1:20 pm, Lionel lionel.ke...@gmail.com wrote: On Feb 2, 10:41 am, Mike Driscoll kyoso...@gmail.com wrote: On Feb 2, 12:36 pm, Lionel lionel.ke...@gmail.com wrote: Hi Folks, Python newbie here. I'm

Re: Threading / Queue management

2009-02-02 Thread Steve Holden
Power Button wrote: hi there, I wonder if anyone can help with the following. I have written a script which polls a server and if it finds and pending orders, it instantiates an new object (foo) - in a new thread and processes some data. In the new object (foo), there are also some long

Re: is python Object oriented??

2009-02-02 Thread Bruno Desthuilliers
Rhodri James a écrit : On Sun, 01 Feb 2009 17:31:27 -, Steve Holden st...@holdenweb.com wrote: Stephen Hansen wrote: [...] don't play with anyone else's privates. A good rule in life as well as programming. Unless, of course, you're both consenting adults. What? Someone had to say

Re: Exception error when accessing the class variable at the termination of the program

2009-02-02 Thread Duncan Booth
jwal...@vsnl.net wrote: Can someone please explain why the exception happens in the case where there is no explicit del statement? When Python is ecleaning up as it exits, it clears all the global variables in each module by setting them to None. This happens in an arbitrary and

Re: Reading text file with wierd file extension?

2009-02-02 Thread Stephen Hansen
class MyUtilityClass: def __init__(self, DataFilepath): Resourcepath = DataFilepath + .rsc DataFileH = open(DataFilepath) ResourceFileH = open(Resourcepath) There's nothing wrong with this code. You have to look elsewhere in your program-- perhaps what calls it.

Re: is python Object oriented??

2009-02-02 Thread Bruno Desthuilliers
thmpsn@gmail.com a écrit : (snip) Anyway, it doesn't matter. We're losing the point here. The point is that language support for private access, by disallowing user access to private data, provides an unambiguous information hiding mechanism which encourages encapsulation. Python's

Re: how to create data to dump into yaml file

2009-02-02 Thread Chris Rebert
On Sun, Feb 1, 2009 at 11:41 PM, sibt...@infotechsw.com wrote: hi I have to create a yaml file using my list of objects.shall i need to create a string using my objects and then load and dump that string or is there any other way to create the yaml file. i want a yaml file to be created

Re: what IDE is the best to write python?

2009-02-02 Thread Robert Comstock
I am personally a fan of vim and ipython. But most of my development is done on a remote system with ssh access. I have used many IDE's over the years and personally I feel like they try to hard to do everything for you that they end up doing very little the way I would like. There are MANY

Re: Number of bits/sizeof int

2009-02-02 Thread John Machin
On Feb 3, 6:50 am, Mark Wooding m...@distorted.org.uk wrote: Jon Clements jon...@googlemail.com writes: The int() type gained a bit_length method that returns the number of bits necessary to represent its argument in binary: Any tips on how to get this in 2.5.2 as that's the production

Re: What is wrong in my list comprehension?

2009-02-02 Thread Jason Scheirer
On Feb 1, 3:37 am, Peter Otten __pete...@web.de wrote: Hussein B wrote: Hey, I have a log file that doesn't contain the word Haskell at all, I'm just trying to do a little performance comparison: ++ from datetime import time, timedelta, datetime start = datetime.now()

  1   2   3   4   >