Re: Doc tests in Python

2008-06-19 Thread Gabriel Genellina
En Thu, 19 Jun 2008 02:46:15 -0300, J-Burns <[EMAIL PROTECTED]> escribió: Hello. Im new to using doctests in python. Could some1 tel me how to use doctests if i have a constructor in my code? Just construct the desired objects inside the doctest. See the difflib module for a couple example

Re: why can i still able to reproduce the SimpleHTTPServer bug whichis said fixed 3 years ago?

2008-06-19 Thread Irmen de Jong
Terry Reedy wrote: "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] En Fri, 13 Jun 2008 04:02:48 -0300, Leo Jay <[EMAIL PROTECTED]> escribió: http://bugs.python.org/issue1097597 in my python 2.5.2, i still find these code in SimpleHTTPServer.py, is that delibe

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 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: Why doesnt PDB allow me to view the current line?

2008-06-19 Thread Diez B. Roggisch
hardcoreUFO schrieb: 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__() (

Re: please critique my thread code

2008-06-19 Thread Roger Heathcote
MRAB wrote: On Jun 15, 2:29 pm, [EMAIL PROTECTED] wrote: I wrote a Python program (103 lines, below) to download developer data from SourceForge for research about social networks. Please critique the code and let me know how to improve it. An example use of the program: prompt> python downlo

SPAM

2008-06-19 Thread Aspersieman
SPAM -- http://mail.python.org/mailman/listinfo/python-list

BootCampArama Early Bird Registration Reminder

2008-06-19 Thread Chris Calloway
Just a reminder, we're at the two week warning on early bird registration for PyCamp: http://trizpug.org/boot-camp/2008/ Registration is now open for: PyCamp: Python Boot Camp, August 4 - 8 Plone Boot Camp: Customizing Plone, July 28 - August 1 Advanced Plone Boot Camp: Plone 3 Techniques, A

Re: moyea flv to video converter keygen

2008-06-19 Thread George
got error on your page-- http://mail.python.org/mailman/listinfo/python-list

SPAM

2008-06-19 Thread Aspersieman
SPAM -- http://mail.python.org/mailman/listinfo/python-list

python socket programming

2008-06-19 Thread srinivasan srinivas
HI, I want to know the different kind of exceptions may occur in client-server  socket communication and the way to handle those scenarios. 1. What does the server do when a socket error occurs at any point: accepting a connection, sending data to a client, receiving data from a client, waiting f

[SMTPLIB] how to send a "Multiline" mail with smtplib?

2008-06-19 Thread Evan
Hello - I'm new with Python, I try to do a mail problem, the code likes below: + import smtplib import mimetypes from email.Encoders import encode_base64 from email.MIMEAudio import MIMEAudio from email.MIMEBase import MIMEBase from ema

Re: Function argument conformity check

2008-06-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a é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. import inspect help(inspect.getargspec) -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for lots of words in lots of files

2008-06-19 Thread Bruno Desthuilliers
brad a écrit : 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 o

Re: Annoying message when interrupting python scripts

2008-06-19 Thread geoffbache
As nobody decried the idea of this being a bug, it now is :) http://bugs.python.org/issue3137 /Geoff -- http://mail.python.org/mailman/listinfo/python-list

Re: please critique my thread code

2008-06-19 Thread Pau Freixes
> > MRAB wrote: > > Erm, shurely the bottleneck will be bandwidth not processor/memory?* If it > isn't then - yes, you run the risk of actually DOSing their servers! > > Your mac will run thousands of threads comfortably but your router may not > handle the thousands of TCP/IP connections you thr

Re: Combining music or video files?

2008-06-19 Thread Roger Heathcote
John Salerno wrote: "Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Sun, 15 Jun 2008 22:53:19 -0400, John Salerno <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: Even the simplest format -> WAV, which is normally uncompressed audio samples, is

Re: [Python-3000] RELEASED Python 2.6b1 and 3.0b1

2008-06-19 Thread Paul Moore
On 19/06/2008, Barry Warsaw <[EMAIL PROTECTED]> 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. Any ETA for Windows builds? The web pages s

