Re: Probably simple syntax error

2007-07-02 Thread John Machin
On Jul 2, 2:40 pm, Dustin MacDonald <[EMAIL PROTECTED]> wrote: > Hi everyone. > > This is my first time posting to this newsgroup, and although I > maintain my netiquette I might've missed something specific to the > newsgroup, so hopefully you can avoid flaming me if I have :) I > apologize for t

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: >> Why do people do this without posting what the actual solution is > > Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script.

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: >> Why do people do this without posting what the actual solution is > > Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script.

ann: Python at the IET

2007-07-02 Thread Tim Golden
If you're in London around 6.30pm this Thursday evening, July 5th 2007, you might want to drop in on The Institution of Engineering and Technology [1] on the Embankment near Waterloo Bridge [2] for "A Light byte of Python" [3]. Michael Grazebrook, Pete Ryland and I are flying the Python flag fo

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: >> Why do people do this without posting what the actual solution is > > Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script.

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Nis Jørgensen
Bruno Desthuilliers skrev: >> Why do people do this without posting what the actual solution is > > Probably because those people think usenet is a free help desk ? Usenet definitely isn't a help desk. You often get useful answers from usenet, from people who are not reading from a script.

Re: urllib2 : https and proxy

2007-07-02 Thread cp . finances . gouv
On 2 juil, 05:04, "O.R.Senthil Kumaran" <[EMAIL PROTECTED]> wrote: > * Maric Michaud <[EMAIL PROTECTED]> [2007-06-28 23:38:39]: > > > Hmmm, i've tried something similar but I get the same result. > > > For the code example I gave, I've put correctly the http_proxy and > > https_proxy environment

Re: String formatting for complex writing systems

2007-07-02 Thread Andy
Thanks guys! I've used the HTML and the unicodedata suggestions, each on a different report. These worked nicely! Andy -- http://mail.python.org/mailman/listinfo/python-list

Bug in Python class static variable?

2007-07-02 Thread Bruza
I am trying to define a class static variable. But the value of the static variable seems to be only defined inside the file that the class is declared. See the code below. When I run "python w.py", I got: 000===> Hello World 001===> Hello World 002===> Not Initialized 003===> Not

Re: Bug in Python class static variable?

2007-07-02 Thread Duncan Booth
Bruza <[EMAIL PROTECTED]> wrote: > I am trying to define a class static variable. But the value of the > static variable seems to be only defined inside the file that the > class is declared. See the code below. When I run "python w.py", I > got: When you run "python w.py" the *script* w.py is lo

freeze: standard modules unknown

2007-07-02 Thread [EMAIL PROTECTED]
I am trying to use freeze to create a single binary executable for one of my program. When I run freeze, it runs fine with the following modules. These modules are available in the dyn-load directory and I can import them from the python interpreter. Warning: unknown modules remain: _bisect _heapq

Re: The best platform and editor for Python

2007-07-02 Thread evil tabby cat
On Jul 2, 5:10 am, kimiraikkonen <[EMAIL PROTECTED]> wrote: > Hi, > For experienced with Pyhton users, which developing software and > enviroment would you suggest for Pyhton programming? Compiler+Editor > +Debugger. > > Also what are your suggestions for beginners of Pyhton programming? > > Thank

Re: good matlab interface

2007-07-02 Thread Brian Blais
On Jun 30, 2007, at 2:31 AM, felix seltzer wrote: > Does any one know of a good matlab interface? > I would just use scipy or numpy, but i also need to use > the matlab neural network functions. I have tried PyMat, but am > having > a hard time getting it to install correctly. > What problems

python svn pre-commit hook

2007-07-02 Thread evil tabby cat
This is a python script which is fired off from a batchfile pre- commit.bat on Windows2000 server. Everything I've read says that it should work & each part does work when tested individually. But when it runs within subversion this statement always ends with this log_msg being an empty string. l

Re: Python changing keywords name

