Re: Snackages [Re: is there enough information?]

2008-03-03 Thread Daniel Fetchinson
> >> Speak not of Wendy's -- they moved into town in my college days... > >> The "hot and juicy" was commonly taken to mean: patty dipped in pan > >> drippings, then nuked in microwave... And any CompSci person could > >> figure out that the "256 different ways" meant one had access to a tray > >>

write float to Excel with pyExcelerator write

2008-03-03 Thread Cyril.Liu
I use pyExcelerator to generat Excel files in my project. it works good before I found this bug: run this code: from pyExcelerator import * wb = Workbook() ws = wb.add_sheet("sheet") for i in xrange(1): ws.write(i,0, 10474224.6) wb.save(r'd:\error_float.xls') open d:\error_float.xls with M$

How to subclass ints to prevent comparisons?

2008-03-03 Thread Bronner, Gregory
I'm trying to create a type-safe subclass of int (SpecialInt) such that instances of the class can only be compared with ints, longs, and other subclasses of SpecialInt -- I do not want them to be compared with floats, bools, or strings, which the native int implementation supports. Obviously, I

write float to Excel with pyExcelerator write

2008-03-03 Thread Cyril.Liu
I use pyExcelerator to generat Excel files in my project. it works good before I found this bug: run this code: from pyExcelerator import * wb = Workbook() ws = wb.add_sheet("sheet") for i in xrange(1): ws.write(i,0, 10474224.6) wb.save(r'd:\error_float.xls') open d:\error_float.xls with M$

Trouble using XML Reader

2008-03-03 Thread Mike D
Hello, I'm using XML Reader (xml.sax.xmlreader.XMLReader) to create an rss reader. I can parse the file but am unsure how to extract the elements I require. For example: For each element I want the title and description. I have some stub code; I want to create a list of objects which include a

Regex loop question

2008-03-03 Thread Mike P
Hi Experts, I've written a peice of code that works fine and fits, and passes values into a peice of SPSS code, the problem is that it is not dynamic, and so i though about how i can make it dynamic, (other code may not have upto 10 some may have more) and came up with regex for an idea, but i can

Re: First post from a Python newbiw

2008-03-03 Thread Arnaud Delobelle
Steve Turner wrote: > I finally decided to have a go with Python and am working through the > tutorial. Great! > On my old BBC Computer [...] These were nice machines... > In Python I thought I could do this with: > > >>> a=[0,0,0] > >>> b=[a,a,a] > >>> b > [[0, 0, 0], [0, 0, 0], [0, 0, 0]] >

Re: write float to Excel with pyExcelerator write

