Re: File Parsing Question

2007-09-12 Thread Peter Otten
Dennis Lee Bieber wrote: > for line in inp: > > will read one line at a time (I'm fairly sure the iterator doesn't > attempt to buffer multiple lines behind the scenes) You are wrong: >>> open("tmp.txt", "w").writelines("%s\n" % (9*c) for c in "ABCDE") >>> instream = open("tmp.txt") >>> for li

Re: Parallel/Multiprocessing script design question

2007-09-12 Thread Martin v. Löwis
> I tend to ramble, and I am afraid none of you busy experts will bother > reading my long post I think that's a fairly accurate description, and prediction. > I am hoping people > with experience using any of these would chime in with tips. The main thing > I would look for in a toolkit is ma

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread genro
On Sep 12, 6:21 am, Charles Fox <[EMAIL PROTECTED]> wrote: > I've just started playing around with Python, as a possible > replacement for a mix of C++, Matlab and Lisp. The language looks > lovely and clean with one huge exception: I do a lot of numerical > modeling, so I deal with objects (like

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Mark Summerfield
On 13 Sep, 00:03, Paul Rubin wrote: > Mark Summerfield <[EMAIL PROTECTED]> writes: > > I feel that Python lacks one useful data structure: an ordered > > dictionary. > > Do other Python programmers feel this lack? Is this worth a PEP? > > Yes. It should use a functional

Re: need scsh in a wikip article

2007-09-12 Thread [EMAIL PROTECTED]
On 12 сент, 13:32, [EMAIL PROTECTED] (Timofei Shatrov) wrote: > On Wed, 12 Sep 2007 02:10:09 -0700, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > tried to confuse everyone with this message: > > >> someone please add scsh there. > > >Why can't YOU add scsh or I am missing something?? > > Maybe he is ba

Re: Search path for python script

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 14:40:30 -0700 schrieb grt: > I'm new to python, running it under cygwin. This must be easy but I > haven't figured it out. I'm trying to run a script by typing: > > python test.py > > where test.py is in a directory I've added to PYTHONPATH, but test.py > is not found. Perha

Re: Setting stdout encoding

2007-09-12 Thread Gabriel Genellina
En Tue, 11 Sep 2007 07:58:03 -0300, Fabio Zadrozny <[EMAIL PROTECTED]> escribi�: >> You could place code like that on sitecustomize.py >> I think this should be fixed on Eclipse/pydev. If they replace >> sys.stdout >> with a different object - they should make sure it has the right >> behavi

Re: File Parsing Question

2007-09-12 Thread Peter Otten
Am Wed, 12 Sep 2007 17:28:08 -0500 schrieb Shankarjee Krishnamoorthi: > I would prefer to use something with seek. Writing Perl in any language? > I am not able to use seek() > with "for line in inp". Use tell and seek does not seem to do anything > with the code. When I try to do > > for line