2007-07-02 Thread Michael Hoffman
Gabriel Genellina wrote: > "except" is hard to translate, and > even in English I don't see what is the intended meaning (is it a noun? > a verb? an adverb? all look wrong). It's a preposition. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Interest in a one-day business conference for Python, Zope and Plone companies ?

2007-07-02 Thread eGenix Team: M.-A. Lemburg
Hello, eGenix is looking into organizing a one day conference specifically for companies doing business with Python, Zope and Plone. The conference will likely be held in or close to Düsseldorf, Germany, which is lively medium-sized city, with good airport connections world-wide and specifically t

unify els database

2007-07-02 Thread luca72
Hello How i can use to connect to a unify els database with python Regards Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-02 Thread dlomsak
Okay, Im back at work and got to put some of these suggestions to use. cPickle is doing a great job a hiking up the serialization rate and cutting out the +=data helped a lot too. The entire search process now for this same data set is down to about 4-5 seconds from pressing 'search' to having the

Re: Probably simple syntax error

2007-07-02 Thread ptn
> > Problem 6: big_randomized_int can only have values in 0, 1, ..., 98, > 99. So small_randomized_int will have the value 0, always. > > Perhaps you meant: > small_randomised_float = big_randomized_int / 100.0 > > > small_randomized_int = Round(small_randomized_int, 2) > > # R

Python-URL! - weekly Python news and links (Jul 2)

2007-07-02 Thread Cameron Laird
QOTW: "Modules are objects too - they're a good example of singletons. If you want to create a class containing only static methods: use a module instead. If you want to create a class having a single instance (a singleton), most of the time you can use a module instead. Functions don't *have* to

Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 1, 10:12 pm, Paul Rubin wrote: > You've gotten good suggestions about Python configurations. Depending > on your application you might look at alternative languages as well. > Lua and Hedgehog Lisp both come to mind as small embedded interpreters. PyMite will get

Reading stdout and stderr of an external program

2007-07-02 Thread Murali
Hi Python programmers, I need to be able to read the stdout and stderr streams of an external program that I launch from my python script. os.system( 'my_prog' + '>& err.log' ) and was planning on monitoring err.log and to display its contents. Is this the best way to do this? Thanks, Murali. --

Re: Tiny/small/minimalist Python?

2007-07-02 Thread Paul Rubin
rtk <[EMAIL PROTECTED]> writes: > FYI.. I wanted a simple version of Python to run on an ancient DEC > Alpha box. I got VMS Python 2.5 up and running but it is too slow to > use. It takes *minutes* to get the interpreter prompt after typing > 'python'! Something is wrong. Maybe it's trying to

Re: Reading stdout and stderr of an external program

2007-07-02 Thread Thomas Jollans
On Monday 02 July 2007, Murali wrote: > Hi Python programmers, > > I need to be able to read the stdout and stderr streams of an external > program that I launch from my python script. os.system( 'my_prog' + > '>& err.log' ) and was planning on monitoring err.log and to display > its contents. Is t

Re: Reading stdout and stderr of an external program

2007-07-02 Thread Ben Cartwright
> I need to be able to read the stdout and stderr streams of an external > program that I launch from my python script. os.system( 'my_prog' + > '>& err.log' ) and was planning on monitoring err.log and to display > its contents. Is this the best way to do this? from subprocess import Popen stdout

Re: Portable general timestamp format, not 2038-limited

2007-07-02 Thread John W. Kennedy
Martin Gregorie wrote: > Roedy Green wrote: >> >> To add to the confusion you have GPS, Loran and Julian day also used >> as scientific times. > > > GPS time is UTC time No it isn't. GPS has never introduced a leap second, and is still on uncorrected UTC-as-of-1980. However, the GPS signal also

need help with win32com

2007-07-02 Thread Thomas
I want to be able to access an excel file and extract the code from the macro that is in the file. How can I do this? -- ~Thomas~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with PEXPECT in Python

2007-07-02 Thread Noah
Kevin Erickson wrote: > On Jun 30, 5:50 pm, Kevin Erickson <[EMAIL PROTECTED]> wrote: > > #Begin Code > > > > import sys > > import pexpect > > > > def GetServerData(self): > > foo = pexpect.spawn('scp [EMAIL PROTECTED]:/home/config/ > > role{/file1,/files/file2,/files/file3} /tmp') >