2008-03-03 Thread Peter Otten
Cyril.Liu wrote: > I use pyExcelerator to generat Excel files in my project. it works good > before I found this bug: > run this code: > > from pyExcelerator import * > wb = Workbook() > ws = wb.add_sheet("sheet") > for i in xrange(1): > ws.write(i,0, 10474224.6) > wb.save(r'd:\error_float.x

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-03 Thread Paul Boddie
On 2 Mar, 10:02, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 2 Mrz., 06:53, Ben Finney <[EMAIL PROTECTED]> > wrote: > > > One of the stated goals of the migration is that the '2to3' program > > will only migrate Python 2.6 code -> Python 3.0 code. > > Yes, I know. Why? > > "The master said so" isn

Re: Beautiful Code in Python?

2008-03-03 Thread Bruno Desthuilliers
js a écrit : > Hi, > > Have you ever seen Beautiful Python code? > Zope? Django? Python standard lib? or else? > > Please tell me what code you think it's stunning. FormEncode has some very interesting parts IMHO. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-03 Thread M.-A. Lemburg
On 2008-03-02 15:06, Preben Randhol wrote: > Hi > > I'm making a kind of ordered dictionary class. It is not exactly a > dictionary, but it uses a list and dictionary to store the data. > > Something like: > > class dbase(list): > '''Database class keeping track of the order and dat

Re: Can one get "for x in y" to work for non builtin classes?

2008-03-03 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Mar 2008 12:17:39 +0100, M.-A. Lemburg wrote: > It's also possible to implement .__getitem__() and .__len__() > methods and have Python create an iterator on-the-fly. That's > how Python used to work before iterators were added to the > language. A suitable `__getitem__()` is enough.

Re: Regex loop question

2008-03-03 Thread Peter Otten
Mike P wrote: > Hi Experts, > > I've written a peice of code that works fine and fits, and passes > values into a peice of SPSS code, the problem is that it is not > dynamic, and so i though about how i can make it dynamic, (other code > may not have upto 10 some may have more) and came up with r

Delete hidden files on unix

2008-03-03 Thread loial
How can I delete hidden files on unix with python, i.e I want to do equivalent of rm .lock* -- http://mail.python.org/mailman/listinfo/python-list

Python logging: Retrieving the last log record from a handler

2008-03-03 Thread Frank Aune
Hi, I'm using a log hierarchy in my application, and sometimes I find myself wanting to retrieve the latest log message written to the root logger. (Typical usage might be displaying the latest log message at all times in a GUI). The only way I've found how to solve this, is by adding a custom

Re: Delete hidden files on unix

2008-03-03 Thread Peter Otten
loial wrote: > How can I delete hidden files on unix with python, i.e I want to do > equivalent of > > rm .lock* >>> for fn in glob.glob(".lock*"): ... os.remove(fn) ... Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: write float to Excel with pyExcelerator write

2008-03-03 Thread John Machin
On Mar 1, 5:59 pm, Cyril.Liu <[EMAIL PROTECTED]> wrote: > I use pyExcelerator to generat Excel files in my project. it works good > before I found this bug: > run this code: > > from pyExcelerator import * > wb = Workbook() > ws = wb.add_sheet("sheet") > for i in xrange(1): > ws.write(i,0, 104

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-03 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 3, 2008, at 1:48 AM, Martin v. Löwis wrote: >>> But it would be really nice if the configure fix for 2.5 was >>> backported to 2.4.5 since Zope is still on 2.4 and Mac OS X skipped >>> system builds for 2.4 going direct from 2.3 -> 2.5. >> >> >

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-03 Thread dave_mikesell
On Mar 1, 10:53 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 1 Mrz., 19:51, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > > Python 2.6 is not only the next advancement in the Python 2 series, it > > is also a transitionary release, helping developers begin to prepare > > their code for Python 3.0

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-03 Thread dave_mikesell
On Mar 1, 10:53 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 1 Mrz., 19:51, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > > Python 2.6 is not only the next advancement in the Python 2 series, it > > is also a transitionary release, helping developers begin to prepare > > their code for Python 3.0

Re: Delete hidden files on unix

2008-03-03 Thread Philipp Pagel
loial <[EMAIL PROTECTED]> wrote: > How can I delete hidden files on unix with python, i.e I want to do > equivalent of > rm .lock* Here is one way to do it: import os, glob for filename in glob.glob('.lock*'): os.unlink(filename) Alternatively, you could also do this: import os os.system

Cant run application as ./myapp.py

2008-03-03 Thread Robert Rawlins
Hello Guys, I've got an application here which for some reason won't start using the following syntax from the command line: Cd /mydirectory ./MyApplication.py I have to run this as a fully qualified python launch such as: Cd /mydirectory python MyApplication.py This is a litt

Re: is there enough information?

2008-03-03 Thread Jean-Paul Calderone
On Tue, 26 Feb 2008 21:45:24 -0800, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > [snip] > > Threads, in Python, are good for parallel processing of items that >tend to be I/O bound -- that is, stuff that blocks on lots of I/O calls >allowing other threads to execute until they block too. Du

compiling plpython compilation error

2008-03-03 Thread Gerardo Herzig
Hi all. Im having a hard time trying to compile the plpython package. This is the error make gives me: [EMAIL PROTECTED]:/usr/local/src/postgresql-8.2.5/src/pl/plpython> make gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-alias

Re: Cant run application as ./myapp.py

2008-03-03 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Robert, I have to guesses: a) The user as which you are trying to run the script is missing the execute right -> fix by chmod u+x MyApplication.px b) You did not specify the interpreter -> the first line of your script should look something like

