Re: Ternary operator alternative in Ptyhon

2008-06-18 Thread Allen
kretik wrote: I'm sure this is a popular one, but after Googling for a while I couldn't figure out how to pull this off. Let's say I have this initializer on a class: def __init__(self, **params): I'd like to short-circuit the assignment of class field values passed in this dictionary to

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread Gabriel Genellina
En Tue, 17 Jun 2008 14:32:44 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Note that most of the time you want to use the sendall() method, because >> send() doesn't guarantee that all the data was actually

Conflict between msvcrt and Tkinter?

2008-06-18 Thread Dick Moores
Win XP, Python 2.5.1 I'm having trouble using msvcrt.getch() in a program that also uses a graphics module which itself imports Tkinter. Is this to be expected? Thanks, Dick Moores -- http://mail.python.org/mailman/listinfo/python-list

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread Gabriel Genellina
En Tue, 17 Jun 2008 14:32:44 -0300, John Salerno <[EMAIL PROTECTED]> escribió: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Note that most of the time you want to use the sendall() method, because >> send() doesn't guarantee that all the data was actually

Re: Python GC does not work as it should be

2008-06-18 Thread Tim Roberts
"Jaimy Azle" <[EMAIL PROTECTED]> wrote: > >Jean-Paul Calderone wrote: > >> A system exception? What's that? C doesn't have exceptions. > >How could I determine it? I dont know GCC implementation, and others, but C >on MSVC does have it. My application were not written in C, an exception >raised

Re: One more socket programming question

2008-06-18 Thread Tim Roberts
John Salerno <[EMAIL PROTECTED]> wrote: > >I'm now experimenting with the SocketServer class. Originally I >subclassed the StreamRequestHandler to make my own custom handler, but a >result of this seems to be that the client socket closes after it has >been used, instead of staying open. Right.

Re: Save turtle state?

2008-06-18 Thread Peter Otten
Allen wrote: > I'm using the turtle module in Python. Is there a way to save the turle > state at any moment for recursive algorithms to easily return the turtle > to an earlier point for another branch/etc? Just copying the turtle seems to work: import turtle from copy import copy def rec(t, n

Re: How do I create user-defined warnings?

2008-06-18 Thread Andrii V. Mishkovskyi
2008/6/18 Clay Hobbs <[EMAIL PROTECTED]>: > I already know how to make user-defined exceptions, like this one: > >class MyException(Exception): >pass > > But for a module I'm making, I would like to make a warning (so it just > prints the warning to stderr and doesn't crash the

Re: Annoying message when interrupting python scripts

2008-06-18 Thread geoffbache
Ben is correct in his interpretation of what I'm trying to say. The code "should surely be changed" so that it lets a KeyboardInterrupt exception through. Geoff -- http://mail.python.org/mailman/listinfo/python-list

Re: Name lookup inside class definition

2008-06-18 Thread Bruno Desthuilliers
WaterWalk a écrit : Hello. Consider the following two examples: class Test1(object): att1 = 1 def func(self): print Test1.att1// ok or print type(self).att1 class Test2(object): att1 = 1 att2 = Test2.att1 // NameError: Name Test2 is not defined It seem

Database design questions

2008-06-18 Thread David
Hi list. I have a few database-related questions. These aren't Python-specific questions, but some of my apps which use (or will use) these tables are in Python :-) Let me know if I should ask this on a different list. Question 1: Storing app defaults. If you have a table like this: table1 - i

Re: Does '!=' equivelent to 'is not'

2008-06-18 Thread Gabriel Genellina
En Tue, 17 Jun 2008 23:04:16 -0300, Asun Friere <[EMAIL PROTECTED]> escribió: > On Jun 17, 5:33 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: >> En Tue, 17 Jun 2008 02:25:42 -0300, Lie <[EMAIL PROTECTED]> escribió: > >> >> > Basically 'a is b' and 'not(a is b)' is similar to 'id(a) == id(b)

Google Module?

2008-06-18 Thread JulianMontez
Just started learning Python and wanted to make a program that would retrieve files that were indexed by Google. These files can be filtered by their extensions, nothing too difficult. :) I wanted to know if there was a module that would allow me to access the API easily within Python. I don't thi