Re: how to send a "Multiline" mail with smtplib?

2008-06-19 Thread Justin Ezequiel
perhaps change html body=MIMEText('hello,\r\n ok',_subtype='html',_charset='windows-1255') to plain body=MIMEText('hello,\r\n ok',_subtype='plain',_charset='windows-1255') -- http://mail.python.org/mailman/listinfo/python-list

Re: Combining music or video files?

2008-06-19 Thread Paul Boddie
On 16 Jun, 04:53, John Salerno <[EMAIL PROTECTED]> wrote: > Before I try this and destroy my computer :) I just wanted to see if > this would even work at all. Is it possible to read a binary file such > as an mp3 or an avi, put its contents into a new file, then read another > such file and append

Simple wxPython SetLabel question

2008-06-19 Thread dp_pearce
Hi All, Apologies if this should be seriously obvious. But I am quite new to Python and it is not quite so obvious yet. I have a GUI which will eventually load and display database information. I want the user to be able to browse for a database and then load it. My problem relates to how I set t

Re: Simple wxPython SetLabel question

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 11:48:54 dp_pearce, vous avez écrit : > Hi All, > > Apologies if this should be seriously obvious. But I am quite new to > Python and it is not quite so obvious yet. > > I have a GUI which will eventually load and display database > information. I want the user to be able t

Python-3.0b1 build fails on Linux : _gestalt

2008-06-19 Thread Helmut Jarausch
Hi, trying to build Python-3.0b1 on my Gentoo Linux box fails with Failed to find the necessary bits to build these modules: _gestalt Looking at setup.py it seems that module '_gestalt' is only needed on Darwin but my build on Linux fails nevertheless. Thanks for any hints, Helmut Jarausch L

Re: python/ruby question..

2008-06-19 Thread Matt Nordhoff
Mensanator wrote: > 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 >> >> tes

Re: how to send a "Multiline" mail with smtplib?

2008-06-19 Thread Lie
On Jun 19, 4:02 pm, Justin Ezequiel <[EMAIL PROTECTED]> wrote: > perhaps change html > > body=MIMEText('hello,\r\n > ok',_subtype='html',_charset='windows-1255') > > to plain > > body=MIMEText('hello,\r\n > ok',_subtype='plain',_charset='windows-1255') If that was the case, and you needed a line b

Re: python string comparison oddity

2008-06-19 Thread Lie
On Jun 19, 5:13 am, Faheem Mitha <[EMAIL PROTECTED]> 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'

Re: [SPAM] ¡¶python in a nutshell¡·and¡ ¶programming python¡·

2008-06-19 Thread Tommy Nordgren
On 19 jun 2008, at 04.02, yps wrote: 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 programming Python is quite good for experienced programmer

Re: Simple wxPython SetLabel question

2008-06-19 Thread dp_pearce
Thank you very much Cédric. I thought it would be something very straight forward. -- http://mail.python.org/mailman/listinfo/python-list

Pyparsing performance boost using Python 2.6b1

2008-06-19 Thread Paul McGuire
I just ran my pyparsing unit tests with the latest Python 2.6b1 (labeled internally as Python 2.6a3 - ???), and the current 1.5.0 version of pyparsing runs with no warnings or regressions. I was pleasantly surprised by the improved performance. The most complex parser I have is the Verilog parser

Re: python string comparison oddity

2008-06-19 Thread Duncan Booth
Faheem Mitha <[EMAIL PROTECTED]> wrote: >>> In [1]: a = '--' >>> >>> In [2]: a is '--' >>> Out[2]: False >>> >>> In [4]: a = '-' >>> >>> In [5]: a is '-' >>> Out[5]: True >>> >>> In [6]: a = 'foo' >>> >>> In [7]: a is 'foo' >>> Out[7]: True >> >> Yes, this happens because of small objects caching.

py2exe & application add-ons