Re: Python code-writing for the blind. Was (Re: newbie: stani's pythoneditor if-else)

2007-09-12 Thread Gabriel Genellina
En Tue, 11 Sep 2007 14:28:35 -0300, Hamilton, William <[EMAIL PROTECTED]> escribi�: > Can you set SPE to use a single space rather than the typical four > spaces? Python should accept it just fine. You'll still have problems > reading other people's code. Maybe you can write a quick script t

Re: Car-ac-systems

2007-09-12 Thread nebulous99
On Sep 11, 9:35 am, "John Timney \(MVP\)" <[EMAIL PROTECTED]> wrote: > How do I control one with C# then! Thats not on your site, clearly not > everything I need to know then. Waste of a site! C# is just as off topic in comp.lang.java.programmer as car air- conditioning systems. The latter, howe

Re: Is the wxPython list down?

2007-09-12 Thread Frank Millman
Chris Mellon wrote: > Frank Millman wrote: > > I noticed that cvs seems to be down as well - maybe it was on the same > > server. > > CVS is down because wx has moved to SVN, which is still up and running > fine. svn.wxwidgets.org. Thanks, Chris, I found it. However, the 'Browse sources' link on

Parallel/Multiprocessing script design question

2007-09-12 Thread Amit N
Hi guys, I tend to ramble, and I am afraid none of you busy experts will bother reading my long post, so I will try to summarize it first: 1. I have a script that processes ~10GB of data daily, and runs for a long time that I need to parallelize on a multicpu/multicore system. I am trying to d

Re: Implementing a fixed size stack for an RPN Calculator

2007-09-12 Thread [EMAIL PROTECTED]
On Sep 12, 2:55 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 12 Sep 2007 20:55:22 +, [EMAIL PROTECTED] wrote: > > I have implemented an RPN calculator in python but now I would like to > > make the stack size fixed. how can I transform the user's RPN > > expression from a s

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Michele Simionato
On Sep 12, 1:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Making, say, 'a' hiddenly mean 'x.a', within a function, requires a > decorator that suitably rewrites the function's bytecode... (after > which, it WOULD still be terrible and horrible and not to be used, just > as you say, but it migh

Re: Error in random module, bad installation?

2007-09-12 Thread Tim Roberts
Andrew F <[EMAIL PROTECTED]> wrote: >I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the >location of a number of libraries and tools. > >So far I've tracked most errors, but this one has me scratching my >head : > >$ which python >/usr/local/bin/python >$ echo $PYTHONPATH >/usr/l

Re: unexpected behavior: did i create a pointer?

2007-09-12 Thread Gabriel Genellina
En Wed, 12 Sep 2007 08:30:14 -0300, Bruno Desthuilliers <[EMAIL PROTECTED]> escribi�: > neoedmund a écrit : >> On Sep 7, 4:07 pm, gu <[EMAIL PROTECTED]> wrote: > (snip pb and code) >>> now, in the second "for" cycle and in functionA() i only 'touch' >>> copyOfA >>> (altering it). as i don't to

Re: Python Database Apps

2007-09-12 Thread Prateek
On Sep 13, 4:55 am, Ed Leafe <[EMAIL PROTECTED]> wrote: > On Sep 12, 2007, at 10:53 AM, [EMAIL PROTECTED] wrote: > > > Thanks for ideas Ed. I am checking out dabo now. I do have a few > > questions about it. Packaging. Is it easy to package into a quick > > install for windows. The users are g

Re: mod_python and pysvn

2007-09-12 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Gabriel Genellina wrote: > If that's really actual code, looks wrong. You should double all your > backslashes or use a raw string. And \\P:... doesn't look well formed > either. DOSlexia strikes again. :) -- http://mail.python.org/mailman/listinfo/python-list

Python+Expect+Win32 = Not Possible?

2007-09-12 Thread gamename
Hi, Is it still the case there is no practical Expect-like module for win32? I know that cygwin can support pexpect, but that isn't an option here --- I have to use a native win32 Python version. Are there alternatives, or is it simply not an option to replicate Expect on win32 with python? All

Possible suggestion for removing the GIL

2007-09-12 Thread Prateek
Hi, Recently there was some talk on removing the GIL and even the BDFL has written a blog post on it. I was trying to come up with a scalable and backwards compatible approach for how to do it. I've put my thoughts up in a blog post - and I'd really like to hear what the community thinks of it. M

Re: mod_python and pysvn

2007-09-12 Thread Gabriel Genellina
En Tue, 11 Sep 2007 15:35:00 -0300, Sjoerd <[EMAIL PROTECTED]> escribi�: > The actual command: > > client = Client() > repLog = client.log("\\P:\\tools\builds\publish\\") > I used an UNC path. The forming of the repository path must be inside > the pysvn > library. If that's really actual code, l

Re: Python 3K or Python 2.9?