Re: Probably simple syntax error

2007-07-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mark Peters <[EMAIL PROTECTED]> wrote: . . . >Square brackets indicate the index into a sequence (like a list) > I'm wary of this line, especially in isolation. I hope it reduces, rather than

subprocess -- broken pipe error

2007-07-02 Thread 7stud
Hi, Can someone explain what a broken pipe is? The following produces a broken pipe error: -- import subprocess as sub p = sub.Popen(["ls", "-al", "../"], stdin=sub.PIPE, stdout=sub.PIPE) print p.stdout.read() #outputs the files correctly p.stdin.write("ls\n") #IOError: [Errno 32] Bro

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Sion Arrowsmith
Frank Swarbrick <[EMAIL PROTECTED]> wrote: >dmitrey wrote: >> Thanks all, I have solved the problem. >Why do people do this without posting what the actual solution is Hey, if we're expected to magically deduce what the problem is without being told an error messages, surely we can magically

Re: Rappresenting infinite

2007-07-02 Thread andrea
Mm very interesting thread, for my needs from numpy import inf is more than enough :) -- http://mail.python.org/mailman/listinfo/python-list

Pretty Scheme, ??? Python

2007-07-02 Thread Neil Cerutti
The following simple language parser and interpreter is from chapter 2 of the textbook: _Programming Languages: Application and Interpretation_, by Shriram Krishnamurthi. http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/ First, I'll show the Scheme version of the program, which uses the c

Re: The best platform and editor for Python

2007-07-02 Thread kimiraikkonen
On Jul 2, 3:49 pm, evil tabby cat <[EMAIL PROTECTED]> wrote: > On Jul 2, 5:10 am, kimiraikkonen <[EMAIL PROTECTED]> wrote: > > > Hi, > > For experienced with Pyhton users, which developing software and > > enviroment would you suggest for Pyhton programming? Compiler+Editor > > +Debugger. > > > Als

Re: subprocess -- broken pipe error

2007-07-02 Thread [EMAIL PROTECTED]
On Jul 2, 1:12 pm, 7stud <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone explain what a broken pipe is? The following produces a > broken pipe error: > > -- > import subprocess as sub > > p = sub.Popen(["ls", "-al", "../"], stdin=sub.PIPE, stdout=sub.PIPE) > > print p.stdout.read() > #out

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: >>> Explicitly clear the exception? With sys.exc_clear? >> Yes. Is there a problem with that? > As long as nothing tries to re-raise the exception I doubt it breaks > anything: > > >>> import sys > >>> try: > raise StandardError("Hello") > ex

Re: The best platform and editor for Python

2007-07-02 Thread kimiraikkonen
Thanks for the replies so far. Also i have to learn: What is the most reliable and easy way to start learning Ptyhon? Books? Trusted code sammples(where?)? I know the importance and eases of Python quiet. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: >> You don't necessarily want a function that raises an exception to >> deallocate all of its resources before raising the exception, since >> you may want access to these resources for debugging, or what have >> you. > No problem: > > [...] > > >>> c

Re: what is the PythonWin

2007-07-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: >* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2007-07-01 15:53:30]: > >> In PythonWin, select Tools | COM MakePy utility | Microsoft Speech >> Object Library 5.1). >> >> I can't find PythonWin .. Does anybody know what this

Re: subprocess -- broken pipe error