Re: Is it possible to return a variable and use it...?

2008-03-03 Thread Alan Isaac
Nathan Pinno wrote: > Is it possible to return a variable and then use it I think you are asking about the ``global`` statement. http://docs.python.org/ref/global.html> > like the following: Presumably not. ;-) Cheers, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-

Re: Cant run application as ./myapp.py

2008-03-03 Thread Gabriel Genellina
En Mon, 03 Mar 2008 10:35:30 -0200, Robert Rawlins <[EMAIL PROTECTED]> escribió: > I've got an application here which for some reason won't start using the > following syntax from the command line: > > > Cd /mydirectory > > ./MyApplication.py > > > I have to run this as a fully qualified python

Re: Delete hidden files on unix

2008-03-03 Thread subeen
On Mar 3, 6:13 pm, Philipp Pagel <[EMAIL PROTECTED]> wrote: > loial <[EMAIL PROTECTED]> wrote: > > How can I delete hidden files on unix with python, i.e I want to do > > equivalent of > > rm .lock* > > Here is one way to do it: > > import os, glob > for filename in glob.glob('.lock*'): > os.u

Re: is there enough information?

2008-03-03 Thread castironpi
On Mar 3, 7:11 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 26 Feb 2008 21:45:24 -0800, Dennis Lee Bieber <[EMAIL PROTECTED]> > wrote: > > > [snip] > > >    Threads, in Python, are good for parallel processing of items that > >tend to be I/O bound -- that is, stuff that blocks on l

Re: Problem with the strip string method

2008-03-03 Thread Harold Fellermann
> Thanks to all respondents, Steve Holden > is right, I expected more than I should > have. Others have explained why all your examples work as they should. >From your exmaples, it seems like you would like strip to remove the leading and trailing characters from EVERY LINE in your string. This ca

Exception or not

2008-03-03 Thread Monica Leko
Suppose you have some HTML forms which you would like to validate. Every field can have different errors. For example, this are the forms: username password etc And you want to validate them with some class. Is this good pattern: class Foo(object): def validateUsername(username): if username

Re: Book Recomendations

2008-03-03 Thread rockingred
The "Python Forum" has a good set of selections in their "General Forum" section: http://python-forum.org/pythonforum/viewtopic.php?f=1&t=12&st=0&sk=t&sd=a&sid=9b04b79b60f9afb56e4237856910d354&start=20 -- http://mail.python.org/mailman/listinfo/python-list

Talking to a usb device (serial terminal)

2008-03-03 Thread blaine
Hey everyone, We have a usb spectrometer device that we have finally got working in linux (we were provided linux only drivers). The device has a Silicon Instruments cp2101 serial-to-usb chip onboard, and we loaded the kernel module cp2101.c after taking the device apart to see what was on the i

Re: Book Recomendations

2008-03-03 Thread apatheticagnostic
On Mar 2, 6:16 am, David Cook <[EMAIL PROTECTED]> wrote: > On 2008-03-02, Jeff Schwab <[EMAIL PROTECTED]> wrote: > > > Python In A Nutshell: > >http://www.oreilly.com/catalog/pythonian2/ > > Another vote for the Nutshell book, which I find a very useful and practical > book. > > I never found the "

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread Mike Kent
> So my question is this - what is the easiest way to interface to this > "serial" device? > http://pyserial.sourceforge.net/ or perhaps http://pyusb.berlios.de/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception or not

2008-03-03 Thread Nils Oliver Kröger
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I don't think it is a good pattern because you are kind of mixing exceptions with return codes which makes the code a lot less readable later on. I personally would strongly opt for return codes in this case as one would intuitively expect a f

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread bockman
On 1 Mar, 20:17, Steve Holden <[EMAIL PROTECTED]> wrote: > Jeremy Nicoll - news posts wrote: > > > > > Jeremy Nicoll - news posts <[EMAIL PROTECTED]> wrote: > > >> If I understand correctly, when I import something under Windows, Python > >> searches the directory that the executing script was load