2008-06-19 Thread Alex Gusarov
Hello, I've met a problem - I want my program working without Python installation but I have some add-on mechanism (add-ons represented by separate .py files, and application auto-recognize such files on start). So, if I will using py2exe for main program and separate .py files for add-ons, will I

Re: python string comparison oddity

2008-06-19 Thread Hrvoje Niksic
Faheem Mitha <[EMAIL PROTECTED]> writes: > Yes, but why is '-' and 'foo' cached, and not '--'? Do you know what > the basis of the choice is? Caches such as intern dictionary/set and one-character cache are specific to the implementation (and also to its version version, etc.). In this case '-'

Re: py2exe & application add-ons

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 13:00:32 Alex Gusarov, vous avez écrit : > Hello, I've met a problem - I want my program working without Python > installation but I have some add-on mechanism (add-ons represented by > separate .py files, and application auto-recognize such files on > start). > > So, if I

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

2008-06-19 Thread Armin Ronacher
Small Status update of the changes incorporated in the PEP: - The PEP Title was fixed. Of course it's a dictionary not a directory :-) - A questions and answers section was added that covers some of the questions raised here and on the original thread on python-devel. - Compar

Re: Python-3.0b1 build fails on Linux : _gestalt

2008-06-19 Thread Tommy Nordgren
On 19 jun 2008, at 12.07, Helmut Jarausch wrote: Hi, trying to build Python-3.0b1 on my Gentoo Linux box fails with Failed to find the necessary bits to build these modules: _gestalt Looking at setup.py it seems that module '_gestalt' is only needed on Darwin but my build on Linux fails neve

Extending Python with C: Cannot find MPI library

2008-06-19 Thread Spectrum
I am writing some Python code using the Message Passing Interface (MPI), an API used in parallel computing. There exist a number of Python implementations of MPI, but apparently they all rely on the Numeric Python (numpy) package. I need to run my code on a particular machine made available by my

Re: [Python-3000] RELEASED Python 2.6b1 and 3.0b1

2008-06-19 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Jun 19, 2008, at 4:43 AM, Paul Moore wrote: On 19/06/2008, Barry Warsaw <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the fir

Simple Python class questions

2008-06-19 Thread John Dann
A Python newbie, but some basic understanding of how classes, objects etc work in eg VB.Net. However, I'm struggling a little to translate this knowledge into the Python context. I'm trying to teach myself this aspect of Python by working up a trial project, part of which calls for pulling in data

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread Jeroen Ruigrok van der Werven
-On [20080619 13:53], Spectrum ([EMAIL PROTECTED]) wrote: > ImportError: /big/School/Cluster/Opgave03/ctest.so: undefined >symbol: ompi_mpi_comm_world > [EMAIL PROTECTED] Opgave03]$ > > Can anyone suggest anything? Can I get MPI to work in Python? Sounds like a typical case of

Re: Simple Python class questions

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 13:54:03 John Dann, vous avez écrit : > A Python newbie, but some basic understanding of how classes, objects > etc work in eg VB.Net. However, I'm struggling a little to translate > this knowledge into the Python context. > > Maybe I could provide some outline code as an i

Re: advanced listcomprehenions?

2008-06-19 Thread Mark Wooding
Gabriel Genellina <[EMAIL PROTECTED]> wrote: > [(not x%3 and not x%5 and "FizzBuzz") or (not x%3 and "Fizz") or (not x%5 > and "Buzz") or x for x in xrange(1,101)] Rather unpleasant. Note that a number is zero mod both 3 and 5 if and only if it's zero mod 15. But we can do better. A simple

Re: Simple Python class questions

2008-06-19 Thread Lie
On Jun 19, 6:54 pm, John Dann <[EMAIL PROTECTED]> wrote: > A Python newbie, but some basic understanding of how classes, objects > etc work in eg VB.Net. However, I'm struggling a little to translate > this knowledge into the Python context. > > I'm trying to teach myself this aspect of Python by w

Re: Simple Python class questions