2007-07-02 Thread 7stud
On Jul 2, 11:32 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 2, 1:12 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > Can someone explain what a broken pipe is? The following produces a > > broken pipe error: > > > -- > > import subprocess as sub > > > p = sub.Popen(

Python compilation ??

2007-07-02 Thread Cathy Murphy
Is python a compiler language or interpreted language. If it is interpreter , then why do we have to compile it? Python newbie -- Cathy www.nachofoto.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python compilation ??

2007-07-02 Thread Evan Klitzke
On 7/2/07, Cathy Murphy <[EMAIL PROTECTED]> wrote: > Is python a compiler language or interpreted language. If it is interpreter > , then why do we have to compile it? It's an interpreted language. It is compiled into bytecode (not machine code) the first time a script is run to speed up subsequen

Re: sort pygtk gtktreeview column containing dates

2007-07-02 Thread Jan Vorwerk
Hi, I did something similar already in wxPython, but not yet in PyGTK. Therefore I cannot provide the actual solution... Since noone answered, I will still give you a hint : http://www.pygtk.org/pygtk2tutorial/sec-TreeModelInterface.html See 14.2.9. Sorting TreeModel Rows and set_sort_func(so

Re: Rappresenting infinite

2007-07-02 Thread [EMAIL PROTECTED]
On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote: > I would like to have a useful rappresentation of infinite, is there > already something?? > > I was thinking to something like this > > class Inf(int): > """numero infinito""" > def __init__(self,negative=False): >

Re: subprocess -- broken pipe error

2007-07-02 Thread 7stud
Why doesn't the following program write to the file? driver.py --- import subprocess as sub p = sub.Popen(["python", "-u", "test1.py"], stdin=sub.PIPE, stdout=sub.PIPE) p.stdin.write("text3") while True: pass --- test1.py: - import sys data = sys.stdin.read() f = open("a

Re: need help with win32com

2007-07-02 Thread kyosohma
On Jul 2, 11:38 am, Thomas <[EMAIL PROTECTED]> wrote: > I want to be able to access an excel file and extract the code from > the macro that is in the file. How can I do this? > > -- > ~Thomas~ You should be able to use PythonWin and the makepy utility to get handles to the Excel object. See the

Re: Rappresenting infinite

2007-07-02 Thread Robert Kern
[EMAIL PROTECTED] wrote: > float('inf') works well, no? > >>>> inf = float('inf') >>>> inf / inf >nan >>>> -inf >-inf >>>> inf / 0 >ZeroDivisionError: float division >>>> 1 / inf >0.0 >>>> 0 * float('inf') >nan It is not cross-platform. The parsing of

Re: Bug in Python class static variable?

2007-07-02 Thread Bruza
On Jul 2, 3:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > Bruza <[EMAIL PROTECTED]> wrote: > > I am trying to define a class static variable. But the value of the > > static variable seems to be only defined inside the file that the > > class is declared. See the code below. When I run "python w

Re: subprocess -- broken pipe error

2007-07-02 Thread Bjoern Schliessmann
7stud wrote: > Thanks for the response. So are you saying that the only way you > can get data out of a pipe is when the subprocess has terminated? No, not only because Pipes aren't related to processes in any special way. He said that you can't write to a pipe whose reader has already terminat

Re: subprocess -- broken pipe error

2007-07-02 Thread Bjoern Schliessmann
7stud wrote: > Why doesn't the following program write to the file? > [...] > It just hangs, and then when I hit Ctrl+C and look in the file, > the data isn't in there. I suppose your running child process isn't closed cleanly if you terminate the parent process. Also, the pipe may be unbuffered

Re: subprocess -- broken pipe error

2007-07-02 Thread 7stud
On Jul 2, 1:58 pm, Bjoern Schliessmann wrote: > 7stud wrote: > > Thanks for the response. So are you saying that the only way you > > can get data out of a pipe is when the subprocess has terminated? > > No, not only because Pipes aren't related to processes in any > special way. > > He said that

Re: subprocess -- broken pipe error

2007-07-02 Thread 7stud
On Jul 2, 2:03 pm, Bjoern Schliessmann wrote: > 7stud wrote: > > Why doesn't the following program write to the file? > > [...] > > It just hangs, and then when I hit Ctrl+C and look in the file, > > the data isn't in there. > > Also, the pipe may be unbuffered by > default; file access isn't. >

Re: subprocess -- broken pipe error

2007-07-02 Thread Steve Holden
7stud wrote: > Why doesn't the following program write to the file? > > driver.py > --- > import subprocess as sub > > p = sub.Popen(["python", "-u", "test1.py"], stdin=sub.PIPE, > stdout=sub.PIPE) > > > p.stdin.write("text3") > > while True: > pass > --- > > test1.py: > -

Re: Python compilation ??

2007-07-02 Thread Steve Holden
Evan Klitzke wrote: > On 7/2/07, Cathy Murphy <[EMAIL PROTECTED]> wrote: >> Is python a compiler language or interpreted language. If it is interpreter >> , then why do we have to compile it? > > It's an interpreted language. It is compiled into bytecode (not > machine code) the first time a scrip

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
On Jul 1, 12:38 pm, dlomsak <[EMAIL PROTECTED]> wrote: > Thanks for the responses folks. I'm starting to think that there is > merely an inefficiency in how I'm using the sockets. The expensive > part of the program is definitely the socket transfer because I timed > each part of the routine indivi

Re: Pretty Scheme, ??? Python

2007-07-02 Thread Laurent Pointal
Neil Cerutti wrote: ... > How can I make the Python more idiomatic Python? Have you taken a look at pyparsing ? http://pyparsing.wikispaces.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in Python class static variable?

2007-07-02 Thread Duncan Booth
Bruza <[EMAIL PROTECTED]> wrote: > On Jul 2, 3:52 am, Duncan Booth <[EMAIL PROTECTED]> wrote: >> Bruza <[EMAIL PROTECTED]> wrote: >> > I am trying to define a class static variable. But the value of the >> > static variable seems to be only defined inside the file that the >> > class is declared.

Re: Python compilation ??

2007-07-02 Thread Michael Hoffman
Steve Holden wrote: > Evan Klitzke wrote: >> On 7/2/07, Cathy Murphy <[EMAIL PROTECTED]> wrote: >>> Is python a compiler language or interpreted language. If it is >>> interpreter >>> , then why do we have to compile it? >> >> It's an interpreted language. It is compiled into bytecode (not >> mach

Re: howto resend args and kwargs to other func?

2007-07-02 Thread Duncan Booth
Sion Arrowsmith <[EMAIL PROTECTED]> wrote: > Frank Swarbrick <[EMAIL PROTECTED]> wrote: >>dmitrey wrote: >>> Thanks all, I have solved the problem. >>Why do people do this without posting what the actual solution is > > Hey, if we're expected to magically deduce what the problem is > without

Re: subprocess -- broken pipe error

2007-07-02 Thread 7stud
On Jul 2, 2:12 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > a) Who told you pipes should be unbuffered by default, and b) what difference > does that make anyway? > a) The docs. b) If the pipes were buffered then writing a small amount of data like "text3" to the pipe would cause the other side