Re: Exception or not

2008-03-03 Thread Arnaud Delobelle
Monica Leko wrote: > Suppose you have some HTML forms which you would like to validate. > Every field can have different errors. For example, this are the > forms: > > username > password > etc > > And you want to validate them with some class. Is this good pattern: [...] You could have a loo

Re: [SQL] compiling plpython compilation error

2008-03-03 Thread Tom Lane
Gerardo Herzig <[EMAIL PROTECTED]> writes: > Hi all. Im having a hard time trying to compile the plpython package. > This is the error make gives me: > /usr/lib/python2.5/config/libpython2.5.a(abstract.o): relocation > R_X86_64_32 against `a local symbol' can not be used when making a > shared o

Re: Exception or not

2008-03-03 Thread Bruno Desthuilliers
Monica Leko a écrit : > Suppose you have some HTML forms which you would like to validate. > Every field can have different errors. For example, this are the > forms: > > username > password > etc > > And you want to validate them with some class. This is what the FormEncode package is for.

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread bockman
On 3 Mar, 17:12, [EMAIL PROTECTED] wrote: > (unless of course I _did_ miss something and my guess is completely > wrong; I should have done some experiment > before posting, but I'm too lazy for that). > > Ciao > --- > FB- Nascondi testo tra virgolette - > > - Mostra testo tra virgolette - Oo

Re: How about adding rational fraction to Python?

2008-03-03 Thread Paul Rubin
Jeff Schwab <[EMAIL PROTECTED]> writes: > > User defined types in python are fairly heavyweight compared with the > > built-in types, > > Yet they continue to form the basis of almost all non-trivial Python > programs. Anyway, it's a bit soon to be optimizing. :) Large python programs usually ha

SQLObject 0.9.4

2008-03-03 Thread Oleg Broytmann
Hello! I'm pleased to announce the 0.9.4 release of SQLObject. What is SQLObject = SQLObject is an object-relational mapper. Your database tables are described as classes, and rows are instances of those classes. SQLObject is meant to be easy to use and quick to get started wi

urlsafe_b64decoding of xml node text

2008-03-03 Thread kaush
Hi All, I am running Apache with mod_python. A post message to my server contains an xml of the form (some base64 ur-safe-encoded data) I use minidom to parse the xml posted, and now try to decode the data using the following import minidom import base64 decData = base64.urlsafe_b64decode

Re: Decorators and buffer flushing

2008-03-03 Thread Ethan Metsger
Hi, Gabriel. I missed this message initially; I apologize for not responding sooner. On Thu, 28 Feb 2008 18:53:28 -0500, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> I can reproduce the issue in the console. I'm not convinced it's >> actually >> a bug, unless for some reason the interp

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread Bjoern Schliessmann
blaine wrote: > So my question is this - what is the easiest way to interface to > this "serial" device? > > I don't imagine a straight read() and write() command to > /dev/ttyusb0 is the most efficient (if it even works) It doesn't only work, it's the preferred way (if you don't use advanced w

Inheritance issue...

2008-03-03 Thread MooMaster
I'm trying to use inheritance to create a simple binary tree, but it's not going so well... here's what I pull from the documentation for super() "super( type[, object-or-type]) Return the superclass of type. If the second argument is omitted the super object returned is unbound. If the second arg

clocking subprocesses

2008-03-03 Thread barnburnr
Hi, I've seen several threads on this subject, but haven't (yet) run across one that answers my specific questions. This should be really easy for someone, so here goes: I'm running some numerical simulations under Ubuntu, and using Python as my scripting language to automatically manage input a

News from Jython world

2008-03-03 Thread Sébastien Boisgérault
Frank Wierzbicki and Ted Leung have been hired by Sun. Frank is a key Jython developer and is specifically hired to work full time on Jython, a version of the Python interpreter that runs on top of the JVM and provides full access to Java libraries. After a period where the development had slowed,

Re: Inheritance issue...

2008-03-03 Thread Matimus
On Mar 3, 9:37 am, MooMaster <[EMAIL PROTECTED]> wrote: > I'm trying to use inheritance to create a simple binary tree, but it's > not going so well... here's what I pull from the documentation for > super() > "super( type[, object-or-type]) > > Return the superclass of type. If the second argument

Re: Inheritance issue...

2008-03-03 Thread Diez B. Roggisch
MooMaster schrieb: > I'm trying to use inheritance to create a simple binary tree, but it's > not going so well... here's what I pull from the documentation for > super() > "super( type[, object-or-type]) > > Return the superclass of type. If the second argument is omitted the > super object retur

Re: Delete hidden files on unix

2008-03-03 Thread [EMAIL PROTECTED]
On Mar 3, 9:38 am, subeen <[EMAIL PROTECTED]> wrote: > On Mar 3, 6:13 pm, Philipp Pagel <[EMAIL PROTECTED]> > wrote: > > > > > loial <[EMAIL PROTECTED]> wrote: > > > How can I delete hidden files on unix with python, i.e I want to do > > > equivalent of > > > rm .lock* > > > Here is one way to do

Re: clocking subprocesses

2008-03-03 Thread Preston Landers
On Mar 3, 11:57 am, [EMAIL PROTECTED] wrote: > So, long story short, I need to get CPU time of something I call using > subprocess.call().   Run your command through the "time" program. You can parse the output format of "time", or set a custom output format. This mostly applies to Unix-like sy

Re: Beautiful Code in Python?

2008-03-03 Thread Jonathan Gardner
On Mar 2, 8:35 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Mar 2, 5:23 pm, js <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Have you ever seen Beautiful Python code? > > Zope? Django? Python standard lib? or else? > > > Please tell me what code you think it's stunning. > > The doctest module

Polymorphism using constructors

2008-03-03 Thread K Viltersten
I'm writing a class for rational numbers and besides the most obvious constructor def __init__ (self, nomin, denom): i also wish to have two supporting ones def __init__ (self, integ): self.__init__ (integ, 1) def __init__ (self): self.__init__ (0, 1) but for some reason (not know

Re: How about adding rational fraction to Python?

2008-03-03 Thread Arnaud Delobelle
On Mar 3, 4:39 pm, Paul Rubin wrote: [...] > You are right, C is even worse than I remembered. It's good enough to be the language used for the reference implementation of python :-) [...] -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Polymorphism using constructors

2008-03-03 Thread Diez B. Roggisch
K Viltersten schrieb: > I'm writing a class for rational numbers > and besides the most obvious constructor > > def __init__ (self, nomin, denom): > > i also wish to have two supporting ones > > def __init__ (self, integ): >self.__init__ (integ, 1) > def __init__ (self): >self.__init_

Re: Inheritance issue...

2008-03-03 Thread MooMaster
On Mar 3, 11:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > MooMaster schrieb: > > > I'm trying to use inheritance to create a simple binary tree, but it's > > not going so well... here's what I pull from the documentation for > > super() > > "super( type[, object-or-type]) > > > Return the

Re: clocking subprocesses

2008-03-03 Thread barnburnr
On Mar 3, 12:41 pm, Preston Landers <[EMAIL PROTECTED]> wrote: > > Run your command through the "time" program. You can parse the output > format of "time", or set a custom output format. This mostly applies > to Unix-like systems but there is probably an equivalent somewhere on > Windows. > > P

FW: unable to download PyGEP

2008-03-03 Thread Blubaugh, David A.
> __ > From: Blubaugh, David A. > Sent: Monday, March 03, 2008 3:39 PM > To: '[EMAIL PROTECTED]' > Subject: unable to download PyGEP > > Dear Sir, > > I have been having issues installing PyGEP. I have tried the > following: > > at

sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
Notice anything funny about the "random" choices? import sympy import time import random f = [i for i in sympy.primerange(1000,1)] for i in xrange(10): f1 = random.choice(f) print f1, f2 = random.choice(f) print f2, C = f1*f2 ff = None ff = sympy.factorint(C) print ff ## 73

Re: Beautiful Code in Python?

2008-03-03 Thread babycode
> Please tell me what code you think it's stunning. Pexpect is (almost) pseudocode is (almost) poetry to my ears. And there's a lot of narrative in it as well: http://pexpect.svn.sourceforge.net/viewvc/*checkout*/pexpect/trunk/pexpect/pexpect.py?content-type=text%2Fplain -- http://mail.python.or

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > Notice anything funny about the "random" choices? > > import sympy > import time > import random > > f = [i for i in sympy.primerange(1000,1)] > > for i in xrange(10): > f1 = random.choice(f) > print f1, > f2 = random.choice(f) >

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread blaine
On Mar 3, 12:31 pm, Bjoern Schliessmann wrote: > It doesn't only work, it's the preferred way (if you don't use > advanced wrappers like pyserial). For the basics see > > http://www.easysw.com/~mike/serial/serial.html [...] > What is the relationship between read/write, the baud rate, and > effici

Re: Inheritance issue...

2008-03-03 Thread Carl Banks
On Mar 3, 3:14 pm, MooMaster <[EMAIL PROTECTED]> wrote: > On Mar 3, 11:49 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > MooMaster schrieb: > > > > I'm trying to use inheritance to create a simple binary tree, but it's > > > not going so well... here's what I pull from the documentatio

Re: Polymorphism using constructors

2008-03-03 Thread Raymond Hettinger
On Mar 3, 12:21 pm, "K Viltersten" <[EMAIL PROTECTED]> wrote: > I'm writing a class for rational numbers > and besides the most obvious constructor > > def __init__ (self, nomin, denom): > > i also wish to have two supporting ones > > def __init__ (self, integ): > self.__init__ (integ, 1) >

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread Grant Edwards
On 2008-03-03, blaine <[EMAIL PROTECTED]> wrote: > As far as PySerial goes - were trying to stick to built-in > modules since cross compiling to an arm processor is being a > little bit of a pain for us. pyserial is pure python, so I don't see how it's going to be any more painful than something

Re: How about adding rational fraction to Python?

2008-03-03 Thread Lie
On Mar 2, 11:36 pm, Paul Rubin wrote: > Lie <[EMAIL PROTECTED]> writes: > > You hit the right note, but what I meant is the numeric type > > unification would make it _appear_ to consist of a single numeric type > > (yeah, I know it isn't actually, but what appears from o

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread blaine
> pyserial is pure python, so I don't see how it's going to be > any more painful than something you write yourself. If you > want something that's more of a transparent object wrapper > aroudn the Posix serial interface, there's PosixSerial.py (upon > which pyserial's posix support is based): > >

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > Notice anything funny about the "random" choices? > > > import sympy > > import time > > import random > > > f = [i for i in sympy.primerange(1000,1)] > > > for i in

Re: Polymorphism using constructors

2008-03-03 Thread Carl Banks
On Mar 3, 4:17 pm, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > Since Python doesn't support having two methods with the same name, > the usual solution is to provide alternative constructors using > classmethod(): > > @classmethod > def from_decimal(cls, d) > sign, digits, exp = d.as

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> It's just a bug--probably sympy is messing with the internals of the >> random number generator. It would be a simple fix. Instead of >> bing about it, file a bug report. > > I did. > >> Or better yet, submit

Re: Talking to a usb device (serial terminal)

2008-03-03 Thread Grant Edwards
On 2008-03-03, blaine <[EMAIL PROTECTED]> wrote: > I do have a question though. In the termios module, I am attempting > to set the baud rate to 921600, which is what we use with > 'cutecom' (because minicom does not have this as an option) and is > what the supplier recommends. When I try to se

Re: Beautiful Code in Python?

2008-03-03 Thread [EMAIL PROTECTED]
On Mar 2, 1:18 pm, [EMAIL PROTECTED] wrote: > On Mar 2, 12:01 pm, John DeRosa <[EMAIL PROTECTED]> wrote: > > > On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: > > >Hi, > > > >Have you ever seen Beautiful Python code? > > >Zope? Django? Python standard lib? or else? > > > >Please te

Re: First post from a Python newbiw

2008-03-03 Thread Christoph Zwerschke
Arnaud Delobelle schrieb: > It's a FAQ: > http://www.python.org/doc/faq/programming/#how-do-i-create-a-multidimensional-list Somewhere on my todo list I have "read through the whole Python FAQ", but so far never got round doing it. Should probably set it to prio A. -- Christoph -- http://mail.p

Re: [Python-Dev] [ANN] Python 2.3.7 and 2.4.5, release candidate 1

2008-03-03 Thread Martin v. Löwis
> Can you also add a note to the 2.3 and 2.4 web pages? You mean the 2.3.7 and 2.4.5 web pages? Sure. (If you mean some other web pages, please give precise URLs). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > Notice anything funny about the "random" choices? > > > > import sympy > > > import time > > > import random

Re: sympy: what's wrong with this picture?

2008-03-03 Thread apatheticagnostic
I swear, this is one of the most polite-oriented groups I've ever seen. Not that that's a bad thing or anything, it's nice to be nice. (This has been Captain Universal Truth, over and out) -- http://mail.python.org/mailman/listinfo/python-list

Re: clocking subprocesses

2008-03-03 Thread Matt Nordhoff
[EMAIL PROTECTED] wrote: > On Mar 3, 12:41 pm, Preston Landers <[EMAIL PROTECTED]> wrote: >> Run your command through the "time" program. You can parse the output >> format of "time", or set a custom output format. This mostly applies >> to Unix-like systems but there is probably an equivalent s

Re: Altering imported modules

2008-03-03 Thread Tro
On Sunday 02 March 2008, Paul McGuire wrote: > On Mar 2, 3:48 pm, Tro <[EMAIL PROTECTED]> wrote: > > On Sunday 02 March 2008, Terry Reedy wrote: > > > "Tro" <[EMAIL PROTECTED]> wrote in message > > >news:[EMAIL PROTECTED] > > > > > > | Hi, list. > > > | > > > | I've got a simple asyncore-based serv

Re: News from Jython world

2008-03-03 Thread George Sakkis
On Mar 3, 1:40 pm, Sébastien Boisgérault <[EMAIL PROTECTED]> wrote: > Frank Wierzbicki and Ted Leung have been hired by Sun. Frank is a > key Jython developer and is specifically hired to work full time on > Jython, a version of the Python interpreter that runs on top of the > JVM and provides full

os.system with cgi

2008-03-03 Thread G
Hi, I have the following peace of code def getBook(textid, path): url = geturl(textid) if os.path.isfile(path + textid): f = open(path + textid) else: os.system('wget -c ' + url + ' -O ' path + textid) f = open(path + textid) return f The reason I am no

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> It's just a bug--probably sympy is messing with the internals of the > >> random number generator.  It would be a simple fix.  Instead of > >> bing abo

Re: os.system with cgi

2008-03-03 Thread Matt Nordhoff
G wrote: > Hi, > >I have the following peace of code > > def getBook(textid, path): > url = geturl(textid) > if os.path.isfile(path + textid): > f = open(path + textid) > else: > os.system('wget -c ' + url + ' -O ' path + textid) > f = open(path + textid) >

Re: Import, how to change sys.path on Windows, and module naming?

2008-03-03 Thread Gabriel Genellina
En Mon, 03 Mar 2008 14:39:20 -0200, <[EMAIL PROTECTED]> escribió: > On 3 Mar, 17:12, [EMAIL PROTECTED] wrote: > > Oops... I tried removing python25.zip from sys.path, and I can still > import packages from zip files ... Yes, python25.zip is in sys.path by default, not to enable zipimport (which

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: > On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: >> Mensanator wrote: >>> On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: It's just a bug--probably sympy is messing with the internals of the random number generator. It would be a simple fix. Instead

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 4:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > Notice anything funny about the "rand

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Carl Banks
On Mar 3, 7:24 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 4:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Mar 3, 4:47 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > > On Mar 3, 3:40 pm, Mensanator <[EMAIL PRO

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Robert Kern
Mensanator wrote: > On Mar 3, 4:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote: >> 3. You must be terribly naive if you expect a freeware program with a >> version number of 0.5.12 not to have bugs > > No, but I guess I'm naive thinking that when someone posts a link to > such a program that he's re

Re: Altering imported modules

2008-03-03 Thread castironpi
On Mar 3, 5:09 pm, Tro <[EMAIL PROTECTED]> wrote: > On Sunday 02 March 2008, Paul McGuire wrote: > > > > > > > On Mar 2, 3:48 pm, Tro <[EMAIL PROTECTED]> wrote: > > > On Sunday 02 March 2008, Terry Reedy wrote: > > > > "Tro" <[EMAIL PROTECTED]> wrote in message > > > >news:[EMAIL PROTECTED] > > > >

Re: Beautiful Code in Python?

2008-03-03 Thread castironpi
On Mar 3, 4:30 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Mar 2, 1:18 pm, [EMAIL PROTECTED] wrote: > > > On Mar 2, 12:01 pm, John DeRosa <[EMAIL PROTECTED]> wrote: > > > > On Mon, 3 Mar 2008 01:23:32 +0900, js <[EMAIL PROTECTED]> wrote: > > > >Hi, > > > > >Have you ever seen Beautiful

metaclasses

2008-03-03 Thread castironpi
What are metaclasses? -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 6:21 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 4:08 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mensanator wrote: > >>> On Mar 3, 2:49 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > It's just a bug--probably sympy is messing with the internals of t

Re: sympy: what's wrong with this picture?

2008-03-03 Thread Mensanator
On Mar 3, 6:49 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > On Mar 3, 4:53 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> 3. You must be terribly naive if you expect a freeware program with a > >> version number of 0.5.12 not to have bugs > > > No, but I guess I'm naive thinki

tools to install not in python tree?

2008-03-03 Thread commander_coder
Hello, I have some materials for a project that I am working on that I keep in a source code control system (svn now, but I'm experimenting with mercurial). I want to install these things from the repository, but not into site-packages/ as Distutils wants to do. For instance there are some admin

Re: metaclasses

2008-03-03 Thread Daniel Fetchinson
> What are metaclasses? http://www.google.com/search?q=python+metaclass HTH, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: sympy: what's wrong with this picture?

2008-03-03 Thread castironpi
> All software has bugs. > Good software has bugs. Therefore, good software is software. > This makes sympy worse than worthless, as it f***s up other modules. What is it still good for? -- http://mail.python.org/mailman/listinfo/python-list

'normal' shell with curses

2008-03-03 Thread Michael Goerz
Hi, I'm trying to print out text in color. As far as I know, curses is the only way to do that (or not?). So, what I ultimately want is a curses terminal that behaves as closely as possible as a normal terminal, i.e. it breaks lines and scrolls automatically, so that I can implement a function

Re: _struct in Python 2.5.2

2008-03-03 Thread Nanjundi
On Feb 24, 10:39 am, Olaf Schwarz <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to run this > applicationhttp://svn.navi.cx/misc/trunk/python/bemused/ > on uNSLUng Linux 6.10 using the optware python packages. > > As I obtained segmentation faults using Python 2.4, I have upgraded to > 2.5.2. N

Re: metaclasses

2008-03-03 Thread castironpi
On Mar 3, 8:22 pm, "Daniel Fetchinson" <[EMAIL PROTECTED]> wrote: > > What are metaclasses? > > http://www.google.com/search?q=python+metaclass > > HTH, > Daniel Not satisfied. http://en.wikipedia.org/wiki/Metaclass#Python_example That's a limitation. The constructor can omit the superclass cal

  1   2   >