2008-06-19 Thread Ulrich Eckhardt
John Dann wrote: > Let's say I define the class in a module called comms.py. The class > isn't really going to inherit from any other class (except presumably > in the most primitive base-class sense, which is presumably automatic > and implicit in using the class keyword). Let's call the class > s

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

2008-06-19 Thread bearophileHUGS
dbpoko...: > Which should be 12 bytes on a 32-bit machine. I thought the space for > growth factor for dicts was about 12% but it is really 100%. (Please ignore the trailing ".2" in my number in my last post, such precision is silly). My memory value comes from experiments, I have created a little

Re: advanced listcomprehenions?

2008-06-19 Thread Duncan Booth
Mark Wooding <[EMAIL PROTECTED]> wrote: > This is still inelegant, though. We can glue the results mod 3 and 5 > together using the Chinese Remainder Theorem and working mod 15 > instead. For example, > > [['Fizz', 'FizzBuzz', False, None, 'Buzz'][(pow(i, 4, 15) + 1)%7] or >str(i) for i i

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

2008-06-19 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > My memory value comes from experiments, I have created a little > program like this: > > from memory import memory > > def main(N): > m1 = memory() > print m1 > > d = {} > for i in xrange(N): > d[i] = None > > m2 = memory() > print m2

Re: Multiprecision arithmetic library question.

2008-06-19 Thread duncan smith
Michael Press wrote: 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 kn

python script for tortoise cvs

2008-06-19 Thread sandeep
hi we are using tortoise cvs and putty. i want to write a python script to whom i can provide a tag and module.now what this script will do is look for this specific tag and checks for whether its a individual tag or its inside a branch.if its inside a branch then find out what is the branch tag a

Re: Simple Python class questions

2008-06-19 Thread John Dann
Many thanks for the speedy replies. On Thu, 19 Jun 2008 14:14:02 +0200, Cédric Lucantis <[EMAIL PROTECTED]> wrote: >Le Thursday 19 June 2008 13:54:03 John Dann, vous avez écrit : >> Let's say I define the class in a module called comms.py. The class >> isn't really going to inherit from any other

Re: python script for tortoise cvs

2008-06-19 Thread Simon Brunning
On Thu, Jun 19, 2008 at 2:14 PM, sandeep <[EMAIL PROTECTED]> wrote: > hi > > we are using tortoise cvs and putty. i want to write a python script > to whom i can provide a tag and module.now what this script will do is > look for this specific tag and checks for whether its a individual tag > or it

Re: Simple Python class questions

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 15:13:39 John Dann, vous avez écrit : > Many thanks for the speedy replies. > > On Thu, 19 Jun 2008 14:14:02 +0200, Cédric Lucantis <[EMAIL PROTECTED]> > > wrote: > >Le Thursday 19 June 2008 13:54:03 John Dann, vous avez écrit : > >> Let's say I define the class in a module

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread Spectrum
On Jun 19, 2:10 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080619 13:53], Spectrum ([EMAIL PROTECTED]) wrote: > > >  ImportError: /big/School/Cluster/Opgave03/ctest.so: undefined > >symbol: ompi_mpi_comm_world > > [EMAIL PROTECTED

Re: python/ruby question..

2008-06-19 Thread Michael Mabin
The commands module might help you out as well. import commands as c output = c.getoutput('testruby.rb') On Thu, Jun 19, 2008 at 5:14 AM, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Jun 18, 10:33�pm, "bruce" <[EMAIL PROTECTED]> wrote: > >> hi... > >> > >> can someone poi

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

2008-06-19 Thread bearophileHUGS
Duncan Booth: > What do you get if you change the output to exclude the integers from > the memory calculation so you are only looking at the dictionary > elements themselves? e.g. The results: 318512 (kbytes) 712124 (kbytes) 20.1529344 (bytes) Bye, bearophile -- http://mail.python.org/mailman/l

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-19 Thread MRAB
On Jun 19, 7:54 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Wed, 18 Jun 2008 21:33:42 -0700 (PDT), Brendon Costa > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > Unfortunately that is the problem. It is blocking in a IO system call > > and i want to force it to exi

Simple Python implementation of bag/multiset

2008-06-19 Thread MRAB
While another thread is talking about an ordered dict, I thought I'd try a simple implementation of a bag/multiset in Python. Comments/ suggestions welcome, etc. class bag(object): def __add__(self, other): result = self.copy() for item, count in other.iteritems():

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread Jeroen Ruigrok van der Werven
-On [20080619 16:21], Spectrum ([EMAIL PROTECTED]) wrote: > libmpi.so.0 => /usr/lib/openmpi/1.2.4-gcc/libmpi.so.0 >(0x0042f000) > libopen-rte.so.0 => /usr/lib/openmpi/1.2.4-gcc/libopen- >rte.so.0 (0x003d4000) > libopen-pal.so.0 => /usr/lib/o

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread Spectrum
On Jun 19, 4:39 pm, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080619 16:21], Spectrum ([EMAIL PROTECTED]) wrote: > > >          libmpi.so.0 => /usr/lib/openmpi/1.2.4-gcc/libmpi.so.0 > >(0x0042f000) > >          libopen-rte.s