Re: Python compilation ??

2007-07-02 Thread Jean-Paul Calderone
On Mon, 02 Jul 2007 16:14:41 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: >Evan Klitzke wrote: >> On 7/2/07, Cathy Murphy <[EMAIL PROTECTED]> wrote: >>> Is python a compiler language or interpreted language. If it is interpreter >>> , then why do we have to compile it? >> >> It's an interpreted l

python script for monitoring input/output parameters of online gaming client

2007-07-02 Thread jj kk
Hi, I'd like to be able to capture parameters of online gaming client applications (the kind of client software you install to play poker, backgammon... online) with the aim of writing python software that analyzes this data. I'm clueless, as I know next to nothing about python networking. Could

python script for monitoring input/output parameters of online gaming client

2007-07-02 Thread jj kk
Hi, I'd like to be able to capture parameters of online gaming client applications (the kind of client software you install to play poker, backgammon... online) with the aim of writing python software that analyzes this data. I'm clueless, as I know next to nothing about python networking. Could

Dynamic Language Ninja (or Pirate) - Telecommuting Allowed

2007-07-02 Thread [EMAIL PROTECTED]
I searched for old messages containing job posts, and saw no one complaining, so I assume it is ok to post here. Please accept my apologies if it is not. That said, here's our position! Dynamic Language Ninja (or Pirate) Etsy is an online marketplace for buying and selling all things handmade: cl

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > "Dynamic typing is recommended", they conclude, "when programs must be > as flexible as possible". I recommend reading the Agile Manifesto to > understand why maximal flexibility is crucial in most real-world > applica