Re: Name lookup inside class definition

2008-06-18 Thread WaterWalk
Ah, I see. Thank you all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Database design questions

2008-06-18 Thread David
> I have a few database-related questions. These aren't Python-specific > questions, but some of my apps which use (or will use) these tables > are in Python :-) Let me know if I should ask this on a different > list. Hi list. I've thought about this some more, and it is off-topic for the python

reading from an a gzip file

2008-06-18 Thread Nader
Hello, I have a gzip file and I try to read from this file withe the next statements: gunziped_file = gzip.GzipFile('gzip-file') input_file = open(gunziped_file,'r') But I get the nezt error message: Traceback (most recent call last): File "read_sfloc_files.py", line 131, in ? input_fil

Embedding processing module in c (winxp sp2)

2008-06-18 Thread mani
Hello every one Did anybody tried to embed pyprocessing (http:// pyprocessing.berlios.de/) in a c app? im using python 2.4 and pyprocessing 0.52 under winxp sp2. but it doesnt seem to work. I added a print statement in Process.start() method after '_current_process._children.add(self)' command in

reading from a gzip file

2008-06-18 Thread Nader
Hello, I have a gzip file and I try to read from this file withe the next statements: gunziped_file = gzip.GzipFile('gzip-file') input_file = open(gunziped_file,'r') But I get the nezt error message: Traceback (most recent call last): File "read_sfloc_files.py", line 131, in ? input_fil

Re: Temporal Databases (Database design questions)

2008-06-18 Thread M.-A. Lemburg
On 2008-06-18 09:41, David wrote: Question 3: Temporal databases http://en.wikipedia.org/wiki/Temporal_database I haven't used them before, but I like the idea of never deleting/updating records so you have a complete history (a bit like source code version control). How well do temporal datab

Re: reading from an a gzip file

2008-06-18 Thread Matt Nordhoff
Nader wrote: > Hello, > > I have a gzip file and I try to read from this file withe the next > statements: > > gunziped_file = gzip.GzipFile('gzip-file') > input_file = open(gunziped_file,'r') > > But I get the nezt error message: > > Traceback (most recent call last): > File "read_sfloc_fi

Re: pyinotify issue

2008-06-18 Thread AndreH
On Jun 17, 12:11 pm, AndreH <[EMAIL PROTECTED]> wrote: > On Jun 13, 3:39 pm, AndreH <[EMAIL PROTECTED]> wrote: > > > > > Good day, > > > I just installed pyinotify on my gentoo box. > > > When I test the library through "pyinotify.pv -v /tmp" under root, > > everything works great, but when I try t

dict order

2008-06-18 Thread Robert Bossy
Hi, I wish to know how two dict objects are compared. By browsing the archives I gathered that the number of items are first compared, but if the two dict objects have the same number of items, then the comparison algorithm was not mentioned. Note that I'm not trying to rely on this order. I

Getting Python exit code when calling Python script from Java program

2008-06-18 Thread Quill_Patricia
I have a Python script which is used to load data into a database. Up to now this script has been run by customers from the Windows command prompt using "python edg_loader.pyc". Any error messages generated are written to a log file. A project team working in the same company as me here would like

CSV variable seems to reset

2008-06-18 Thread marc wyburn
Hi, I'm using the CSV module to parse a file using whitelistCSV_file = open("\\pathtoCSV\\whitelist.csv",'rb') whitelistCSV = csv.reader(whitelistCSV_file) for uname, dname, nname in whitelistCSV: print uname, dname, nname The first time I run the for loop the contents of the file is di

Re: CSV variable seems to reset

2008-06-18 Thread Tim Golden
marc wyburn wrote: Hi, I'm using the CSV module to parse a file using whitelistCSV_file = open("\\pathtoCSV\\whitelist.csv",'rb') whitelistCSV = csv.reader(whitelistCSV_file) for uname, dname, nname in whitelistCSV: print uname, dname, nname The first time I run the for loop the conte

Re: Getting Python exit code when calling Python script from Java program

2008-06-18 Thread Lie
On Jun 18, 3:54 pm, [EMAIL PROTECTED] wrote: > I have a Python script which is used to load data into a database. Up to > now this script has been run by customers from the Windows command > prompt using "python edg_loader.pyc". Any error messages generated are > written to a log file.  A project t

Re: dict order

2008-06-18 Thread cokofreedom
On Jun 18, 11:22 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi, > > I wish to know how two dict objects are compared. By browsing the > archives I gathered that the number of items are first compared, but if > the two dict objects have the same number of items, then the comparison > algorithm wa

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-18 Thread bearophileHUGS
Martin v. L.: > However, I think the PEP (author) is misguided in assuming that > making byindex() a method of odict, you get better performance than > directly doing .items()[n] - which, as you say, you won't. In Python 2.5 .items()[n] creates a whole list, and then takes one item of such list. A

Re: dict order

2008-06-18 Thread cokofreedom
On Jun 18, 12:32 pm, [EMAIL PROTECTED] wrote: > On Jun 18, 11:22 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I wish to know how two dict objects are compared. By browsing the > > archives I gathered that the number of items are first compared, but if > > the two dict objects have th

Re: Multiprecision arithmetic library question.

2008-06-18 Thread Mark Wooding
Michael Press <[EMAIL PROTECTED]> wrote: > I already compiled and installed the GNU multiprecision library > on Mac OS X, and link to it in C programs. > How do I link to the library from Python? You know that Python already supports multiprecision integer arithmetic, right? If you desperately

Re: dict order

2008-06-18 Thread Lie
On Jun 18, 4:22 pm, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi, > > I wish to know how two dict objects are compared. By browsing the > archives I gathered that the number of items are first compared, but if > the two dict objects have the same number of items, then the comparison > algorithm was

Re: dict order

2008-06-18 Thread A.T.Hofkamp
On 2008-06-18, Robert Bossy <[EMAIL PROTECTED]> wrote: > Hi, > > I wish to know how two dict objects are compared. By browsing the > archives I gathered that the number of items are first compared, but if > the two dict objects have the same number of items, then the comparison > algorithm was n

Re: Getting Python exit code when calling Python script from Java program

2008-06-18 Thread A.T.Hofkamp
On 2008-06-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a Python script which is used to load data into a database. Up to > now this script has been run by customers from the Windows command > prompt using "python edg_loader.pyc". Any error messages generated are > written to a log fil

Re: dict order

2008-06-18 Thread Lie
On Jun 18, 5:35 pm, [EMAIL PROTECTED] wrote: > On Jun 18, 12:32 pm, [EMAIL PROTECTED] wrote: > > > > > On Jun 18, 11:22 am, Robert Bossy <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I wish to know how two dict objects are compared. By browsing the > > > archives I gathered that the number of item

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread MRAB
On Jun 18, 7:52 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jun 2008 09:39:07 -0400, "John Salerno" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > > while True: > > >    data = raw_input('> ') > > >    if not data: > > >        break > > >    client_s

Re: PEP 372 -- Adding an ordered directory to collections

2008-06-18 Thread Armin Ronacher
Martin v. Löwis v.loewis.de> writes: > > > I think I have lost the thread here, sorry. So I explain again what I > > mean. I think for this data structure it's important to keep all the > > normal dict operations at the same speed. If you use a C > > implementation vaguely similar to my pure pyt

Re: reading from a gzip file

2008-06-18 Thread MRAB
On Jun 18, 10:10 am, Nader <[EMAIL PROTECTED]> wrote: > Hello, > > I have a gzip file and I try to read from this file withe the next > statements: > >  gunziped_file = gzip.GzipFile('gzip-file') >  input_file = open(gunziped_file,'r') > > But I get the nezt error message: > > Traceback (most recen

Interpreting string containing \u000a

2008-06-18 Thread Francis Girard
Hi, I have an ISO-8859-1 file containing things like "Hello\u000d\u000aWorld", i.e. the character '\', followed by the character 'u' and then '0', etc. What is the easiest way to automatically translate these codes into unicode characters ? Thank you Francis Girard -- http://mail.python.org/mai

Re: dict order

2008-06-18 Thread Robert Bossy
Lie wrote: Whoops, I think I misunderstood the question. If what you're asking whether two dictionary is equal (equality comparison, rather than sorting comparison). You could do something like this: Testing for equality and finding differences are trivial tasks indeed. It is the sort order

Re: dict order

2008-06-18 Thread Peter Otten
Robert Bossy wrote: > I wish to know how two dict objects are compared. By browsing the > archives I gathered that the number of items are first compared, but if > the two dict objects have the same number of items, then the comparison > algorithm was not mentioned. If I interpret the comments in

Re: Interpreting string containing \u000a

2008-06-18 Thread Duncan Booth
"Francis Girard" <[EMAIL PROTECTED]> wrote: > I have an ISO-8859-1 file containing things like > "Hello\u000d\u000aWorld", i.e. the character '\', followed by the > character 'u' and then '0', etc. > > What is the easiest way to automatically translate these codes into > unicode characters ? >

Re: Interpreting string containing \u000a

2008-06-18 Thread Peter Otten
Francis Girard wrote: > I have an ISO-8859-1 file containing things like > "Hello\u000d\u000aWorld", i.e. the character '\', followed by the > character 'u' and then '0', etc. > > What is the easiest way to automatically translate these codes into > unicode characters ? If the file really contai

Re: Interpreting string containing \u000a

2008-06-18 Thread Francis Girard
Thank you very much ! I didn't know about this 'unicode-escape'. That's great! Francis 2008/6/18 Duncan Booth <[EMAIL PROTECTED]>: > "Francis Girard" <[EMAIL PROTECTED]> wrote: > > > I have an ISO-8859-1 file containing things like > > "Hello\u000d\u000aWorld", i.e. the character '\', followed b

Re: Temporal Databases (Database design questions)

2008-06-18 Thread David
On Wed, Jun 18, 2008 at 11:16 AM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2008-06-18 09:41, David wrote: >> >> Question 3: Temporal databases >> >> http://en.wikipedia.org/wiki/Temporal_database >> >> I haven't used them before, but I like the idea of never >> deleting/updating records so you

Re: dict order

2008-06-18 Thread Robert Bossy
Peter Otten wrote: Robert Bossy wrote: I wish to know how two dict objects are compared. By browsing the archives I gathered that the number of items are first compared, but if the two dict objects have the same number of items, then the comparison algorithm was not mentioned. If I in

question relateding to parsing dbf files.

2008-06-18 Thread Krishnakant Mane
hello all. I need to parse some dbf files through python. the reason being that I have to migrate some old data from dbf files to postgresql. all that I need to know is if some one has got a working code sample using dbfpy. I found this module suitable for my work but can't figure out how to use it

Re: dict order

2008-06-18 Thread A.T.Hofkamp
On 2008-06-18, Robert Bossy <[EMAIL PROTECTED]> wrote: > Lie wrote: >>> Whoops, I think I misunderstood the question. If what you're asking >>> whether two dictionary is equal (equality comparison, rather than >>> sorting comparison). You could do something like this: >>> > Testing for equalit

Re: marshal.dumps quadratic growth and marshal.dump not allowing file-like objects

2008-06-18 Thread Aaron Watters
> > Anywaymarshalshould not be used by user code to serialize objects. > It's only meant for Python byte code. Please use the pickle/cPickle > module instead. > > Christian Just for yucks let me point out that marshal has no real security concerns of interest to the non-paranoid, whereas pickle i

Re: Google Module?

2008-06-18 Thread Mike Driscoll
On Jun 18, 2:54 am, JulianMontez <[EMAIL PROTECTED]> wrote: > Just started learning Python and wanted to make a program that would > retrieve files that were indexed by Google. These files can be > filtered by their extensions, nothing too difficult. :) > > I wanted to know if there was a module th

Re: question relateding to parsing dbf files.

2008-06-18 Thread Daniel Mahoney
On Wed, 18 Jun 2008 18:20:20 +0530, Krishnakant Mane wrote: > hello all. > I need to parse some dbf files through python. > the reason being that I have to migrate some old data from dbf files > to postgresql. > all that I need to know is if some one has got a working code sample > using dbfpy. >

ZFS bindings

2008-06-18 Thread Kris Kennaway
Is anyone aware of python bindings for ZFS? I just want to replicate (or at least wrap) the command line functionality for interacting with snapshots etc. Searches have turned up nothing. Kris -- http://mail.python.org/mailman/listinfo/python-list

Re: Buffer size when receiving data through a socket?

2008-06-18 Thread John Salerno
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The first if is checking for lack of interactive input -- and, as > coded, will never break out as ANY response to the > prompt will have a > newline attached. > > Try with raw_input("> ").strip() instead Well, I kn

Re: One more socket programming question

2008-06-18 Thread John Salerno
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Salerno <[EMAIL PROTECTED]> wrote: >> >>I'm now experimenting with the SocketServer class. Originally I >>subclassed the StreamRequestHandler to make my own custom handler, but a >>result of this seems to be that the

Re: Does '!=' equivelent to 'is not' [drifting OT...]

2008-06-18 Thread Paul McGuire
On Jun 17, 7:09 am, Derek Martin <[EMAIL PROTECTED]> wrote: > On Tue, Jun 17, 2008 at 04:33:03AM -0300, Gabriel Genellina wrote: > > > Basically 'a is b' and 'not(a is b)' is similar to 'id(a) == id(b)' > > > and 'not(id(a) == id(b))' > > > No. > > > Saying a flat "no" alone, without qualifying yo

Re: 2d graphics - drawing a vescica piscis in Python

2008-06-18 Thread Terrence Brannon
On Jun 17, 3:45 pm, Terrence Brannon <[EMAIL PROTECTED]> wrote: > Hello, I have written a program to draw a vescica piscis en.wikipedia.org/wiki/Vesica_piscis> actually, I mis-spelled the term. It should be vesica piscis or vesica pisces. I put a "c" after the "s" -- vescica --- and that is wrong

Looking for lots of words in lots of files

2008-06-18 Thread brad
Just wondering if anyone has ever solved this efficiently... not looking for specific solutions tho... just ideas. I have one thousand words and one thousand files. I need to read the files to see if some of the words are in the files. I can stop reading a file once I find 10 of the words in i

Re: Looking for lots of words in lots of files

2008-06-18 Thread Diez B. Roggisch
brad wrote: > Just wondering if anyone has ever solved this efficiently... not looking > for specific solutions tho... just ideas. > > I have one thousand words and one thousand files. I need to read the > files to see if some of the words are in the files. I can stop reading a > file once I find

Re: Looking for lots of words in lots of files

2008-06-18 Thread Calvin Spealman
Upload, wait, and google them. Seriously tho, aside from using a real indexer, I would build a set of the words I'm looking for, and then loop over each file, looping over the words and doing quick checks for containment in the set. If so, add to a dict of file names to list of words found

Re: Looking for lots of words in lots of files

2008-06-18 Thread Kris Kennaway
Calvin Spealman wrote: Upload, wait, and google them. Seriously tho, aside from using a real indexer, I would build a set of the words I'm looking for, and then loop over each file, looping over the words and doing quick checks for containment in the set. If so, add to a dict of file names to

Re: Hrounding error

2008-06-18 Thread Jerry Hill
On Wed, Jun 18, 2008 at 1:47 AM, <[EMAIL PROTECTED]> wrote: 234 - 23234.2345 > -23000.2344 > > This is not correct by my calculations. Python floating point operations use the underlying C floating point libraries which, in turn, usually rely on the hardware's floating point implemen

Re: dict order

2008-06-18 Thread Kirk Strauser
At 2008-06-18T10:32:48Z, [EMAIL PROTECTED] writes: > # untested 2.5 > for keys in dict_one.items(): > if keys in dict_two: > if dict_one[keys] != dict_two[keys]: > # values are different > else: > # key is not present That fails if there is an item in dict_two that's not in dict

Re: question relateding to parsing dbf files.

2008-06-18 Thread Kirk Strauser
At 2008-06-18T12:50:20Z, "Krishnakant Mane" <[EMAIL PROTECTED]> writes: > hello all. > I need to parse some dbf files through python. > the reason being that I have to migrate some old data from dbf files > to postgresql. > all that I need to know is if some one has got a working code sample > usi

Re: Looking for lots of words in lots of files

2008-06-18 Thread Francis Girard
Hi, Use a suffix tree. First make yourself a suffix tree of your thousand files and the use it. This is a classical problem for that kind of structure. Just search "suffix tree" or "suffix tree python" on google to find a definition and an implementation. (Also Jon Bentley's "Programming Pearls"

Re: urllib (54, 'Connection reset by peer') error

2008-06-18 Thread chrispoliquin
Thanks for the help. The error handling worked to a certain extent but after a while the server does seem to stop responding to my requests. I have a list of about 7,000 links to pages I want to parse the HTML of (it's basically a web crawler) but after a certain number of urlretrieve() or urlope

Re: urllib (54, 'Connection reset by peer') error

2008-06-18 Thread Tim Golden
[EMAIL PROTECTED] wrote: Thanks for the help. The error handling worked to a certain extent but after a while the server does seem to stop responding to my requests. I have a list of about 7,000 links to pages I want to parse the HTML of (it's basically a web crawler) but after a certain number

Re: dict order

2008-06-18 Thread cokofreedom
On Jun 18, 4:45 pm, Kirk Strauser <[EMAIL PROTECTED]> wrote: > At 2008-06-18T10:32:48Z, [EMAIL PROTECTED] writes: > > # untested 2.5 > > for keys in dict_one.items(): > > if keys in dict_two: > > if dict_one[keys] != dict_two[keys]: > > # values are different > > else: > > # key i

Re: go to specific line in text file

2008-06-18 Thread Larry Bates
Patrick David wrote: Hello NG, I am searching for a way to jump to a specific line in a text file, let's say to line no. 9000. Is there any method like file.seek() which leads me to a given line instead of a given byte? Hope for help Patrick Others have given the general answer (No), but if y

Re: Looking for lots of words in lots of files

2008-06-18 Thread Robert Bossy
brad wrote: Just wondering if anyone has ever solved this efficiently... not looking for specific solutions tho... just ideas. I have one thousand words and one thousand files. I need to read the files to see if some of the words are in the files. I can stop reading a file once I find 10 of t

Re: Looking for lots of words in lots of files

2008-06-18 Thread Robert Bossy
I forgot to mention another way: put one thousand monkeys to work on it. ;) RB Robert Bossy wrote: brad wrote: Just wondering if anyone has ever solved this efficiently... not looking for specific solutions tho... just ideas. I have one thousand words and one thousand files. I need to read t

Re: print problem

2008-06-18 Thread Peter Pearson
On Tue, 17 Jun 2008 04:46:38 -0300, Gabriel Genellina wrote: > En Tue, 17 Jun 2008 04:10:41 -0300, Rich Healey escribió: >> Gabriel Genellina wrote: >>> En Tue, 17 Jun 2008 03:15:11 -0300, pirata <[EMAIL PROTECTED]> escribió: >>> I was trying to print a dot on console every second to indicates

Re: go to specific line in text file

2008-06-18 Thread Jonathan Gardner
On Jun 17, 3:10 am, Patrick David <[EMAIL PROTECTED]> wrote: > > I am searching for a way to jump to a specific line in a text file, let's > say to line no. 9000. > Is there any method like file.seek() which leads me to a given line instead > of a given byte? > As others have said, no. But if you'

Re: Looking for lots of words in lots of files

2008-06-18 Thread Martin P. Hellwig
Kris Kennaway wrote: If you can't use an indexer, and performance matters, evaluate using grep and a shell script. Seriously. grep is a couple of orders of magnitude faster at pattern matching strings in files (and especially regexps) than python is. Even if you are invoking grep multipl

Re: 32 bit or 64 bit?

2008-06-18 Thread Peter Pearson
On Tue, 17 Jun 2008 08:13:40 -0400, Phil Hobbs wrote: > [EMAIL PROTECTED] wrote: [snip] >> I have a physical system set up in which a body is supposed to >> accelerate and to get very close to lightspeed, while never really >> attaining it. After approx. 680 seconds, Python gets stuck and tells >>

Re: Does '!=' equivelent to 'is not' [drifting a little more]

2008-06-18 Thread Ethan Furman
Gabriel Genellina wrote: (This thread is getting way above 1cp...) What is 1cp? -- Ethan -- http://mail.python.org/mailman/listinfo/python-list

The best FREE porn on the Net

2008-06-18 Thread sexxxyy
http://rozrywka.yeba.pl/show.php?id=2737 -- http://mail.python.org/mailman/listinfo/python-list

The best FREE porn on the Net

2008-06-18 Thread sexxxyy
http://rozrywka.yeba.pl/show.php?id=2737 -- http://mail.python.org/mailman/listinfo/python-list

Re: Hrounding error

2008-06-18 Thread cooperq
On Jun 18, 8:02 am, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 1:47 AM,  <[EMAIL PROTECTED]> wrote: > 234 - 23234.2345 > > -23000.2344 > > > This is not correct by my calculations. > > Python floating point operations use the underlying C floating point > librari

Re: Getting Python exit code when calling Python script from Java program

2008-06-18 Thread Matthew Woodcraft
In article <[EMAIL PROTECTED]>, > I tried using the sys.exit() method in my script and passed non -zero > values. However the value wasn't picked up the by Java > Process.exitValue() method - it kept picking up 0. On investigation > it turned out that the exit value being read is from python.exe >

Re: Hrounding error

2008-06-18 Thread casevh
> > So it seems then that python might not be very good for doing > precision floating point work, because there is a good chance its > floating points will be off by a (very small) amount?  Or is there a > way to get around this and be guaranteed an accurate answer?- Hide quoted > text - > It's

Re: Looking for lots of words in lots of files

2008-06-18 Thread Jeff McNeil
On Jun 18, 10:29 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > brad wrote: > > Just wondering if anyone has ever solved this efficiently... not looking > > for specific solutions tho... just ideas. > > > I have one thousand words and one thousand files. I need to read the > > files to see if

ANN: eGenix mx Base Distribution 3.1.0

2008-06-18 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mx Base Distribution Version 3.1.0 Open Source Python extensions providing important and useful services for Python programmers

Importing module PIL vs beautifulSoup.

2008-06-18 Thread bsagert
I downloaded BeautifulSoup.py from http://www.crummy.com/software/BeautifulSoup/ and being a n00bie, I just placed it in my Windows c:\python25\lib\ file. When I type "import beautifulsoup" from the interactive prompt it works like a charm. This seemed too easy in retrospect. Then I downloaded the

www.nikeadishoes.com

2008-06-18 Thread [EMAIL PROTECTED]
because our company open no long time,and we have some pro in deals with oredr please make you new order to us ,i think we will have a good beginning !! Our website: www.nikeadishoes.com Choose your favorite products please trust us ,have a good beginning Email:[EMAIL PROTECTED] MSN:[EMAIL PR

Re: Importing module PIL vs beautifulSoup.

2008-06-18 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > I downloaded BeautifulSoup.py from > http://www.crummy.com/software/BeautifulSoup/ and being a n00bie, I > just placed it in my Windows c:\python25\lib\ file. When I type > "import beautifulsoup" from the interactive prompt it works like a > charm. This seemed too easy i

How to split a string containing nested commas-separated substrings

2008-06-18 Thread Robert Dodier
Hello, I'd like to split a string by commas, but only at the "top level" so to speak. An element can be a comma-less substring, or a quoted string, or a substring which looks like a function call. If some element contains commas, I don't want to split it. Examples: 'foo, bar, baz' => 'foo' 'bar'

SPAM

2008-06-18 Thread Dantheman
SPAM -- http://mail.python.org/mailman/listinfo/python-list

Never mind folks, n00bie here forgot Python is case sensitive!

2008-06-18 Thread bsagert
On Jun 18, 10:18 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I downloaded BeautifulSoup.py from > >http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I > > just placed it in my Windows c:\python25\lib\ file. When I type > > "import beautifulsoup" from th

Re: Importing module PIL vs beautifulSoup.

2008-06-18 Thread bsagert
On Jun 18, 10:18 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I downloaded BeautifulSoup.py from > >http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I > > just placed it in my Windows c:\python25\lib\ file. When I type > > "import beautifulsoup" from th

Re: Ternary operator alternative in Ptyhon

2008-06-18 Thread jeremie fouche
kretik a écrit : I'm sure this is a popular one, but after Googling for a while I couldn't figure out how to pull this off. I'd like to short-circuit the assignment of class field values passed in this dictionary to something like this: self.SomeField = \ params.has_key("mykey") ? pa

Re: How to split a string containing nested commas-separated substrings

2008-06-18 Thread Matimus
On Jun 18, 10:19 am, Robert Dodier <[EMAIL PROTECTED]> wrote: > Hello, > > I'd like to split a string by commas, but only at the "top level" so > to speak. An element can be a comma-less substring, or a > quoted string, or a substring which looks like a function call. > If some element contains com

Re: Multiprecision arithmetic library question.

2008-06-18 Thread Michael Press
In article <[EMAIL PROTECTED]>, Mark Wooding <[EMAIL PROTECTED]> wrote: > Michael Press <[EMAIL PROTECTED]> wrote: > > > I already compiled and installed the GNU multiprecision library > > on Mac OS X, and link to it in C programs. > > How do I link to the library from Python? > > You know th

Re: How to split a string containing nested commas-separated substrings

2008-06-18 Thread Cédric Lucantis
Hi, Le Wednesday 18 June 2008 19:19:57 Robert Dodier, vous avez écrit : > Hello, > > I'd like to split a string by commas, but only at the "top level" so > to speak. An element can be a comma-less substring, or a > quoted string, or a substring which looks like a function call. > If some element c

Function argument conformity check

2008-06-18 Thread dlists . cad
Hi. I am looking for a way to check if some given set of (*args, **kwds) conforms to the argument specification of a given function, without calling that function. For example, given the function foo: def foo(a, b, c): pass and some tuple args and some dict kwds, is there a way to tell if i _coul

Re: Numeric type conversions

2008-06-18 Thread Lie
On Jun 18, 12:23 am, John Dann <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jun 2008 08:58:11 -0700 (PDT), MRAB > > <[EMAIL PROTECTED]> wrote: > >[snip] > >Please note that in slicing the start position is included and the end > >position is excluded, so that should be ByteStream[12:14]. > > Yes, I just

Re: 32 bit or 64 bit?

2008-06-18 Thread [EMAIL PROTECTED]
On Jun 17, 5:04 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > >That was suggested. Problem is, that sometimes the velocities are near > >zero. So this solution, by itself, is not general enough. > > Maybe working in p, and delt

Re: 32 bit or 64 bit?

2008-06-18 Thread [EMAIL PROTECTED]
On Jun 18, 7:12 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jun 2008 08:13:40 -0400, Phil Hobbs wrote: > > [EMAIL PROTECTED] wrote: > [snip] > >> I have a physical system set up in which a body is supposed to > >> accelerate and to get very close to lightspeed, while never really > >>

Re: 32 bit or 64 bit?

2008-06-18 Thread [EMAIL PROTECTED]
On Jun 18, 3:02 am, Phil Hobbs <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > That was suggested. Problem is, that sometimes the velocities are near > > zero. So this solution, by itself, is not general enough. > > Are you sure?  I sort of doubt that you're spending zillions of > itera

Re: 32 bit or 64 bit?

2008-06-18 Thread [EMAIL PROTECTED]
On Jun 18, 10:00 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jun 18, 3:02 am, Phil Hobbs > > <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > That was suggested. Problem is, that sometimes the velocities are near > > > zero. So this solution, by itself, is not general eno

Re: How to split a string containing nested commas-separated substrings

2008-06-18 Thread Paul McGuire
On Jun 18, 12:19 pm, Robert Dodier <[EMAIL PROTECTED]> wrote: > Hello, > > I'd like to split a string by commas, but only at the "top level" so > to speak. An element can be a comma-less substring, or a > quoted string, or a substring which looks like a function call. > If some element contains com

Re: Function argument conformity check

2008-06-18 Thread Cédric Lucantis
Hi, Le Wednesday 18 June 2008 20:19:12 [EMAIL PROTECTED], vous avez écrit : > Hi. I am looking for a way to check if some given set of (*args, > **kwds) conforms to the argument specification of a given function, > without calling that function. > > For example, given the function foo: > def foo(a

  1   2   >