Re: Command line arguments in Windows

2008-03-03 Thread Mike Walker
"Mark Tolonen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > From the command line, the 'ftype' and 'assoc' commands can be used > view how an extension is handled: > > C:\>assoc .py > .py=Python.File > > C:\>ftype Python.File > Python.File="C:\Python25\python.exe" "%1" %

Re: help needed with regex and unicode

2008-03-03 Thread Mark Tolonen
"Marc 'BlackJack' Rintsch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 04 Mar 2008 10:49:54 +0530, Pradnyesh Sawant wrote: > >> I have a file which contains chinese characters. I just want to find out >> all the places that these chinese characters occur. >> >> The follo

Re: Command line arguments in Windows

2008-03-03 Thread Mark Tolonen
"Mike Walker" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >> If you run a python file, ie. just double clicking it the only >> argument you will have will be the filename of the script. If you >> create a shortcut to the script and in the target box add your >> arguments (if yo

Re: clocking subprocesses

2008-03-03 Thread Karthik Gurusamy
On Mar 3, 9:57 am, [EMAIL PROTECTED] wrote: > 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

Answer: Is there a way to "link" a python program from several files?

2008-03-03 Thread Edward A. Falk
In article <[EMAIL PROTECTED]>, George Sakkis <[EMAIL PROTECTED]> wrote: > >What's so complicated about "python setup.py install" ? Even that is >not strictly necessary for pure python packages; a user may just >unpack the archive, cd to the extracted directory and execute the >appropriate .py fil

Re: metaclasses

2008-03-03 Thread Gerard Flanagan
On Mar 4, 6:31 am, [EMAIL PROTECTED] wrote: > On Mar 3, 10:01 pm, Benjamin <[EMAIL PROTECTED]> wrote: > > > > > On Mar 3, 7:12 pm, [EMAIL PROTECTED] wrote: > > > > What are metaclasses? > > > Depends on whether you want to be confused or not. If you do, look at > > this old but still head bursting

Re: help needed with regex and unicode

2008-03-03 Thread Marc 'BlackJack' Rintsch
On Tue, 04 Mar 2008 10:49:54 +0530, Pradnyesh Sawant wrote: > I have a file which contains chinese characters. I just want to find out > all the places that these chinese characters occur. > > The following script doesn't seem to work :( > > **

Re: Command line arguments in Windows

2008-03-03 Thread Mike Walker
> If you run a python file, ie. just double clicking it the only > argument you will have will be the filename of the script. If you > create a shortcut to the script and in the target box add your > arguments (if you have quotation marks place them after not inside) > you will see your arguments

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

2008-03-03 Thread Mensanator
On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > While we're on the subject of English, the word "worthless" > > means "has no value". So, a program that doesn't work would > > generally be "worthless". One that not only doesn't work but > > creates side effec

Re: Command line arguments in Windows

2008-03-03 Thread Chris
On Mar 4, 7:12 am, "Mike Walker" <[EMAIL PROTECTED]> wrote: > I am having some problems with command line arguments in Windows. The same > code under Linux works fine. > > In Windows I only get one argument no matter how many arguments are passed > on the command line. I think there is some problem

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

2008-03-03 Thread Mensanator
On Mar 3, 8:31 pm, [EMAIL PROTECTED] wrote: > > 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? Lots. The problem is when the total is less than th

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

2008-03-03 Thread Erik Max Francis
Mensanator wrote: > While we're on the subject of English, the word "worthless" > means "has no value". So, a program that doesn't work would > generally be "worthless". One that not only doesn't work but > creates side effects that cause other programs to not work > (which don't have bugs) would

Re: 'normal' shell with curses

2008-03-03 Thread Michael Goerz
Miki wrote, on 03/03/2008 11:14 PM: > Hello Michael, > >> I'm trying to print out text in color. As far as I know, curses is the >> only way to do that (or not?). > On unix, every XTerm compatible terminal will be able to display color > using escape sequence. > (Like the one you see in the output

Re: metaclasses