Re: Pretty Scheme, ??? Python

2007-07-02 Thread Neil Cerutti
On 2007-07-02, Laurent Pointal <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> How can I make the Python more idiomatic Python? > > Have you taken a look at pyparsing ? Yes, I have it. PyParsing has, well, so many convenience features they seem to shout down whatever the core features are, and

Correct abstraction for TK

2007-07-02 Thread luke . hoersten
I'm looking for a good example of how to correctly abstract TK code from the rest of my program. I want to just get some user info and then get 4 values from the GUI. Right now I've written it OOP per the examples on python.org but it doesn't seem to be meshing very well with the rest of my project

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-02 Thread Steve Holden
Donn Cave wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Alex Martelli) wrote: > >> "Dynamic typing is recommended", they conclude, "when programs must be >> as flexible as possible". I recommend reading the Agile Manifesto to >> understand why maximal flexibility is crucial in

Re: object references/memory access

2007-07-02 Thread Steve Holden
Karthik Gurusamy wrote: > On Jul 1, 12:38 pm, dlomsak <[EMAIL PROTECTED]> wrote: [...] > > I have found the stop-and-go between two processes on the same machine > leads to very poor throughput. By stop-and-go, I mean the producer and > consumer are constantly getting on and off of the CPU since t

Re: Python compilation ??

2007-07-02 Thread Steve Holden
Jean-Paul Calderone wrote: > On Mon, 02 Jul 2007 16:14:41 -0400, Steve Holden <[EMAIL PROTECTED]> wrote: >> Evan Klitzke wrote: >>> On 7/2/07, Cathy Murphy <[EMAIL PROTECTED]> wrote: Is python a compiler language or interpreted language. If it is interpreter , then why do we have to compi

Re: subprocess -- broken pipe error

2007-07-02 Thread Steve Holden
7stud wrote: > On Jul 2, 1:58 pm, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: >> 7stud wrote: >>> Thanks for the response. So are you saying that the only way you >>> can get data out of a pipe is when the subprocess has terminated? >> No, not only because Pipes aren't related to processes in a

Re: subprocess -- broken pipe error

2007-07-02 Thread Steve Holden
7stud wrote: > On Jul 2, 2:12 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> a) Who told you pipes should be unbuffered by default, and b) what difference >> does that make anyway? >> > > a) The docs. > > b) If the pipes were buffered then writing a small amount of data like > "text3" to the pipe

Re: Correct abstraction for TK

2007-07-02 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: > I'm looking for a good example of how to correctly abstract TK code > from the rest of my program. I want to just get some user info and > then get 4 values from the GUI. Right now I've written it OOP per the > examples on python.org but it doesn't seem to be meshing very

Programming Idiomatic Code

2007-07-02 Thread Nathan Harmston
Hi, I m sorry but I m bored at work (and no ones looking so I can write some Python) and following a job advertisement post,I decided to write the code to do its for the one entitled Ninjas or something like that. I was wondering what could be done to my following code to make it more idiomatic...

Re: How to FTP a ASCII file

2007-07-02 Thread John Machin
On Jul 3, 9:02 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > My program has the following code to transfer a binary file > > f = open(pathanme+filename,'rb') > print "start transfer" > self.fthHandle.storbinary('STOR '+filename, f) > > How can I do an ASCII fi

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
On Jul 2, 3:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Karthik Gurusamy wrote: > > On Jul 1, 12:38 pm, dlomsak <[EMAIL PROTECTED]> wrote: > [...] > > > I have found the stop-and-go between two processes on the same machine > > leads to very poor throughput. By stop-and-go, I mean the producer

Re: Pretty Scheme, ??? Python

