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

2008-06-18 Thread Derek Martin
Yaieee! On Wed, Jun 18, 2008 at 01:32:28AM -0400, Terry Reedy wrote: > > >Saying a flat "no" alone, without qualifying your statement is > > >generally interpreted as rude in English... > As a very much native English speaker I disagree that 'No' is > necessarily rude. I never said it was n

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
I tested this a bit more. My windows example was incorrect. It should have used CTRL_C_EVENT. But even then, the problem is that the process will also close the console window from which it was called because of the 0. Also this requires that the process actually have a console and is not a GUI app

Re: Regular expressions for accents like ó character in python

2008-06-18 Thread Gabriel Genellina
En Thu, 19 Jun 2008 02:08:38 -0300, Sallu <[EMAIL PROTECTED]> escribió: i want to restrict to user to not enter accents character. si i need to make an Regular expressions for accents like ó character You may enumerate all the allowed characters: py> allowed_re = re.compile(r"^[A-Za-z0-9 ]*

Doc tests in Python

2008-06-18 Thread J-Burns
Hello. Im new to using doctests in python. Could some1 tel me how to use doctests if i have a constructor in my code? -- http://mail.python.org/mailman/listinfo/python-list

good

2008-06-18 Thread raashid bhatt
I like your programming choice becaz python is safe than c or c++ or any other compiled languages as it protects against buffer overflow which causes potentail security problems i am wanted to know how many requests can it handle is it configurable for that. Raashid Bhatt (C) -- http://mail.p

Mr nazim

2008-06-18 Thread raashid bhatt
nazim why you want to use an IDE for gui development as we got a tk wrapper for python use Tkinter import it in python its easy -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.6b1 and 3.0b1

2008-06-18 Thread Terry Reedy
Barry Warsaw wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the first beta releases of Python 2.6 and Python 3.0. As usual, this is the source code release. A Windows installer built from that co

Regular expressions for accents like ó character in python

2008-06-18 Thread Sallu
i want to restrict to user to not enter accents character. si i need to make an Regular expressions for accents like ó character -- http://mail.python.org/mailman/listinfo/python-list

Why doesnt PDB allow me to view the current line?

2008-06-18 Thread hardcoreUFO
I have some code that I am trying to debug (Python 2.5.2 on OSX) using pdb. However, when the code reaches the pdb.set_trace(), it does not allow me to view the current line: > /Users/chris/Research/ISEC/build/bdist.macosx-10.3-i386/egg/pyrl/reinforcement.py(943)__call__() (Pdb) n > /Users/chris/R

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
> I don't know the "standard" way, but perhaps you can get some ideas from > this recent > thread:http://groups.google.com/group/comp.lang.python/browse_thread/thread/... > I had a quick read through that thread. I think i will need some more time to think about what they are saying in there thou

Re: ��python in a nutshell��and��programming python��

2008-06-18 Thread Joel Koltner
"yps" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > as a new learner of python,which book in and > is more suitable? I don't have "Python in a Nutshell," but let me ask... do you have a strong programming background in C++, Java, etc.? If so, you'll probably find "Programming

Re: python/ruby question..

2008-06-18 Thread Mensanator
On Jun 18, 10:33�pm, "bruce" <[EMAIL PROTECTED]> wrote: > hi... > > can someone point me to where/how i would go about calling a ruby app from a > python app, and having the python app being able to get a returned value > from the ruby script. > > something like > > test.py > �a = os.exec(testruby.

Re: Ternary operator alternative in Ptyhon

2008-06-18 Thread kretik
Thank you everyone. I ended up implementing the dict.get() method, which seems "cleaner", but I'll keep the (x if y else z) syntax in mind. I didn't know it existed, I guess it's what I was looking for to begin with. Thanks again! Allen wrote: kretik wrote: I'm sure this is a popular one, but

Re: ¡¶python in a nutshell¡·and¡¶programming p ython¡·

2008-06-18 Thread [EMAIL PROTECTED]
Learning Python may be another good choice. But really, for just starting out, nothing beats online documentation. http://docs.python.org/tut/tut.html http://diveintopython.org/ On Jun 18, 9:02 pm, "yps" <[EMAIL PROTECTED]> wrote: > as a new learner of python,which book in and > is more suitab

python/ruby question..

2008-06-18 Thread bruce
hi... can someone point me to where/how i would go about calling a ruby app from a python app, and having the python app being able to get a returned value from the ruby script. something like test.py a = os.exec(testruby.rb) testruby.py foo = 9 return foo i know this doesn't work... but

RELEASED Python 2.6b1 and 3.0b1

2008-06-18 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the first beta releases of Python 2.6 and Python 3.0. Please note that these are beta releases, and as such are not suitable for production environments.

��python in a nutshell��and��programming python��

2008-06-18 Thread yps
as a new learner of python,which book in and is more suitable? and recommend several books? thanks best regards pase.Y -- http://mail.python.org/mailman/listinfo/python-list

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Gabriel Genellina
En Wed, 18 Jun 2008 21:39:41 -0300, Brendon Costa <[EMAIL PROTECTED]> escribió: I have a small python project i am working on. Basically i always have two threads. A "Read" thread that sits in a loop reading a line at a time from some input (Usually stdin) and then generating events to be proc

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

2008-06-18 Thread [EMAIL PROTECTED]
On Jun 18, 3:15 pm, [EMAIL PROTECTED] wrote: > In Python 2.5 a dict(int:None) needs about 36.2 bytes/element. I am > suggesting to add 2 pointers, to create a linked list, so it probably > becomes (on 32 bit systems) about 44.2 bytes/pair. PyDictEntry is typedef struct { Py_ssize_t me_has

Re: Looking for lots of words in lots of files

2008-06-18 Thread Cong
On Jun 18, 11:01 pm, Kris Kennaway <[EMAIL PROTECTED]> wrote: > Calvin Spealman wrote: > > Upload, wait, and google them. > > > Seriously tho, aside from using a real indexer, I would build a set of > > thewordsI'mlookingfor, and then loop over each file, looping over > > thewordsand doing quick ch

Python email server

2008-06-18 Thread John Sloop
I am starting to build a Python email server. Before assembling the individual pieces I am wondering if there is a prebuilt package anyone would recommend? Thanks in advance for your advice and guidance. John S. -- http://mail.python.org/mailman/listinfo/python-list

How do i : Python Threads + KeyboardInterrupt exception

2008-06-18 Thread Brendon Costa
Hi all, I have a small python project i am working on. Basically i always have two threads. A "Read" thread that sits in a loop reading a line at a time from some input (Usually stdin) and then generating events to be processed and a "Proc" thread that processes incoming events from a queue. There

Personal project announcement

2008-06-18 Thread s0suk3
Hi, Just wanted to announce a little project I've just uploaded. It's a web server written in Python. You can get it at http://code.google.com/p/sws-d/ . Any suggestions or comments are welcome! Regards, Sebastian -- http://mail.python.org/mailman/listinfo/python-list

Re: advanced listcomprehenions?

2008-06-18 Thread Dan Bishop
On Jun 18, 4:42 pm, cirfu <[EMAIL PROTECTED]> wrote: > I am wondering if it is possible to write advanced listcomprehensions. > > For example: > """Write a program that prints the numbers from 1 to 100. But for > multiples of three print "Fizz" instead of the number and for the > multiples of five

Re: Ultimate Prime Sieve -- Sieve Of Zakiya (SoZ)

2008-06-18 Thread George Sakkis
On Jun 13, 1:12 pm, jzakiya <[EMAIL PROTECTED]> wrote: > The paper presents benchmarks with Ruby 1.9.0-1 (YARV). I would love > to see my various prime generators benchmarked with optimized > implementations in other languages. I'm hoping Python gurus will do > better than I, though the methodol

Re: advanced listcomprehenions?

2008-06-18 Thread MRAB
On Jun 18, 10:42 pm, cirfu <[EMAIL PROTECTED]> wrote: > I am wondering if it is possible to write advanced listcomprehensions. > > For example: > """Write a program that prints the numbers from 1 to 100. But for > multiples of three print "Fizz" instead of the number and for the > multiples of five

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

2008-06-18 Thread Matimus
On Jun 16, 1:37 am, Armin Ronacher <[EMAIL PROTECTED]> wrote: > Abstract > > > This PEP proposes an ordered dictionary as a new data structure for > the ``collections`` module, called "odict" in this PEP for short.  The > proposed API incorporates the experiences gained from working with >

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

2008-06-18 Thread MRAB
On Jun 18, 9:43 pm, Lie <[EMAIL PROTECTED]> wrote: > On Jun 19, 2:51 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > > > On Jun 18, 2:22 pm, Lie <[EMAIL PROTECTED]> wrote: > > > > I'm not a native English speaker, although I think my parents would > > > have liked me to be more straightforward when t

Re: python string comparison oddity

2008-06-18 Thread Robert Kern
Faheem Mitha wrote: On Wed, 18 Jun 2008 12:57:44 -0700 (PDT), Lie <[EMAIL PROTECTED]> wrote: On Jun 19, 2:26 am, Faheem Mitha <[EMAIL PROTECTED]> wrote: Hi everybody, I was wondering if anyone can explain this. My understanding is that 'is' checks if the object is the same. However, in that ca

Re: advanced listcomprehenions?

2008-06-18 Thread Gabriel Genellina
En Wed, 18 Jun 2008 18:42:00 -0300, cirfu <[EMAIL PROTECTED]> escribió: I am wondering if it is possible to write advanced listcomprehensions. For example: """Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multipl

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

2008-06-18 Thread bearophileHUGS
dbpoko...: > Why keep the normal dict operations at the same speed? There is a > substantial cost this entails. I presume now we can create a list of possible odict usages, because I think that despite everyone using it for different purposes, we may find some main groups of its usage. I use odict

Re: python string comparison oddity

2008-06-18 Thread Faheem Mitha
On Wed, 18 Jun 2008 12:57:44 -0700 (PDT), Lie <[EMAIL PROTECTED]> wrote: > On Jun 19, 2:26 am, Faheem Mitha <[EMAIL PROTECTED]> wrote: >> Hi everybody, >> >> I was wondering if anyone can explain this. My understanding is that 'is' >> checks if the object is the same. However, in that case, why thi

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

2008-06-18 Thread Gabriel Genellina
En Wed, 18 Jun 2008 08:09:58 -0300, A.T.Hofkamp <[EMAIL PROTECTED]> escribió: On 2008-06-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: picking up 0. On investigation it turned out that the exit value being read is from python.exe process, not from the Python script. Is there any way I can

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

2008-06-18 Thread [EMAIL PROTECTED]
Wow, I was completely wrong about sorted dicts and odicts. On Jun 17, 4:21 am, [EMAIL PROTECTED] wrote: > 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 Why keep the normal dict operations at the same speed? There is

advanced listcomprehenions?

2008-06-18 Thread cirfu
I am wondering if it is possible to write advanced listcomprehensions. For example: """Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and

Re: extra positional arguments before optional parameters syntax

2008-06-18 Thread George Sakkis
On Jun 18, 5:25 pm, MisterWilliam <[EMAIL PROTECTED]> wrote: > I noticed that in PEP 3105, the PEP about turning print to print(), > the syntax for print() is defined as follows: > def print(*args, sep=' ', end='\n', file=None) > > Ignoring the fact that print is a reserved keyword in python, this

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

2008-06-18 Thread Gabriel Genellina
En Wed, 18 Jun 2008 14:26:31 -0300, Ethan Furman <[EMAIL PROTECTED]> escribió: Gabriel Genellina wrote: (This thread is getting way above 1cp...) What is 1cp? cp = centipoise, a unit of dynamic viscosity, measuring the resistence to flow. Honey viscosity is a few hundreds, corn

Re: Function argument conformity check

2008-06-18 Thread crazychimp132
On Jun 18, 5:05 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 18, 3:41 pm, [EMAIL PROTECTED] wrote: > > > > > On Jun 18, 3:13 pm, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > Le Wednesday 18 June 2008 20:19:12 [EMAIL PROTECTED], vous avez écrit : > > > > > Hi. I am looking

extra positional arguments before optional parameters syntax

2008-06-18 Thread MisterWilliam
I noticed that in PEP 3105, the PEP about turning print to print(), the syntax for print() is defined as follows: def print(*args, sep=' ', end='\n', file=None) Ignoring the fact that print is a reserved keyword in python, this is not valid python because extra positional arguments (*args), cannot

Re: NumPy chararray and whitespace

2008-06-18 Thread Robert Kern
OKB (not okblacke) wrote: Hi. I'm trying to use NumPy's chararray class for an array of characters. I notice that when I try to set a chararray element to a space, it actually gets set to an empty string. I found some pages online indicating that the chararray strips trailing whitespace

Re: Function argument conformity check

2008-06-18 Thread George Sakkis
On Jun 18, 3:41 pm, [EMAIL PROTECTED] wrote: > On Jun 18, 3:13 pm, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > > > > > 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 t

NumPy chararray and whitespace

2008-06-18 Thread OKB (not okblacke)
Hi. I'm trying to use NumPy's chararray class for an array of characters. I notice that when I try to set a chararray element to a space, it actually gets set to an empty string. I found some pages online indicating that the chararray strips trailing whitespace from its values.

Re: Who is using python-ldap with Python 1.5.x and 2.0-2.2?

2008-06-18 Thread Jeffrey Froman
Michael Ströder wrote: > Please tell me > which Python version you're using We do have one venerable machine here at work using python2.2 with python-ldap2.0.0pre04. As you can see, we haven't bothered to update either in quite a while ;-) > and why it'd be important for you to > have python-ld

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

2008-06-18 Thread Matimus
On Jun 18, 10:54 am, Matimus <[EMAIL PROTECTED]> wrote: > 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 su

Re: Ternary operator alternative in Ptyhon

2008-06-18 Thread Jeffrey Froman
jeremie fouche wrote: > You can also use : > self.SomeField = params.has_key("mykey") and params["mykey"] or None Have caution with this solution: it may not provide the desired result in the case where params["mykey"] is a false value, such as 0, or [] Jeffrey -- http://mail.python.org/mailman

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

2008-06-18 Thread Lie
On Jun 19, 2:51 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jun 18, 2:22 pm, Lie <[EMAIL PROTECTED]> wrote: > > > > > I'm not a native English speaker, although I think my parents would > > have liked me to be more straightforward when talking, cause I tend to > > say things like "possibly", "

Re: Function argument conformity check

2008-06-18 Thread Matthew Woodcraft
In article <[EMAIL PROTECTED]>, > The problem is that using these attributes, I would essentially have > to re-write the logic python uses when calling a function with a > given set of arguments. I was hoping there is a way to get at that > logic without rewriting it. I don't think there is. I end

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

2008-06-18 Thread Martin v. Löwis
> What's the purpose of having list.insert? It's a convenience function: you don't have to write a loop to move all items to a later index. Any reformulation of it is easy to get wrong, and difficult to read. > One creates tons of unnecessary method calls, the other creates a full > blown list ob

Re: Numeric type conversions

2008-06-18 Thread Hrvoje Niksic
John Dann <[EMAIL PROTECTED]> writes: > I suppose there must be some logic in including the start position > but excluding the end position, though it does escape me for now. I > can understand making a range inclusive or exclusive but not a > mixture of the two. Suppose it's just something you ha

Re: python string comparison oddity

2008-06-18 Thread Lie
On Jun 19, 2:26 am, Faheem Mitha <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I was wondering if anyone can explain this. My understanding is that 'is' > checks if the object is the same. However, in that case, why this > inconsistency for short strings? I would expect a 'False' for all three > c

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

2008-06-18 Thread Paul McGuire
On Jun 18, 2:22 pm, Lie <[EMAIL PROTECTED]> wrote: > > I'm not a native English speaker, although I think my parents would > have liked me to be more straightforward when talking, cause I tend to > say things like "possibly", "maybe", "probably", and other ambiguous > expressions to the extent that

Re: Function argument conformity check

2008-06-18 Thread dlists . cad
On Jun 18, 3:13 pm, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > 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

Re: Calling pcre with ctypes

2008-06-18 Thread Thomas Heller
moreati schrieb: > Recently I discovered the re module doesn't support POSIX character > classes: > > Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import re r = re

python string comparison oddity

2008-06-18 Thread Faheem Mitha
Hi everybody, I was wondering if anyone can explain this. My understanding is that 'is' checks if the object is the same. However, in that case, why this inconsistency for short strings? I would expect a 'False' for all three comparisons. This is reproducible across two different machines, so

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

2008-06-18 Thread Lie
On Jun 18, 12:32 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > >> Saying a flat "no" alone, without qualifying your statement is > >> generally interpreted as rude in English...  It's kind of like how you > >> talk to children when they're too young to understand the explanation. > >> Yucky. > > > I

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

2008-06-18 Thread Lie
On Jun 18, 7:26 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 17 Jun 2008 09:09:41 -0300, Derek Martin <[EMAIL PROTECTED]>   > escribió: > > > 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)'

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

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: 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: 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, 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 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: 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

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

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

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

SPAM

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

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'

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

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

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

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

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

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

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

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

  1   2   >