Re: Module listing in order.

2007-05-25 Thread Ramashish Baranwal
> > I want a way to get the contents in the order of their declaration, > > i.e. [B, A, D]. Does anyone know a way to get it? > > My suggestion would be to actually parse the text of the module. "Brute > force" is what it's called ;). But doing so with, say, pyparsing > shouldn't be *very* difficul

Re: Module listing in order.

2007-05-25 Thread Peter Otten
Ramashish Baranwal wrote: >> > I want a way to get the contents in the order of their declaration, >> > i.e. [B, A, D]. Does anyone know a way to get it? >> >> My suggestion would be to actually parse the text of the module. "Brute >> force" is what it's called ;). But doing so with, say, pyparsin

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
Paul Boddie wrote: > On 25 May, 00:03, Ron Adam <[EMAIL PROTECTED]> wrote: >> Is anyone else having problems with the webbrowser module? >> >> Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) >> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 >> Type "help", "copyright", "credits" or "license"

Re: csv.reader length?

2007-05-25 Thread 7stud
On May 25, 12:49 pm, cjl <[EMAIL PROTECTED]> wrote: > P: > > Stupid question: > > reader = csv.reader(open('somefile.csv')) > for row in reader: > do something > > Any way to determine the "length" of the reader (the number of rows) > before iterating through the rows? > > -CJL How about: f =

unhandled exception question

2007-05-25 Thread joshusdog
I'm working on a test application that embeds the Python interpreter. I have the following problem... I've created my own interactive interpreter loop. Essentially, it reads the command from the prompt and calls the following C code: PyObject* pMainModule = PyImport_AddModule("__main__");

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
Ron Adam wrote: > Paul Boddie wrote: >> On 25 May, 00:03, Ron Adam <[EMAIL PROTECTED]> wrote: >>> Is anyone else having problems with the webbrowser module? >>> >>> Python 2.5.1c1 (release25-maint, Apr 12 2007, 21:00:25) >>> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 >>> Type "help", "copyright"

Re: sockets, gethostname() changing

2007-05-25 Thread half . italian
On May 24, 8:04 pm, 7stud <[EMAIL PROTECTED]> wrote: > Hi, > > I'm experimenting with a basic socket program(from a book), and both > the client and server programs are on my computer. In both programs, > I call socket.gethostname(), but I discovered that when I am connected > to the internet, bo

Re: csv.reader length?

2007-05-25 Thread Peter Otten
7stud wrote: > On May 25, 12:49 pm, cjl <[EMAIL PROTECTED]> wrote: >> reader = csv.reader(open('somefile.csv')) >> for row in reader: >> do something >> >> Any way to determine the "length" of the reader (the number of rows) >> before iterating through the rows? No. You have to read the reco

Re: webbrowser module bug?

2007-05-25 Thread Ron Adam
Ron Adam wrote: > Got it. > > It looks like the problem started when I told firefox to make itself > the default browser. That changed the way webbrowser.py figured out the > browser to use. So instead of trying them in order, it asked the gnome > configure tool for it. > > def register

Long double in Python