2007-09-12 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: (Please, preserve attribution lines so it's clear who wrote what in your quoted material.) > > >>> Foo.bar(foo, "spam") > > >>> foo.bar("spam") > > That looks like a case of "There's more than one way to do it". ;) Indeed, but there's only o

Re: MemoryError on reading mbox file

2007-09-12 Thread Gabriel Genellina
En Wed, 12 Sep 2007 11:39:46 -0300, Istvan Albert <[EMAIL PROTECTED]> escribi�: > On Sep 12, 5:27 am, Christoph Krammer <[EMAIL PROTECTED]> > wrote: > >> string = self._file.read(stop - self._file.tell()) >> MemoryError > > This line reads an entire message into memory as a string. Is it > p

Re: anybody has py modules emulating symbian 60 on PC?

2007-09-12 Thread Tim Roberts
Steve Holden <[EMAIL PROTECTED]> wrote: > >http://archive.devx.com/wireless/vendordocs/nokia.asp might help. Or it >might not. How utterly refreshing: a completely honest Usenet posting... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listin

Re: Python 3K or Python 2.9?

2007-09-12 Thread Steven D'Aprano
On Wed, 12 Sep 2007 19:40:04 -0700, TheFlyingDutchman wrote: >> >>> Foo.bar(foo, "spam") >> >>> foo.bar("spam") > > That looks like a case of "There's more than one way to do it". ;) The > first form is definitely consistent with the method declaration, so > there's a lot to be said for u

Does anyone know if Python 3 will change in structure?

2007-09-12 Thread Lamonte Harris
The 2.x stucture is boring, would be cool if there could be some sort of spacing we could do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
> >>> Foo.bar(foo, "spam") > >>> foo.bar("spam") That looks like a case of "There's more than one way to do it". ;) The first form is definitely consistent with the method declaration, so there's a lot to be said for using that style when teaching people to make classes -> send self, rece

Re: Python 3K or Python 2.9?

2007-09-12 Thread Ben Finney
"Peter Decker" <[EMAIL PROTECTED]> writes: > On 9/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > > How is that preferable to the magic of "instance is passed as the > > first argument to a method"? > > So everything that isn't passed explicitly is "magic"? No. Everything that's not explicit is "

Re: Python 3K or Python 2.9?

2007-09-12 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > I would mention that an instance is passed as the first parameter > argument of a method if the methods were declared with the extra > argument and called with the extra argument: > > a = MyClass() > > my_method(a,someParameter) Are you unaware th

Re: Get the complete command line as-is

2007-09-12 Thread wangzq
On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: > wangzq a écrit : > > > Hello, > > > I'm passing command line parameters to my browser, I need to pass the > > complete command line as-is, for example: > > > test.py "abc def" xyz > > > If I use ' '.join(sys.argv[1:]), then the double

Re: Python 3K or Python 2.9?

2007-09-12 Thread Peter Decker
On 9/12/07, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > I am talking about how an author describes in English the "this" > > pointer/reference in their book on programming C++ or Java. > > > > I don't think you will find them saying that under the cov

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 5:47 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > I am talking about how an author describes in English the "this" > > pointer/reference in their book on programming C++ or Java. > > > I don't think you will find them saying that under the

python & osgi

2007-09-12 Thread Andreas Wapf
Is there something like a osgi implementation in python? I am really impressed by the bundle system and the possibility to load and unload bundles without wasting memory. Is it even possible to do something like that in python? Would be nice to have a very small python interpreter and just load the

Re: Coming from Perl

2007-09-12 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > print < > > Hello > > > EndHTML The equivalent in Python would be:: print """ Hello """ You can even use Python's standard textwrap module to indent your code properly:: import textwrap def foo(bar):

RE: Coming from Perl

2007-09-12 Thread Ryan Ginstrom
> On Behalf Of Amer Neely > I saw that and I guess that is the closest thing. In Perl I can do .. > > print < > > Hello > > > EndHTML >>> data = dict(title="Python Rocks!", content="I heart Python") >>> template = """ %(title)s %(content)s """ >>> print template % data Pytho

Re: Coming from Perl

2007-09-12 Thread Amer Neely
TheFlyingDutchman wrote: > On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's '

Re: Coming from Perl

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 5:30 pm, Amer Neely <[EMAIL PROTECTED]> wrote: > I'm a complete newbie with Python, but have several years experience > with Perl in a web environment. > > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I've just search

Re: Coming from Perl

