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

2009-02-02 Thread Hendrik van Rooyen
"Steve Holden" 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 listenin

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
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 a single item. Conversel

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 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 realize that when I installed Fire

[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 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 realize that when I installed

Re: Import without executing module

2009-02-02 Thread Taskinoor Hasan
On Mon, Feb 2, 2009 at 1:58 PM, Stephen Hansen wrote: > On Sun, Feb 1, 2009 at 11:43 PM, Taskinoor Hasan > 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 the namespace > and > > execute when some fun

Re: Import without executing module

2009-02-02 Thread Ray
Hi Stephen and everyone, On Feb 2, 4:36 pm, Stephen Hansen 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 itself-- if he c

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. > Convers

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' Person.Co

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 except

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 fir

Re: [2.5.1] Comparing dates?

2009-02-02 Thread Ben Finney
Gilles Ganault 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 http://www.p

Re: Comparing dates?

2009-02-02 Thread John Machin
On Feb 2, 7:29 pm, Gilles Ganault 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 this easily

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 jus

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 performa

Re: what IDE is the best to write python?

2009-02-02 Thread Aahz
In article <874ozd3cr3@benfinney.id.au>, Ben Finney 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) <*> http://www.pythoncraft.com/

Re: Comparing dates?

2009-02-02 Thread John Machin
On Feb 2, 10:07 pm, Gilles Ganault wrote: > On Mon, 02 Feb 2009 20:06:02 +1100, Ben Finney > > wrote: > >The Python data types for date and time are in the ‘datetime’ module > >http://www.python.org/doc/2.6/library/datetime>. Create a > >‘datetime’ object for each value you want, then compare the

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 site-

Re: is python Object oriented??

2009-02-02 Thread Hendrik van Rooyen
wrote: > Quoth "Hendrik van Rooyen" : > > 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 surfeit in this thread. > > Ah, now

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 >

Re: Monitor Internet connections in XP/Vista

2009-02-02 Thread Mike Driscoll
On Feb 2, 3:05 am, pranav 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, based on fixe

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 too

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 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 ret f = clone(e)

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-Encodin

Re: Extreme Yaro weirdness

2009-02-02 Thread Ron Garret
In article , "Gabriel Genellina" wrote: > En Mon, 02 Feb 2009 06:59:16 -0200, Ron Garret > escribió: > > > 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()) > >

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 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 stri

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Chris Rebert 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 stri

Re: is python Object oriented??

2009-02-02 Thread thmpsn . m . k
On Feb 2, 2:55 am, Stephen Hansen 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 - like it

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 "C:\SDE_KeepAlive

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 lit

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 -- http://mail.python.org/mailman/

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 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 sunglasses? Thors

Re: What is wrong in my list comprehension?

2009-02-02 Thread Peter Otten
J Kenneth King wrote: > Chris Rebert 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 su

Re: is python Object oriented??

2009-02-02 Thread Bruno Desthuilliers
thmpsn@gmail.com a écrit : On Feb 2, 2:55 am, Stephen Hansen 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread MRAB
J Kenneth King wrote: Chris Rebert 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 g

Re: what IDE is the best to write python?

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

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

Re: What is wrong in my list comprehension?

2009-02-02 Thread J Kenneth King
Stephen Hansen 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 somet

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 wrote: > On Feb 1, 10:02 pm, Mensanator wrote: > > > > > > > On Feb 1, 8:20 pm, casevh wrote: > > > > On Feb 1, 1:04 pm, Mensanator wrote: > > > > > On Feb 1, 2:27 am, casevh wrote: > > > > > > On Jan 31, 9:36 pm, "Tim Roberts" wrote: > > > > > > > Actually, all I'm

Re: is python Object oriented??

2009-02-02 Thread rdmurray
Quoth "Hendrik van Rooyen" : > 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

Re: Extreme Yaro weirdness