Convert string to array of floats

2008-06-19 Thread Jonno
Hi, I'm very new to programming and python. I need to convert a string like this: ' 0.906366 2.276152 0.01336980.773141 0.002836 -107.335197 0.01146286.846290\n' to an array of floats. Any pointers to the simplest way of doing this? Thanks. -- "If a

Re: Simple Python class questions

2008-06-19 Thread Lie
On Jun 19, 7:21 pm, Ulrich Eckhardt <[EMAIL PROTECTED]> wrote: > John Dann wrote: > > Let's say I define the class in a module called comms.py. The class > > isn't really going to inherit from any other class (except presumably > > in the most primitive base-class sense, which is presumably automat

Installing Python 3.0 no probs running 2.5 at the same time?

2008-06-19 Thread cirfu
Can I install 3.0 without breaking 2.5? Meaning does it overwrite some bindings or something or it just installs 3.0 in a different folder as a completely separate program? -- http://mail.python.org/mailman/listinfo/python-list

Re: advanced listcomprehenions?

2008-06-19 Thread Mark Wooding
Duncan Booth <[EMAIL PROTECTED]> wrote: > [['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i in > xrange(1, 101)] Cute! ;-) -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Python class questions

2008-06-19 Thread Ulrich Eckhardt
Lie wrote: > I think it's not that hard to see that it's just a pseudo code "...in comms.py I have: ..." actually explicitly says that it is actual code from a file. *shrug* Uli -- Sator Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -- http://mail.python.org/ma

regex \b behaviour in python

2008-06-19 Thread Walter Cruz
Hi all! Just a simple question about the behaviour of a regex in python. (I discussed this on IRC, and they suggest me to post here). I tried to split the string "walter ' cruz" using \b . In ruby, it returns: irb(main):001:0>"walter ' cruz".split(/\b/) => ["walter", " ' ", "cruz"] and in php

Re: Convert string to array of floats

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 17:12:08 Jonno, vous avez écrit : > Hi, > > I'm very new to programming and python. > > I need to convert a string like this: > ' 0.906366 2.276152 0.01336980.773141 > 0.002836 -107.335197 0.01146286.846290\n' > to an array of floa

Re: Installing Python 3.0 no probs running 2.5 at the same time?

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 17:32:10 cirfu, vous avez écrit : > Can I install 3.0 without breaking 2.5? Meaning does it overwrite some > bindings or something or it just installs 3.0 in a different folder as > a completely separate program? It's OK for any version having different major/minor version

Pydev 1.3.18 Released

2008-06-19 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.18 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: Convert string to array of floats

2008-06-19 Thread Jonno
Brilliant! Thanks. On Thu, Jun 19, 2008 at 10:00 AM, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > Le Thursday 19 June 2008 17:12:08 Jonno, vous avez écrit : > > Hi, > > > > I'm very new to programming and python. > > > > I need to convert a string like this: > > ' 0.906366 2.276

Getting Python to run Python Scripts in cygwin

2008-06-19 Thread Calvin Cheng
Hi guys, This may be a cygwin issue but I was hoping to get some answers here as well if someone has fixed this problem before. Basically, I am able to run "python .py" python files in command prompt. Unfortunately, I can't seem to get it to work in cygwin. I always get an error that says: pyth

Re: dict order

2008-06-19 Thread Aahz
In article <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> wrote: > >Whoops > >for keys, values in dict_one.items(): > if keys in dict_two: >if values == dict_two[keys]: Except that "keys" implies a plural (meaning more than one thing); in a for loop, each iteration will have only one key. -- Aahz

Re: Getting Python to run Python Scripts in cygwin

2008-06-19 Thread Cédric Lucantis
Le Thursday 19 June 2008 18:14:03 Calvin Cheng, vous avez écrit : > Hi guys, > > This may be a cygwin issue but I was hoping to get some answers here > as well if someone has fixed this problem before. > > Basically, I am able to run "python .py" python files in > command prompt. Unfortunately, I

Re: py2exe & application add-ons

2008-06-19 Thread Matthew Woodcraft
Alex Gusarov <[EMAIL PROTECTED]> wrote: > Hello, I've met a problem - I want my program working without Python > installation but I have some add-on mechanism (add-ons represented by > separate .py files, and application auto-recognize such files on > start). > So, if I will using py2exe for main

Re: python/ruby question..

2008-06-19 Thread Aahz
In article <[EMAIL PROTECTED]>, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > >You're supposed to use the subprocess module. Really? Sez who? $ python Python 2.3.4 (#1, Feb 2 2005, 12:11:53) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 Type "help", "copyright", "credits" or "license" for

Re: Getting Python to run Python Scripts in cygwin

2008-06-19 Thread kretik
You do have Python installed in Cygwin, right? It's an optional component, IIRC? If it is then it should have set the symlink in /usr/bin to wherever it's installed. Calvin Cheng wrote: Hi guys, This may be a cygwin issue but I was hoping to get some answers here as well if someone has fixe

Re: py2exe & application add-ons

2008-06-19 Thread Mike Driscoll
On Jun 19, 6:00 am, "Alex Gusarov" <[EMAIL PROTECTED]> wrote: > Hello, I've met a problem - I want my program working without Python > installation but I have some add-on mechanism (add-ons represented by > separate .py files, and application auto-recognize such files on > start). > > So, if I will

Re: Simple wxPython SetLabel question

2008-06-19 Thread Mike Driscoll
On Jun 19, 5:25 am, dp_pearce <[EMAIL PROTECTED]> wrote: > Thank you very much Cédric. I thought it would be something very > straight forward. Just an FYI. There's also a wxPython specific mailing list that I highly recommend. You can learn a lot just reading other people issues and how they get

Re: Getting Python to run Python Scripts in cygwin

2008-06-19 Thread Jason Tishler
Calvin, On Fri, Jun 20, 2008 at 12:14:03AM +0800, Calvin Cheng wrote: > This may be a cygwin issue but I was hoping to get some answers here > as well if someone has fixed this problem before. > > Basically, I am able to run "python .py" python files in > command prompt. Unfortunately, I can't s

Re: python/ruby question..

2008-06-19 Thread Giampaolo Rodola'
On 19 Giu, 18:49, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Matt Nordhoff  <[EMAIL PROTECTED]> wrote: > > > > >You're supposed to use the subprocess module. > > Really?  Sez who? > > $ python > Python 2.3.4 (#1, Feb  2 2005, 12:11:53) > [GCC 3.4.2 20041017 (Red Hat 3.4.2-6

Checking for network connectivity

2008-06-19 Thread felciano
Hi -- Is there a clean pythonic way to check for network connectivity? I have a script that needs to run periodically on a laptop to create a local cache of some network files. I would like it to fail gracefully when disconnected, as well as issue a warning if it hasn't been able to connect for X

Re: python/ruby question..

2008-06-19 Thread Mike Driscoll
On Jun 19, 11:49 am, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Matt Nordhoff  <[EMAIL PROTECTED]> wrote: > > > > >You're supposed to use the subprocess module. > > Really?  Sez who? > > $ python > Python 2.3.4 (#1, Feb  2 2005, 12:11:53) > [GCC 3.4.2 20041017 (Red Hat 3.4.

Python Package Construction

2008-06-19 Thread Tim Cook
Hi All, I would like feedback on the proper/best 'Pythonic' approach. This is a rather subjective question. Where is the trade-off between package name lengths and faithfulness to the specifications? [Discussion follows] I am implementing a set of specifications for healthcare IT for Python pro

Re: Checking for network connectivity

2008-06-19 Thread Jefferson Kirkland
>From the socket module, you could use the s.connect(address) function. It returns a 0 on success or the value of errno on failure. Regards, Jeff On Thu, Jun 19, 2008 at 2:36 PM, felciano <[EMAIL PROTECTED]> wrote: > Hi -- > > Is there a clean pythonic way to check for network connectivity? I

Re: Python-3.0b1 build fails on Linux : _gestalt

2008-06-19 Thread Martin v. Löwis
> Failed to find the necessary bits to build these modules: > _gestalt > > Looking at setup.py it seems that module '_gestalt' > is only needed on Darwin but my build on Linux fails > nevertheless. Why do you think the build fails (i.e. what specific error message makes you believe it failed)? R

Re: regex \b behaviour in python

2008-06-19 Thread André Malo
* Walter Cruz wrote: > irb(main):001:0>"walter ' cruz".split(/\b/) > => ["walter", " ' ", "cruz"] > > and in php: > > Array > ( > [0] => > [1] => walter > [2] => ' > [3] => cruz > [4] => > ) > > > But in python the behaviour of \b is differente from ruby or php. My python

[xlwt] Changing Cell Background Color

2008-06-19 Thread Chanman
I've posted this on the python-excel group, but perhaps people here know what to do. How does one change the cell background color using the xlwt module? I've looked at several tutorials but none show how to change the background color. I've tried the following: badBG = xlwt.Pattern() badBG.SOLI

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread Jeroen Ruigrok van der Werven
-On [20080619 17:11], Spectrum ([EMAIL PROTECTED]) wrote: > ImportError: dynamic module does not define init function Might be it's looking, but not finding, something like crti.S or the likes, the C runtime files that specify stuff like _init and _fini. -- Jeroen Ruigrok van de

Re: Installing Python 3.0 no probs running 2.5 at the same time?

2008-06-19 Thread Martin v. Löwis
> Can I install 3.0 without breaking 2.5? Meaning does it overwrite some > bindings or something or it just installs 3.0 in a different folder as > a completely separate program? You can install both simultaneously, however, by default, .py will get associated with the last installation. If you do

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread André Malo
* Jeroen Ruigrok van der Werven wrote: > -On [20080619 17:11], Spectrum ([EMAIL PROTECTED]) wrote: >> ImportError: dynamic module does not define init function > > Might be it's looking, but not finding, something like crti.S or the > likes, the C runtime files that speci

Simple Class/Variable passing question

2008-06-19 Thread monkeyboy
Hello, I'm new to python, and PythonCard. In the code below, I'm trying to create a member variable (self.currValue) of the class, then just pass it to a simple function (MainOutputRoutine) to increment it. I thought Python "passed by reference" all variables, but the member variable doesn't seem

Re: python/ruby question..

2008-06-19 Thread Mensanator
On Jun 19, 5:14 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > You're supposed to use the subprocess module. Yeah, I know, but I couldn't get it to work the last time I tried it. > > In this case, something like: > > import subprocess > factor_program = ['factor!', '-d200'] >

Noob: finding my way around the docs...

2008-06-19 Thread kj
I'm a Python noob, and haven't yet figured out my way around the Python documentation. For example, suppose I learn about some great module foo.bar.baz, and when I run the python interpreter and type "import foo.bar.baz", lo and behold, it is already installed on our system, which means that (k

Re: Noob: finding my way around the docs...

2008-06-19 Thread Benjamin Kaplan
On Thu, Jun 19, 2008 at 5:06 PM, kj <[EMAIL PROTECTED]> wrote: > > > > I'm a Python noob, and haven't yet figured out my way around the > Python documentation. > > For example, suppose I learn about some great module foo.bar.baz, > and when I run the python interpreter and type "import foo.bar.baz

Docutils rst2html.py gives Unknown Directive type "toctree"

2008-06-19 Thread Calvin Cheng
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1) Unknown Directive type "toctree" (2) (ERROR/3) Unknown interpreted text role "ref". Any idea how I can fix this?

Why no output from xml.dom.ext.PrettyPrint?

2008-06-19 Thread kj
OK, the following should work but doesn't, and I can't figure out why: >>> from xml.marshal.generic import dumps >>> dumps( ( 1, 2.0, 'foo', [3,4,5] ) ) '12.0foo345' >>> from xml.dom.ext import PrettyPrint >>> PrettyPrint( dumps( ( 1, 2.0, 'foo', [3,4,5] ) ) ) >>> import sys >>> PrettyPrint( du

AW: [Zope3-Users] Python Package Construction

2008-06-19 Thread Roger Ineichen
Hi Tim > Betreff: [Zope3-Users] Python Package Construction > > Hi All, > > I would like feedback on the proper/best 'Pythonic' approach. > > This is a rather subjective question. Where is the trade-off > between package name lengths and faithfulness to the specifications? > > [Discussion fol

Re: [Python-Dev] C API for gc.enable() and gc.disable()

2008-06-19 Thread Pau Freixes
Sorry for my ignorance, gc it's garbage collector ? On Thu, Jun 19, 2008 at 11:23 PM, Alexandre Vassalotti < [EMAIL PROTECTED]> wrote: > On Sun, Jun 1, 2008 at 12:28 AM, Adam Olsen <[EMAIL PROTECTED]> wrote: > > On Sat, May 31, 2008 at 10:11 PM, Alexandre Vassalotti > > <[EMAIL PROTECTED]> wrote:

Re: Extending Python with C: Cannot find MPI library

2008-06-19 Thread John Machin
On Jun 20, 5:56 am, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED] nomine.org> wrote: > -On [20080619 17:11], Spectrum ([EMAIL PROTECTED]) wrote: > > > ImportError: dynamic module does not define init function > > Might be it's looking, but not finding, something li

Re: Multiprecision arithmetic library question.

2008-06-19 Thread casevh
> No, I do not know that. Define desperate. > Does Python support the extended Euclidean algorithm > and other number theory functions? No. > How fast does Python multiply? Python uses the Karatsuba algorithm which O(n^1.585). Division is still O(n^2). > Not that the latter is particularly impo

Re: python script for tortoise cvs

2008-06-19 Thread Gabriel Genellina
En Thu, 19 Jun 2008 10:26:09 -0300, Simon Brunning <[EMAIL PROTECTED]> escribió: > On Thu, Jun 19, 2008 at 2:14 PM, sandeep <[EMAIL PROTECTED]> wrote: >> hi >> >> we are using tortoise cvs and putty. i want to write a python script >> to whom i can provide a tag and module.now what this script wil

Re: Noob: finding my way around the docs...

2008-06-19 Thread Matimus
On Jun 19, 2:06 pm, kj <[EMAIL PROTECTED]> wrote: > I'm a Python noob, and haven't yet figured out my way around the > Python documentation. > > For example, suppose I learn about some great module foo.bar.baz, > and when I run the python interpreter and type "import foo.bar.baz", > lo and behold,

Google-like "Did you mean... ?" search algorithm

2008-06-19 Thread miller . paul . w
This is a wee bit OT, but I am looking for algorithms to implement search suggestions, similar to Google's "Did you mean... ?" feature. Can anyone point me to web pages, journal articles, implementations (preferably in Python!), or any other resources in this area? Thanks! -- http://mail.python.or

  1   2   >