2007-09-12 Thread Amer Neely
Ben Finney wrote: > Amer Neely <[EMAIL PROTECTED]> writes: > >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's 'here document'? > > I'm not sure exactly what behaviour you want, but Python accepts > literal strings to be triple-quoted (i.e. del

Re: Python 3K or Python 2.9?

2007-09-12 Thread Ben Finney
TheFlyingDutchman <[EMAIL PROTECTED]> writes: > I am talking about how an author describes in English the "this" > pointer/reference in their book on programming C++ or Java. > > I don't think you will find them saying that under the covers "this" > was passed to the method (if in fact it is). Th

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 3:53 pm, Bjoern Schliessmann wrote: > TheFlyingDutchman wrote: > > In C++ and Java I don't believe "this" is ever referred to as an > > implicit function parameter. > > Oh yes, it is. All methods use it as a base address into instances. > Implicitly though. I am not talking about how t

Re: Coming from Perl

2007-09-12 Thread Ben Finney
Amer Neely <[EMAIL PROTECTED]> writes: > A question I have, if someone here is familiar with Perl, does Python > have something like Perl's 'here document'? I'm not sure exactly what behaviour you want, but Python accepts literal strings to be triple-quoted (i.e. delimited by """ pairs or ''' pai

Re: Search path for python script

2007-09-12 Thread Steve Holden
grt wrote: > I'm new to python, running it under cygwin. This must be easy but I > haven't figured it out. I'm trying to run a script by typing: > > python test.py > > where test.py is in a directory I've added to PYTHONPATH, but test.py > is not found. Perhaps PYTHONPATH only applies to modules

Coming from Perl

2007-09-12 Thread Amer Neely
I'm a complete newbie with Python, but have several years experience with Perl in a web environment. A question I have, if someone here is familiar with Perl, does Python have something like Perl's 'here document'? I've just searched and read some postings on generating HTML but they all seem t

Re: File Parsing Question

2007-09-12 Thread Zentrader
> for line in inp.readlines(): If you are now using readlines() instead of readline(), then a) it is only used once to read all data into a container b) you can access each element/line by it's relative number data=open(filename, "r").readlines() for eachline in data : (not readlines()) so try

Re: Search path for python script

2007-09-12 Thread grt
On Sep 12, 4:06 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > On Sep 12, 4:40 pm, grt <[EMAIL PROTECTED]> wrote: > > > > > I'm trying to run a script by typing: > > > python test.py > > What happens if you just type: > > test.py or test > > and hit Enter? > > rd test gives the error: command

Re: Python Database Apps

2007-09-12 Thread Ed Leafe
On Sep 12, 2007, at 10:53 AM, [EMAIL PROTECTED] wrote: > Thanks for ideas Ed. I am checking out dabo now. I do have a few > questions about it. Packaging. Is it easy to package into a quick > install for windows. The users are going to want to get too in > depth. py2exe is your frien

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Steve Holden
J. Clifford Dyer wrote: > On Wed, Sep 12, 2007 at 07:43:51AM -0700, Charles Fox wrote regarding Re: > newbie: self.member syntax seems /really/ annoying: >> Thanks guys -- yeah these two stategies (short s.varname; and explicit >> rescoping, a=self.a etc) are more or less what I was using. That's

Re: cpython list __str__ method for floats

2007-09-12 Thread John Machin
On Sep 12, 10:59 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:> [snip] > I believe the claim is that using the full 17 digits ensures the round- > tripping works even if you serialise and deserialise on different > systems, so perhaps we all pay a cost in our interactive sessions for > something wh

Re: compiling an extension for several versions of python

2007-09-12 Thread James Stroud
[EMAIL PROTECTED] wrote: > I don't have access to site-packages, but I would like > to provide versions of my c-language package compiled against > python 2.4 and 2.5. > > I "own" a library directory which is included in our site's > sys.path. Currently this is where the 2.4 shared libary > is in

Re: I want py2exe not to create library.zip

2007-09-12 Thread Grant Edwards
On 2007-09-12, Rob Williscroft <[EMAIL PROTECTED]> wrote: > On Wed, 12 Sep 2007 22:09:30 +0200, Laszlo Nagy wrote: > >> Hi, >> >> I want py2exe not to create library.zip. My reason is that the installed >> program will be a self updating program, and it must be able to download >> changes (newer p

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Carl Banks
On Sep 12, 7:23 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Carl Banks <[EMAIL PROTECTED]> wrote: > >... > > > How about this? The decorator could generate a bytecode wrapper that > > would have the following behavior, where __setlocal__ and > > __execute_function__ are special forms that a

Re: I want py2exe not to create library.zip

2007-09-12 Thread Grant Edwards
On 2007-09-12, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > I want py2exe not to create library.zip. setup ( [...] options = {"py2exe": {"skip_archive":1}} ) -- Grant Edwards grante Yow! Am I accompanied by a

Re: struct is saving 4 bytes instead of 2

2007-09-12 Thread TonyB
On Sep 12, 6:45 pm, Bjoern Schliessmann wrote: > TonyB wrote: > > When I inspect the file with a hex editor it show that the > > variable is being saved as 4 bytes. How can I make it save the > > value as 2 bytes? > > Use an aligment specifier in the format string (you want "standard" > alignment

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Alex Martelli
Carl Banks <[EMAIL PROTECTED]> wrote: ... > How about this? The decorator could generate a bytecode wrapper that > would have the following behavior, where __setlocal__ and > __execute_function__ are special forms that are not possible in > Python. (The loops would necessarily be unwrapped in

Re: Search path for python script

2007-09-12 Thread BartlebyScrivener
On Sep 12, 4:40 pm, grt <[EMAIL PROTECTED]> wrote: > > I'm trying to run a script by typing: > > python test.py > What happens if you just type: test.py or test and hit Enter? rd -- http://mail.python.org/mailman/listinfo/python-list

RE: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Ryan Ginstrom
> On Behalf Of madzientist > As a newbie to Python (and OOP), I would love to hear what > people think of Steven's suggestion below. Is there a reason > why classes would be useful for the OP's question ? If you > can point me to a brief online tutorial addressing this, I > would happily go the

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Paul Rubin
Mark Summerfield <[EMAIL PROTECTED]> writes: > I feel that Python lacks one useful data structure: an ordered > dictionary. > Do other Python programmers feel this lack? Is this worth a PEP? Yes. It should use a functional data structure. -- http://mail.python.org/mailman/listinfo/python-list

Re: Error in random module, bad installation?

2007-09-12 Thread Carsten Haese
On Wed, 2007-09-12 at 15:13 -0700, Andrew F wrote: > >>> import random > Unexpected error: > Traceback (most recent call last): > File "", line 1, in > File "random.py", line 10, in > x = random.random() > TypeError: 'module' object is not callable You have a file called random.py in yo

Re: Python 3K or Python 2.9?

2007-09-12 Thread Bjoern Schliessmann
Stefan Behnel wrote: > Bjoern Schliessmann wrote: >> If this was needless, why do C++ and Java have the "this" >> pointer? > > Be careful when you use the word "needless" in the context of > Java. Umm, why? I didn't introduce it. Regards, Björn -- BOFH excuse #8: static buildup -- http:

Re: Python 3K or Python 2.9?

2007-09-12 Thread Bjoern Schliessmann
TheFlyingDutchman wrote: > In C++ and Java I don't believe "this" is ever referred to as an > implicit function parameter. Oh yes, it is. All methods use it as a base address into instances. Implicitly though. > It is a (sometimes necessary) way to reference the object inside > one if it's meth

Re: pythonesque constructs for c++

2007-09-12 Thread Bjoern Schliessmann
Josh wrote: > Does anyone know of analagous c++ libraries? It seems to me that > most of the functionality of these modules could easily be > replicated in c++. Sure, there are many. Apart from the already named, also widget libraries often bring their own tools for this. wxWidgets and Qt do, fo

Re: struct is saving 4 bytes instead of 2

2007-09-12 Thread Bjoern Schliessmann
TonyB wrote: > When I inspect the file with a hex editor it show that the > variable is being saved as 4 bytes. How can I make it save the > value as 2 bytes? Use an aligment specifier in the format string (you want "standard" alignment). See: http://docs.python.org/lib/module-struct.html Rega

Re: Generating HTML

2007-09-12 Thread w . greg . phillips
On Sep 12, 1:16 pm, Evan Klitzke <[EMAIL PROTECTED]> wrote: > Can you compile Mako templates? This is one thing that I really like > about Cheetah, and it wasn't clear to me from the Mako site if this is > possible. First line of the Mako home page: """Mako is a template library written in Python

Re: File Parsing Question

2007-09-12 Thread Shankarjee Krishnamoorthi
I would prefer to use something with seek. I am not able to use seek() with "for line in inp". Use tell and seek does not seem to do anything with the code. When I try to do for line in inp.readlines(): # Top of Loop if not condition in line: do_something else: fo

Error in random module, bad installation?

2007-09-12 Thread Andrew F
I'm a linux user and I just upgraded from 2.1 to 2.5 and changed the location of a number of libraries and tools. So far I've tracked most errors, but this one has me scratching my head : $ which python /usr/local/bin/python $ echo $PYTHONPATH /usr/local/bin/python $ python Python 2.5.1 (r251:548

Re: File Parsing Question

2007-09-12 Thread Zentrader
I'm assuming you know that python has a file.seek(), but you have to know the number of bytes you want to move from the beginning of the file or from the current location. You could save the length of the previous record, and use file seek to backup and then move forward, but it is simpler to save

Re: File Parsing Question

2007-09-12 Thread Zentrader
Save the previous line in a variable if you want the previous line only. for line in inp: # Perform some operations with line if condition something: print prev_line print line break # I need to go back one line and use that line value --> prev_line = line I

Re: Implementing a fixed size stack for an RPN Calculator

2007-09-12 Thread Marc 'BlackJack' Rintsch
On Wed, 12 Sep 2007 20:55:22 +, [EMAIL PROTECTED] wrote: > I have implemented an RPN calculator in python but now I would like to > make the stack size fixed. how can I transform the user's RPN > expression from a stack overflow to a computable expression. > > For instance, if my stack size i

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread madzientist
As a newbie to Python (and OOP), I would love to hear what people think of Steven's suggestion below. Is there a reason why classes would be useful for the OP's question ? If you can point me to a brief online tutorial addressing this, I would happily go there to read it too :) Thanks, Suresh On

Search path for python script

2007-09-12 Thread grt
I'm new to python, running it under cygwin. This must be easy but I haven't figured it out. I'm trying to run a script by typing: python test.py where test.py is in a directory I've added to PYTHONPATH, but test.py is not found. Perhaps PYTHONPATH only applies to modules imported within a script.

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Tuomas
Mark Summerfield wrote: > I feel that Python lacks one useful data structure: an ordered > dictionary. Why it should be a dict. With it you can only maintain the order x1http://mail.python.org/mailman/listinfo/python-list

struct is saving 4 bytes instead of 2

2007-09-12 Thread TonyB
Using UBUNTU python 2.4.3 I'm using struct to save a variable to a file. My goal is to save it as a 2 byte signed integer. Its being saved using: f.write(struct.pack('h',thevariable)) When I inspect the file with a hex editor it show that the variable is being saved as 4 bytes. How can I make

Re: I want py2exe not to create library.zip

2007-09-12 Thread Rob Williscroft
On Wed, 12 Sep 2007 22:09:30 +0200, Laszlo Nagy wrote: > Hi, > > I want py2exe not to create library.zip. My reason is that the installed > program will be a self updating program, and it must be able to download > changes (newer python source files) from the server. So the files should > not be

File Parsing Question

2007-09-12 Thread Shankarjee Krishnamoorthi
Hi, I am new to Python. I am trying to do the following inp = open(my_file,'r') for line in inp: # Perform some operations with line if condition something: # Start re reading for that position again for line in inp: if some other condition

Re: I want py2exe not to create library.zip

2007-09-12 Thread Larry Bates
Laszlo Nagy wrote: > > Hi, > > I want py2exe not to create library.zip. My reason is that the installed > program will be a self updating program, and it must be able to download > changes (newer python source files) from the server. So the files should > not be in library.zip. I tried the --

Implementing a fixed size stack for an RPN Calculator

2007-09-12 Thread [EMAIL PROTECTED]
I have implemented an RPN calculator in python but now I would like to make the stack size fixed. how can I transform the user's RPN expression from a stack overflow to a computable expression. For instance, if my stack size is 2 then the some expression can't be computed but could be transformed

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Carl Banks
On Sep 12, 4:52 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > (The loops would necessarily be unwrapped in the actual > bytecode.) And by unwrapped, I mean unrolled. :E3 Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

compiling an extension for several versions of python

2007-09-12 Thread mh
I don't have access to site-packages, but I would like to provide versions of my c-language package compiled against python 2.4 and 2.5. I "own" a library directory which is included in our site's sys.path. Currently this is where the 2.4 shared libary is installed. What's the most canonical way

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Carl Banks
On Sep 12, 1:05 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Making, say, 'a' hiddenly mean 'x.a', within a function, requires a > decorator that suitably rewrites the function's bytecode... (after > which, it WOULD still be terrible and horrible and not to be used, just > as you say, but it migh

Re: xml question

2007-09-12 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Just curious if there's any python xml parsing tools built into the Mac (OS > 10.4.10 Tiger)? If so, > could anyone > share some simple code (or maybe point me to a web-site) of how to parse xml > data from a > file? For example, if I > had a file that contained

Re: Python Problem

2007-09-12 Thread Wiseman
Marc, Thank you. I followed the instructions in given at pyenchant.sourceforge.net and got the application to work. ((;-)) Meir PS: My challenge now is to port the application to Redhat. I already know that Redhat is missing the pyenchant package - I hope the same installation process will so

Re: pwdmodule.c

2007-09-12 Thread Martin v. Löwis
> Is pwdmodule.c supposed to be excluded for windows compilation? Yes, it is - it gives access to /etc/passwd. See PCbuild/*.vcproj for what files get compiled on Windows. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Free guitars

2007-09-12 Thread nutsbreaker3
Win a free guitar today http://freeguitars.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrpclib and SimpleXMLRPCServer questions

2007-09-12 Thread Jeff McNeil
Duh... you can pass allow_none=True to SimpleXMLRPCServer() On 9/12/07, Jeff McNeil <[EMAIL PROTECTED]> wrote: > Have a look at the XMLRPC specification @ http://www.xmlrpc.com/spec. > There is no representation of NULL/None, thus server refuses to > Marshall the 'None' value. Update your se

Re: xmlrpclib and SimpleXMLRPCServer questions

2007-09-12 Thread Jeff McNeil
Have a look at the XMLRPC specification @ http://www.xmlrpc.com/spec. There is no representation of NULL/None, thus server refuses to Marshall the 'None' value. Update your server methods to return a value other than None and that message will go away. The other option is to set 'allow_none' to T

I want py2exe not to create library.zip

2007-09-12 Thread Laszlo Nagy
Hi, I want py2exe not to create library.zip. My reason is that the installed program will be a self updating program, and it must be able to download changes (newer python source files) from the server. So the files should not be in library.zip. I tried the --bundle option but apparently it

Re: xml question

2007-09-12 Thread xkenneth
There are built in tools for the DOM in Python. Also I'm using OSX to do XML parsing but I'm using the tools available from 4suite. On Sep 12, 2:21 pm, [EMAIL PROTECTED] wrote: > Just curious if there's any python xml parsing tools built into the Mac (OS > 10.4.10 Tiger)? If so, > could anyone >

xmlrpclib and SimpleXMLRPCServer questions

2007-09-12 Thread xkenneth
So i've been trying to set up a simple server and client through XMLRPC in python. Here's my code: SERVER import SimpleXMLRPCServer class DataServer: def __init__(self): pass def test(self,test): self.this = test def show(self): print self.this server = S

Re: pwdmodule.c

2007-09-12 Thread hvendelbo . dev
> > http://mail.python.org/pipermail/python-dev/2007-July/073912.html Thanks. I tried his files against trunk and it didn't work. -- http://mail.python.org/mailman/listinfo/python-list

Re: An ordered dictionary for the Python library?

2007-09-12 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 12 Sep 2007 07:33:45 +, Mark Summerfield wrote: > > > I feel that Python lacks one useful data structure: an ordered > > dictionary. > > > > I find such data structures v. useful in C++. > [snip] > > > Pe

xml question

2007-09-12 Thread JYOUNG79
Just curious if there's any python xml parsing tools built into the Mac (OS 10.4.10 Tiger)? If so, could anyone share some simple code (or maybe point me to a web-site) of how to parse xml data from a file? For example, if I had a file that contained this:

Re: Tkinter pack difficulty

2007-09-12 Thread Russell E. Owen
In article <[EMAIL PROTECTED]>, Simon Forman <[EMAIL PROTECTED]> wrote: > Hi all, > > I realize this is more of a Tk question than a python one, but since > I'm using python and don't know Tcl/Tk I figured I'd ask here first > before bugging the Tcl folks. > > I am having a terrible time trying

Re: Tkinter pack difficulty

2007-09-12 Thread Tony
On Sep 12, 6:22 pm, Simon Forman <[EMAIL PROTECTED]> wrote: > Hi all, > >Snip> Any thoughts or advice? > > Thanks in advance, > ~Simon > This seems to do what you want, the difference is that the expand option is left out top and bottom, also I increased height and put in a width value as well: fr

Re: pwdmodule.c

2007-09-12 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I am trying to compile Python with cmake, but perhaps there are a few > dependencies that have not been corrected for Windows compilation. I don't know the specific answers to your questions, but I wanted to point out, in case you didn't already know, that Alexander Neu

pwdmodule.c

2007-09-12 Thread hvendelbo . dev
I am trying to compile Python with cmake, but perhaps there are a few dependencies that have not been corrected for Windows compilation. Is pwdmodule.c supposed to be excluded for windows compilation? Are the makefiles the place to look to deduct which files are meant for which platforms? Henrik

Re: Get Only the Last Items in a Traceback

2007-09-12 Thread [EMAIL PROTECTED]
On Sep 12, 11:35 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Am Wed, 12 Sep 2007 15:09:02 + schrieb [EMAIL PROTECTED]: > > > > > On Sep 12, 5:17 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > >> Your assessment is wrong. You only get the extra lines in the traceback if > >> you don't immediate

Re: Tkinter pack difficulty

2007-09-12 Thread jim-on-linux
On Wednesday 12 September 2007 13:22, Simon Forman wrote: > Hi all, > > I realize this is more of a Tk question than a python one, but > since I'm using python and don't know Tcl/Tk I figured I'd ask here > first before bugging the Tcl folks. > > I am having a terrible time trying to get a pack() l

Re: customizing a logging logger

2007-09-12 Thread garyjefferson123
On Sep 12, 10:46 am, Vinay Sajip <[EMAIL PROTECTED]> wrote: > On 11 Sep, 17:14, [EMAIL PROTECTED] wrote: > > > What is the best way to do this, so that I don't have to manually put > > the self.ctx in the log string in hundreds of different places? > > Another way is to generate your log messages v

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
> > "this" in C++ and Java is not shown in the parameter list, which was > what he was > complaining about. He wants > > class MyClass: > def SomeFunction(someParameter): >self.someParameter = someParameter > > not > > class MyClass: > def SomeFunction(self, someParame

Re: Python 3K or Python 2.9?

2007-09-12 Thread TheFlyingDutchman
On Sep 12, 4:40 am, Bjoern Schliessmann wrote: > Ivan Voras wrote: > > What does "self" have to do with an object model? It's an > > function/method argument that might as well be hidden in the > > compiler without ever touching the role it has (if not, why?). I > > agree that it's needless noise

  1   2   3   >