2007-05-25 Thread Charles Vejnar
Hi, I have a C library using "long double" numbers. I would like to be able to keep this precision in Python (even if it's not portable) : for the moment I have to cast the "long double" numbers to "double" numbers. 1st solution . Is it possible that by re-compiling Python, Python Float object

matplotlib, usetex

2007-05-25 Thread Bill Jackson
Hi, I'm having some trouble plotting with the following matplotlibrc: text.usetex : True I tried clearing the cache files under ~/.matplotlib, but this did not help the problem. I'd post on the matplotlib mailing list, but I have a hard enough time browsing sourceforge's achives (frequen

printing list, is this a bug?

2007-05-25 Thread William Chang
Is the different behavior between __repr__ and __str__ intentional when it comes to printing lists? Basically I want to print out a list with elements of my own class, but when I overwrite __str__, __str__ doesn't get called but if I overwrite __repr__, __repr__ will get called. Is this a bug? F

problem with eval while using PythonCard

2007-05-25 Thread Michal Lipinski
Hi its my first post. I have a problem, I want to user eval() function in a for loop to set labels to staticText so i done something like this: dzien=self.components.Calendar.GetDate().GetDay() for i in range(1,8): act=dzien+i -1 eval( 'self.components.d' + str(i) +

Re: matplotlib, usetex

2007-05-25 Thread Alexander Schmolck
Bill Jackson <[EMAIL PROTECTED]> writes: > > The problem does not exist when text.usetex is False. Ideas? I have no idea whether this will resolve your problem, but you could try updating to 0.90 (BTW what happens if you do axis([0,128,0,128])). cheers, 'as -- http://mail.python.org/mailman/l

Re: problem with eval while using PythonCard

2007-05-25 Thread 7stud
On May 25, 3:33 pm, "Michal Lipinski" <[EMAIL PROTECTED]> wrote: > Hi > > its my first post. I have a problem, I want to user eval() function in > a for loop to set labels to staticText so i done something like this: > > dzien=self.components.Calendar.GetDate().GetDay() >for i in range(1,8):

Re: problem with eval while using PythonCard

2007-05-25 Thread 7stud
Here's a complete example: ### #create object 's': class S(object):pass class X(object):pass class Y(object):pass s = S() s.components = X() s.components.d1 = Y() s.components.d2 = Y() s.components.d3 = Y() ## ## set some initial values: f

Re: Large Amount of Data

2007-05-25 Thread Larry Bates
Jack wrote: > Thanks for the replies! > > Database will be too slow for what I want to do. > > "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> In <[EMAIL PROTECTED]>, Jack wrote: >> >>> I need to process large amount of data. The data structure fits we

Re: problem with eval while using PythonCard

2007-05-25 Thread Michal Lipinski
now it's working just fine. but still I dont know why eval dont work ? and thx for help 25 May 2007 15:05:03 -0700, 7stud <[EMAIL PROTECTED]>: > Here's a complete example: > > ### > #create object 's': > > class S(object):pass > class X(object):pass > class Y(object):pass > > s =

Re: csv.reader length?

2007-05-25 Thread Larry Bates
Peter Otten wrote: > 7stud wrote: > >> On May 25, 12:49 pm, cjl <[EMAIL PROTECTED]> wrote: > >>> reader = csv.reader(open('somefile.csv')) >>> for row in reader: >>> do something >>> >>> Any way to determine the "length" of the reader (the number of rows) >>> before iterating through the rows

Re: Find the closest relative

2007-05-25 Thread MRAB
On May 25, 12:08 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 25 May 2007 05:09:00 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > > > Vehicle > > | > > |--- Two Wheeler > > | | > > | |--- BatteryPowered > > | |--- PetrolPower

Re: Long double in Python

2007-05-25 Thread Robert Kern
Charles Vejnar wrote: > Hi, > > I have a C library using "long double" numbers. I would like to be able to > keep this precision in Python (even if it's not portable) : for the moment I > have to cast the "long double" numbers to "double" numbers. > > 1st solution . Is it possible that by re-co

Re: printing list, is this a bug?

2007-05-25 Thread Robert Kern
William Chang wrote: > Is the different behavior between __repr__ and __str__ intentional > when it comes to printing lists? Basically I want to print out a list > with elements of my own class, but when I overwrite __str__, __str__ > doesn't get called but if I overwrite __repr__, __repr__ will ge

Re: matplotlib, usetex

2007-05-25 Thread Bill Jackson
Alexander Schmolck wrote the following on 05/25/2007 02:33 PM: > (BTW what happens if you do axis([0,128,0,128])). In [1]: import pylab In [2]: pylab.axis([0,128,0,128]) In [3]: pylab.show() --- Traceback (most recent cal

Re: webbrowser module bug?

2007-05-25 Thread Paul Boddie
Ron Adam wrote: > > Reseting the default browser with the gnome default application window > confirmed this. The browser selection can either have the quotes around > the args "%s" paremteter, or not depending on how and what sets it. > > Seems to me it should be quoted unless spaces in path names

Re: csv.reader length?

2007-05-25 Thread John Machin
On May 26, 4:49 am, cjl <[EMAIL PROTECTED]> wrote: > P: > > Stupid question: > > reader = csv.reader(open('somefile.csv')) > for row in reader: > do something > > Any way to determine the "length" of the reader (the number of rows) > before iterating through the rows? > > -CJL Of course not. A

Re: problem with eval while using PythonCard

2007-05-25 Thread 7stud
On May 25, 4:43 pm, "Michal Lipinski" <[EMAIL PROTECTED]> wrote: > now it's working just fine. but still I dont know why eval dont work ? > > and thx for help > > 25 May 2007 15:05:03 -0700, 7stud <[EMAIL PROTECTED]>: > > > > > Here's a complete example: > > > ### > > #create objec

How to get started as a xhtml python mysql freelancer ?

2007-05-25 Thread gert
I made something that i was hoping it could make people happy enough so i could make a living by providing support for commercial use of http://sourceforge.net/projects/dfo/ But in reality i am a lousy sales men and was wondering how you people sell stuff as a developer ? -- http://mail.python.o

Re: How to get started as a xhtml python mysql freelancer ?

2007-05-25 Thread Paul McNett
gert wrote: > I made something that i was hoping it could make people happy enough > so i could make a living by providing support for commercial use of > http://sourceforge.net/projects/dfo/ > > But in reality i am a lousy sales men and was wondering how you people > sell stuff as a developer ?

Re: How to get started as a xhtml python mysql freelancer ?

2007-05-25 Thread [EMAIL PROTECTED]
On May 25, 6:48 pm, gert <[EMAIL PROTECTED]> wrote: > I made something that i was hoping it could make people happy enough > so i could make a living by providing support for commercial use > ofhttp://sourceforge.net/projects/dfo/ > > But in reality i am a lousy sales men and was wondering how you

conditionally creating functions within a class?

2007-05-25 Thread kaens
So, I have a class that has to retrieve some data from either xml or an sql database. This isn't a problem, but I was thinking "hey, it would be cool if I could just not define the functions for say xml if I'm using sql", so I did some fiddling around with the interpreter. First, I try conditiona

Re: printing list, is this a bug?

2007-05-25 Thread William Chang
oh okay. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Module listing in order.

2007-05-25 Thread Wildemar Wildenburger
Peter Otten wrote: > Ramashish Baranwal wrote: > > I want a way to get the contents in the order of their declaration, i.e. [B, A, D]. Does anyone know a way to get it? >>> My suggestion would be to actually parse the text of the module. "Brute >>> force" is what it's cal

Re: How to get started as a xhtml python mysql freelancer ?

2007-05-25 Thread gert
On May 26, 2:09 am, Paul McNett <[EMAIL PROTECTED]> wrote: > gert wrote: > > I made something that i was hoping it could make people happy enough > > so i could make a living by providing support for commercial use of > >http://sourceforge.net/projects/dfo/ > > > But in reality i am a lousy sales m

Re: conditionally creating functions within a class?

2007-05-25 Thread kaens
On 5/25/07, kaens <[EMAIL PROTECTED]> wrote: > > then I try doing this within a function: meant "within a class" here, whoops. -- http://mail.python.org/mailman/listinfo/python-list

Re: Module listing in order.

2007-05-25 Thread Steve Holden
Wildemar Wildenburger wrote: > Peter Otten wrote: >> Ramashish Baranwal wrote: >> >> > I want a way to get the contents in the order of their declaration, > i.e. [B, A, D]. Does anyone know a way to get it? > My suggestion would be to actually parse the text of the modu

Re: Large Amount of Data

2007-05-25 Thread kaens
On 5/25/07, Jack <[EMAIL PROTECTED]> wrote: > I need to process large amount of data. The data structure fits well > in a dictionary but the amount is large - close to or more than the size > of physical memory. I wonder what will happen if I try to load the data > into a dictionary. Will Python us

Re: conditionally creating functions within a class?

2007-05-25 Thread Steve Holden
kaens wrote: > So, I have a class that has to retrieve some data from either xml or > an sql database. > This isn't a problem, but I was thinking "hey, it would be cool if I > could just not define the functions for say xml if I'm using sql", so > I did some fiddling around with the interpreter. >

Re: Long double in Python

2007-05-25 Thread [EMAIL PROTECTED]
On May 25, 2:40?pm, Charles Vejnar <[EMAIL PROTECTED]> wrote: > Hi, > > I have a C library using "long double" numbers. I would like to be able to > keep this precision in Python (even if it's not portable) : for the moment I > have to cast the "long double" numbers to "double" numbers. > > 1st sol

Re: Large Amount of Data

2007-05-25 Thread Vyacheslav Maslov
Larry Bates wrote: > Jack wrote: >> Thanks for the replies! >> >> Database will be too slow for what I want to do. >> >> "Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >>> In <[EMAIL PROTECTED]>, Jack wrote: >>> I need to process large amount of data

NLTK: Natural language processing in Python

2007-05-25 Thread Steven Bird
NLTK — the Natural Language Toolkit — is a suite of open source Python modules, data sets and tutorials supporting research and development in natural language processing. It comes with 50k lines of code, 300Mb of datasets, and a 360 page book which teaches both Python and Natural Language Process

Removing NS in ElementTree

2007-05-25 Thread Sebastian Bassi
I would like to remove the namespace information from my elements and have just the tag without this information. This "{http://uniprot.org/uniprot}"; is preapended into all my output. I understand that the solution is related with "_namespace_map" but I don't know much more. >>> for x in eleroot

Re: NLTK: Natural language processing in Python

2007-05-25 Thread tool69
NLTK seems very interesting, and the tutorial are very well done. Thanks for it ! Kib² -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing NS in ElementTree

2007-05-25 Thread Stefan Behnel
Sebastian Bassi wrote: > I would like to remove the namespace information from my elements and > have just the tag without this information. This > "{http://uniprot.org/uniprot}"; is preapended into all my output. for el in root.getiterator(): if el.tag[0] == '{': el.tag = el.tag

Re: csv.reader length?

2007-05-25 Thread Peter Otten
Larry Bates wrote: > Did you try: > > import crystal_ball > > num_lines=crystal_ball(reader) Yes. The answer was a little more comprehensive than I had asked for. >>> print num_lines 42 Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Newsgroups and mailing lists (was Re: Slightly OT: Why all thespam?)

2007-05-25 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: >I *did* try to explain all this a week or two ago. Did I not make myself >clear? Aah ! This makes a couple of assumptions, none of which are necessarily based on fact, namely: 1) That the people involved read what you wrote. 2) That they understood i

<    1   2