2009-02-02 Thread Gabriel Genellina
En Mon, 02 Feb 2009 14:10:19 -0200, Ron Garret escribió: In article , "Gabriel Genellina" wrote: [...] you hit a known bug in cgitb - see http://bugs.python.org/issue4643 for a solution. Aha! Thank you! That explains everything, except this: why does the problem go away when I run unde

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 ie=win32com.client.Dispatch('

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 gs

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 sufficien

Re: Combining several text files

2009-02-02 Thread Chris Rebert
On Mon, Feb 2, 2009 at 9:48 AM, 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 t

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 wan

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" To: "Ray" Cc: python-list@python.org Date: Sun, 1 Feb 2009 23:19:09 -0800 Subject: Re: Impo

Re: Membership of multiple items to a list

2009-02-02 Thread Duncan Booth
Stephen Hansen 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 XNews, but only displ

Re: Get thread pid

2009-02-02 Thread Ove Svensson
Alejandro writes: > On Jan 30, 1:40 pm, Christian Heimes 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 there is something fundamentally wrong w

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 an

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 (t

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 wrote: > Stephen Hansen 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 >

Re: database wrapper ?

2009-02-02 Thread Stef Mientki
Chris Rebert wrote: On Sun, Feb 1, 2009 at 2:56 PM, Stef Mientki 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 I'm not the one who wi

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 : > 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 filenames, so this mus

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 (MyT

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 tryi

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 GUI

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 10:41 am, Mike Driscoll wrote: > On Feb 2, 12:36 pm, Lionel 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: > > > Filepath = "C:\\M

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 11:20 am, Lionel wrote: > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > Hi Folks, Python newbie here. > > > > I'm trying to open (for reading) a text file with the following > > > filenaming convension: > > > > "MyTextFile.slc.rsc" > >

Re: Python package Management GUI - New Project on Sourceforge

2009-02-02 Thread Dave Peterson
On Feb 1, 10:57 pm, David Lyon 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 hadn't updated that

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 wra

Re: Where to put configuration/data files

2009-02-02 Thread Aahz
In article , Jay Bloodworth 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 (a...@pythoncraft.com) <*> http://www.pythoncraft.com/

Re: Combining several text files

2009-02-02 Thread Eric
On Feb 2, 12:17 pm, Chris Rebert wrote: > On Mon, Feb 2, 2009 at 9:48 AM, 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

Re: What is wrong in my list comprehension?

2009-02-02 Thread rdmurray
Quoth Stephen Hansen : > 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 all. The wa

Re: Number of bits/sizeof int

2009-02-02 Thread Mark Wooding
Jon Clements 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 == 0: return 0

Re: Reading text file with wierd file extension?

2009-02-02 Thread Mike Driscoll
On Feb 2, 1:20 pm, Lionel wrote: > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > Hi Folks, Python newbie here. > > > > I'm trying to open (for reading) a text file with the following > > > filenaming convension: > > > > "MyTextFile.slc.rsc" > > > >

Combining several text files

2009-02-02 Thread rdmurray
Quoth 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

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 イェルーン ラウフロック ヴァン デル ウェルヴェン http://www.in

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 worki

Re: Config files editor

2009-02-02 Thread Gabriel Genellina
En Sun, 01 Feb 2009 15:17:34 -0200, Tim Michelsen 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 because it can be edited

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 "on

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 wrote: > On Feb 2, 1:20 pm, Lionel wrote: > > > > > > > On Feb 2, 10:41 am, Mike Driscoll wrote: > > > > On Feb 2, 12:36 pm, Lionel wrote: > > > > > Hi Folks, Python newbie here. > > > > > I'm trying to open (for reading) a text file with the following > > > >

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 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 is available. >

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

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 have

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 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 -- http://mail.python.org/mailman/listinfo/python-l

Re: Source code for csv module

2009-02-02 Thread vsoler
On 2 feb, 21:51, Jon Clements wrote: > On 2 Feb, 20:46, vsoler 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

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 : > 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 things, that is elixir

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 wrote: On Feb 2, 1:20 pm, Lionel wrote: On Feb 2, 10:41 am, Mike Driscoll wrote: On Feb 2, 12:36 pm, Lionel wrote: Hi Folks, Python newbie here. I'm trying to open (for reading) a text file with the following filenaming convension: "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 lon

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 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 it! Indeed. Thanks

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 unpredic

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 cal

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 approach

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, 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 from [Text, Autho

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 text

Re: Number of bits/sizeof int

2009-02-02 Thread John Machin
On Feb 3, 6:50 am, Mark Wooding wrote: > Jon Clements 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

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 = dat

Re: Reading text file with wierd file extension?

2009-02-02 Thread Lionel
On Feb 2, 1:07 pm, "Diez B. Roggisch" wrote: This is written very slowly, so you can read it better: Please post without sarcasm. This is the output from my Python shell: >>> DatafilePath = "C:\\C8Example1.slc" >>> ResourcefilePath = DatafilePath + ".rsc" >>> DatafileFH = open(DatafilePath) >

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

2009-02-02 Thread David Moss
> There is a zip-safe flag that you can specify that tells setuptools that > installing your egg only works if it is unarchived. However, there is also > the pkg_resources-package that allows you to access streams from within a > package, even if it is zipped. You should investigate these two opti

Re: is python Object oriented??

2009-02-02 Thread Russ P.
On Feb 2, 9:02 am, thmpsn@gmail.com wrote: > On Feb 2, 2:55 am, Stephen Hansen 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

Re: is python Object oriented??

2009-02-02 Thread Diez B. Roggisch
> The reason is that I see a level of abstraction that makes it kind of > irrelevant whether something is run as a process, a thread, a time > multiplexed mainloop, on one or more processors, wherever or > whatever - almost like a fractal structure spread across the total > addressable space - and

  1   2   3   >