2007-07-02 Thread Paul McGuire
On Jul 2, 3:56 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-07-02, Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > Neil Cerutti wrote: > >> How can I make the Python more idiomatic Python? > > > Have you taken a look at pyparsing ? > > Yes, I have it. PyParsing has, well, so many convenie

Re: How to FTP a ASCII file

2007-07-02 Thread Adonis Vargas
[EMAIL PROTECTED] wrote: > Hi, > > My program has the following code to transfer a binary file > > f = open(pathanme+filename,'rb') > print "start transfer" > self.fthHandle.storbinary('STOR '+filename, f) > > How can I do an ASCII file transfer?? > -Ted > Taken fro

Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 2, 9:43 am, Paul Rubin wrote: > rtk <[EMAIL PROTECTED]> writes: > > FYI.. I wanted a simple version of Python to run on an ancient DEC > > Alpha box. I got VMS Python 2.5 up and running but it is too slow to > > use. It takes *minutes* to get the interpreter prom

Re: Probably simple syntax error

2007-07-02 Thread John Machin
On Jul 3, 9:04 am, Dustin MacDonald <[EMAIL PROTECTED]> wrote: > And Cameron: Ah, yes. It does reduce the confusion. I do know that > square brackets are used for *creating* a dictionary (blah = ["A", > "B", "C"], That's a list, not a dictionary. > so I figured the same would apply to accessing

Re: Pretty Scheme, ??? Python

2007-07-02 Thread Paul McGuire
On Jul 2, 6:28 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Jul 2, 3:56 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > > > > > > On 2007-07-02, Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > > Neil Cerutti wrote: > > >> How can I make the Python more idiomatic Python? > > > > Have you taken

Re: Tiny/small/minimalist Python?

2007-07-02 Thread Irmen de Jong
Paul Rubin wrote: > rtk <[EMAIL PROTECTED]> writes: >> FYI.. I wanted a simple version of Python to run on an ancient DEC >> Alpha box. I got VMS Python 2.5 up and running but it is too slow to >> use. It takes *minutes* to get the interpreter prompt after typing >> 'python'! > > Something is w

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Lenard Lindstrom
Douglas Alan wrote: > Lenard Lindstrom <[EMAIL PROTECTED]> writes: > Explicitly clear the exception? With sys.exc_clear? > >>> Yes. Is there a problem with that? > >> As long as nothing tries to re-raise the exception I doubt it breaks >> anything: >> >> >>> import sys >> >>> try: >>

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Lenard Lindstrom
Douglas Alan wrote: > Lenard Lindstrom <[EMAIL PROTECTED]> writes: > >>> You don't necessarily want a function that raises an exception to >>> deallocate all of its resources before raising the exception, since >>> you may want access to these resources for debugging, or what have >>> you. > >> N

Re: Programming Idiomatic Code

2007-07-02 Thread Steve Lianoglou
I don't know about idiomatic, but here's a quick list of somethings I'd change. 1) In general, I don't think it's a good idea for a called function to blow out the system on error. So, in this example, I wouldn't have raised errors be caught in the same function only to call os.exit. I'd either de

How to FTP a ASCII file

2007-07-02 Thread [EMAIL PROTECTED]
Hi, My program has the following code to transfer a binary file f = open(pathanme+filename,'rb') print "start transfer" self.fthHandle.storbinary('STOR '+filename, f) How can I do an ASCII file transfer?? -Ted -- http://mail.python.org/mailman/listinfo/python-list

Re: Probably simple syntax error

2007-07-02 Thread Dustin MacDonald
Ah. Thank you everyone. Sorry for not replying earlier, real life got in the way :) Gerry Herron, Tim Delaney, Mark Peters: Thank you. Switching from parentheses to square brackets fixed the code, and yes, Tim, you were right. It was a list I was working with. And thanks for those links Tim. John

Re: Programming Idiomatic Code