2008-03-03 Thread castironpi
On Mar 3, 10:01 pm, Benjamin <[EMAIL PROTECTED]> wrote: > On Mar 3, 7:12 pm, [EMAIL PROTECTED] wrote: > > > What are metaclasses? > > Depends on whether you want to be confused or not. If you do, look at > this old but still head bursting > essay:http://www.python.org/doc/essays/metaclasses/. > >

help needed with regex and unicode

2008-03-03 Thread Pradnyesh Sawant
Hi all, I have a file which contains chinese characters. I just want to find out all the places that these chinese characters occur. The following script doesn't seem to work :( ** class RemCh(object): def __init__(self, fNam

Command line arguments in Windows

2008-03-03 Thread Mike Walker
I am having some problems with command line arguments in Windows. The same code under Linux works fine. In Windows I only get one argument no matter how many arguments are passed on the command line. I think there is some problem with the way the .py files are associated causing this. I'm just

Earn from home

2008-03-03 Thread ragu
Today, We are earning upto Rs.20,000 every month from internet without working hard and spending only 30 min daily in the internet. This Income is keep on increasingday by day.We are not joking. We are not making any false statement. It's 100% true ! http://eanrfromyourhome.blogspot.com -- ht

Re: tools to install not in python tree?

2008-03-03 Thread Miki
Hello Jim, > 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

download students tutorials,ebooks,softwares here for Free!!!!

2008-03-03 Thread priya4u
download students tutorials,ebooks,softwares here for Free Download Softwares Ebooks Students tutorials Games Ring tones Wallpapers and Lots of fun everything for FREE only at www.studentshangout.com -- http://mail.python.org/mailman/listinfo/python-list

cron popen xen-create-image

2008-03-03 Thread Christian Kortenhorst
Hey just wondering could anyone help me Have script that runs through cron but seams to run but xen-create-image goes to end but shoes up errors because some stuff it not being passed. ./grabJob.py # RUN all the Create ENVIRONMNET commands here run="/usr/bin/xen-create-image --

Re: RELEASED Python 2.6a1 and 3.0a3

2008-03-03 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Kay Schluehr <[EMAIL PROTECTED]> wrote: | >"The master said so" isn't an entirely satisfying answer. | | Nevertheless, it IS the answer for many questions in the Python world. But not for the questions about 2to3 Curren

Re: pySQLite Insert speed

2008-03-03 Thread Steve Holden
mmm wrote: >>> Hence (if I understand python convention), this can be >>> solved by adding >>> sqlx= copy.copy(sqlx) >>> before the looping. And in tests adding this step saved about 5-10% in >>> time. >> Now this I don;t really understand at all. What's the point of trying to >> replace sqlx with

Re: 'normal' shell with curses

2008-03-03 Thread Miki
Hello Michael, > I'm trying to print out text in color. As far as I know, curses is the > only way to do that (or not?). On unix, every XTerm compatible terminal will be able to display color using escape sequence. (Like the one you see in the output of 'grep --color') See the shameless plug in h

Re: metaclasses

2008-03-03 Thread Benjamin
On Mar 3, 7:12 pm, [EMAIL PROTECTED] wrote: > What are metaclasses? Depends on whether you want to be confused or not. If you do, look at this old but still head bursting essay: http://www.python.org/doc/essays/metaclasses/. Basically, the metaclass of a (new-style) class is responsible for crea

Re: pySQLite Insert speed

2008-03-03 Thread mmm
> > Hence (if I understand python convention), this can be > > solved by adding > > sqlx= copy.copy(sqlx) > > before the looping. And in tests adding this step saved about 5-10% in > > time. > > Now this I don;t really understand at all. What's the point of trying to > replace sqlx with a copy of

XML Schema validation in Python

2008-03-03 Thread Medhat . Gayed
I tested and tried a few XML validators but none of them is able to successfully validate a string of xml (not a file just a string) to programatically be able to validate messages of xml that flow in and out of the different systems. The validators I used were XSV, oNVDL and lxml, can we implemen

Re: Polymorphism using constructors

2008-03-03 Thread castironpi
On Mar 3, 4:03 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > 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(): > > >   @classm

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

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

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

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

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

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

metaclasses

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

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

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

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

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

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

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

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

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

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

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

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,

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

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

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

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

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

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

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

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

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

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

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

  1   2   >