2007-07-02 Thread attn . steven . kuo
On Jul 2, 5:22 pm, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > Hi, > > I m sorry but I m bored at work (and no ones looking so I can write > some Python) and following a job advertisement post,I decided to write > the code to do its for the one entitled Ninjas or something like that. > I was won

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: >> I'm not sure I understand you here. You're saying that I should have >> the foresight to wrap all my file opens is a special class to >> facilitate debugging? > Obviously you had the foresight to realize with statements could > compromise debugging

Re: object references/memory access

2007-07-02 Thread Steve Holden
Karthik Gurusamy wrote: > On Jul 2, 3:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote: >> Karthik Gurusamy wrote: >>> On Jul 1, 12:38 pm, dlomsak <[EMAIL PROTECTED]> wrote: >> [...] >> >>> I have found the stop-and-go between two processes on the same machine >>> leads to very poor throughput. By sto

The file executing

2007-07-02 Thread Benjamin
How does one get the path to the file currently executing (not the cwd). Thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's "only one way to do it" philosophy isn't good?

2007-07-02 Thread Douglas Alan
Lenard Lindstrom <[EMAIL PROTECTED]> writes: >> Also, any caught exception is automatically cleared when >> the catching procedure returns anyway, so it's not like Python has >> ever considered a caught exception to be precious information that >> ought to be preserved long past the point where it

Re: Tiny/small/minimalist Python?

2007-07-02 Thread rtk
On Jul 2, 6:26 pm, Irmen de Jong <[EMAIL PROTECTED]> wrote: > Back in the days my port of Python to the Commodore Amiga machine ran > quite comfortably on a 50 mhz CPU with 4 Mb of RAM. (ok ok it was > Python 1.5.2, that has to be said). > Python started in about 5 seconds on that Amiga if I rememb

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-02 Thread Alex Martelli
Donn Cave <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] (Alex Martelli) wrote: > > > "Dynamic typing is recommended", they conclude, "when programs must be > > as flexible as possible". I recommend reading the Agile Manifesto to > > understand why maximal flex

Re: object references/memory access

2007-07-02 Thread Karthik Gurusamy
On Jul 2, 6:32 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Karthik Gurusamy wrote: > > On Jul 2, 3:01 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Karthik Gurusamy wrote: > >>> On Jul 1, 12:38 pm, dlomsak <[EMAIL PROTECTED]> wrote: > >> [...] > > >>> I have found the stop-and-go between two p

Re: The file executing

2007-07-02 Thread Justin Ezequiel
On Jul 3, 9:40 am, Benjamin <[EMAIL PROTECTED]> wrote: > How does one get the path to the file currently executing (not the > cwd). Thank you os.path.dirname(sys.argv[0]) -- http://mail.python.org/mailman/listinfo/python-list

try/finally in threads

2007-07-02 Thread George Sakkis
I posted this on the Pyro list but I'm not sure if it's related specifically to Pyro. The "finally" clause below is not executed when f() runs on on a (daemon) thread and the program exits. DAEMON here is a global Pyro.code.Daemon instance. def f(): try: DAEMON.requestLoop() finally:

Re: Tiny/small/minimalist Python?

2007-07-02 Thread Paul Rubin
Irmen de Jong <[EMAIL PROTECTED]> writes: > Back in the days my port of Python to the Commodore Amiga machine ran > quite comfortably on a 50 mhz CPU with 4 Mb of RAM. (ok ok it was > Python 1.5.2, that has to be said). Even that sounds way too slow. Kyoto Common Lisp started in a few seconds on

Re: good matlab interface

2007-07-02 Thread felix seltzer
my problems where more with scipy, which i needed for pymat. scipy gives two import errors (but still imports), and then pymat cant find the libraries that scipy provides. ohwell... i think i can just modify it to work with numpy untill i can sort out the errors. thanks, -felix On 7/2/07, Bria

Re: what is the PythonWin

2007-07-02 Thread O.R.Senthil Kumaran
* Cameron Laird <[EMAIL PROTECTED]> [2007-07-02 17:27:31]: > >PythonWin is a separate project by Mark Hammond providing win32 extensions > >for > >python. > > > >http://sourceforge.net/projects/pywin32/ > . > . > . > I believe the

  1   2   >