Re: Python vs. Perl

2004-12-13 Thread Nick Craig-Wood
Keith Dart <[EMAIL PROTECTED]> wrote: > Oh, I forgot to mention that it also has a more user- and > programmer-friendly ExitStatus object that processess can return. This > is directly testable in Python: > > proc = proctools.spawn("somecommand") > exitstatus = proc.wait() > > if exitstat

ANN: Python Test Environment

2004-12-13 Thread Fuzzyman
Well sort of... More a request for comments really - to see if anyone is interested in this. http://www.voidspace.org.uk/atlantibots/pythonutils.html#testenv I've created a script that will build a 'test environment'. Windoze(tm) only as it uses py2exe. It scans your Python\Lib folder and b

Re: Python mascot proposal

2004-12-13 Thread Fredrik Lundh
> Anybody know what a larch looks like? from quite far away? random google link: http://www.neuroinformatik.ruhr-uni-bochum.de/PEOPLE/bolder/montypython/larch1.html -- http://mail.python.org/mailman/listinfo/python-list

How can i send 8-bit data or binary data with pyserial?

2004-12-13 Thread ouz as
i have an electronic module which only understand binary data. i use python pyserial. for example the module starts when 00100 8-bit binary data sent.but pyserial sent only string data. Can i send this binary data with pyserial or another way with python. Thanks,

Re: thread/queue bug

2004-12-13 Thread Antoon Pardon
Op 2004-12-13, Tim Peters schreef <[EMAIL PROTECTED]>: > [Antoon Pardon] >> I don't see why starting a thread as a side effect of importing is >> bad thread practice. Sure python doesn't cater for it, but IMO >> that seems to be python failing. > > Obviously, it's bad practice in Python because it

Re: Performance (pystone) of python 2.4 lower then python 2.3 ???

2004-12-13 Thread Lucas Hofman
Mark Asbach wrote: Hi Lucas, On a dual Xeon 3.0 Ghz: [...] Which shows a decrease in performance. Could this have anything to do with the fact that is is a dual processor box? Maybe. But my 3Gh P4/HT is also detected as a dual processor machine (Kernel 2.6), so it might be a general problem wit

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-13 Thread Nick Coghlan
Fredrik Lundh wrote: my suggestion was to make sure that the user can type "bar arg" to start a Python program called "bar" with the argument "arg". that's trivial, on all major platforms, despite what Nick says -- and yes, you can start threads from a program named "bar". try it. The command lin

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Pierre Barbier de Reuille
Christian Ergh a écrit : Hmm, i never liked the i++ syntax, because there is a value asignment behind it and it does not show - except the case you are already used to it. >>> i = 1 >>> i +=1 >>> i 2 I like this one better, because you see the assignment at once, it is easy to read and inuit

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Richard Brodie
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > You could propose to the author of Pychecker that he include, if possible, > an option to check for and warn about '++', '--'. It does already. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-13 Thread Fredrik Lundh
Just wrote: > This subthread was specifically about your > > python -c "import foo.bar" arg > > suggestion. in my original post, I said I'd say that for a typical user, "A" is a marginal improvement over "B", compared to "C". which, I thought, tried to say that for a user expecting "C

Re: [dictionary] how to get key by item

2004-12-13 Thread Nick Coghlan
Ola Natvig wrote: If some keys has the same value as the item this will cause problems because keys in your result dictionary can be overwritten. Could it be a option to build the result dictionary as a dictionary with the values as the keys, and lists of keys as the value. Perhaps you need to

Re: while 1 vs while True

2004-12-13 Thread Nick Coghlan
Paul Rubin wrote: "Raymond Hettinger" <[EMAIL PROTECTED]> writes: It is unlike to before Py3.0. Making them constants would break the reams of compatability code: True, False = (1==1), (1!=1). I don't see why that particular statement needs to fail. The interpreter could permit assigning True=Tr

Re: gather information from various files efficiently

2004-12-13 Thread Keith Dart
Kent Johnson wrote: Keith Dart wrote: try: dict[a].append(b) except KeyError: dict[a] = [b] or my favorite Python shortcut: dict.setdefault(a, []).append(b) Kent Hey, when did THAT get in there? ;-) That's nice. However, the try..except block is a useful pattern for many similiar situ

Re: PEP 338: Executing modules inside packages with '-m'

2004-12-13 Thread Nick Coghlan
Fredrik Lundh wrote: in my original post, I said I'd say that for a typical user, "A" is a marginal improvement over "B", compared to "C". which, I thought, tried to say that for a user expecting "C", neither "A" nor "B" is good enough. Ah, OK - that makes a lot more sense than the way I r

Re: How can i send 8-bit data or binary data with pyserial?

2004-12-13 Thread Diez B. Roggisch
> i have an electronic module which only understand binary data. > i use python pyserial. > for example the module starts when 00100 8-bit binary data sent.but > pyserial sent only string data. > Can i send this binary data with pyserial or another way with python. Strings _are_ binary data.

Re: jython and concatenation of strings

2004-12-13 Thread Jan Gregor
Ok, thanks. I didn't think that += operator is nondestructive operation - but strings are immutable so this makes sense. On 2004-12-13, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> I found that price of += operator on string is too high in jython. For >> example 5000 such operations took 90 se

Re: gather information from various files efficiently

2004-12-13 Thread Fredrik Lundh
Keith Dart wrote: >>> try: >>> dict[a].append(b) >>> except KeyError: >>> dict[a] = [b] the drawback here is that exceptions are relatively expensive; if the number of collisions are small, you end up throwing and catching lots of exceptions. in that case, there are better ways to do thi

Looking for a coder to do some work

2004-12-13 Thread Allan Irvine
HI > > Hope this is the right place for this, I am new. I have a spec to create > a (dual screen) framework application that > > 1 displays mp3, flash, jpegs etc. on top screen > 2: displays buttons on bottom screen which alter image when a key is > pressed. > > The hardware is a dell pc basically,

Re: lies about OOP

2004-12-13 Thread [EMAIL PROTECTED]
Hello, Instead of copy and paste, I use functions for code reuse. I didn't see the light of OOP, yet. I use Python but never did anything with OOP. I just can't see what can be done with OOP taht can't be done with standart procedural programing. -- http://mail.python.org/mailman/listinfo/pytho

Re: RegEx: find all occurances of a single character in a string

2004-12-13 Thread Franz Steinhaeusler
On Tue, 14 Dec 2004 14:05:38 +0100, Franz Steinhaeusler <[EMAIL PROTECTED]> wrote: sorry >r=re.compile('[^a]a([^a]') r=re.compile('[^a]a[^a]') I meant. -- Franz Steinhaeusler -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess vs. proctools

2004-12-13 Thread Keith Dart
Nick Craig-Wood wrote: Keith Dart <[EMAIL PROTECTED]> wrote: Oh, I forgot to mention that it also has a more user- and programmer-friendly ExitStatus object that processess can return. This is directly testable in Python: proc = proctools.spawn("somecommand") exitstatus = proc.wait() if exitstat

Re: Why are tuples immutable?

2004-12-13 Thread Fredrik Lundh
Gerrit <[EMAIL PROTECTED]> wrote: > Apart from historical, compatibility reasons, why is > >"foo %s bar %s" % [2, 4] > > illegal? > > I could imagine that anything accepting numerical values for __getitem__ > (foo[0], foo[1], ...) or that is iterable (foo.next(), foo.next()) could > be sensibl

compiling ming on win32/python 2.3

2004-12-13 Thread Jelle Feringa // EZCT / Paris
I wonder whether anyone on this list has been able to compile the ming .swf output library successfully on win32/python2.3? I have quite some trouble trying to compile these kind of libraries, maybe you could point me to a good starters tutorial on this?   Cheers,   Jelle. -- ht

Re: thread/queue bug

2004-12-13 Thread Steve Holden
Antoon Pardon wrote: Op 2004-12-13, Tim Peters schreef <[EMAIL PROTECTED]>: [Antoon Pardon] I don't see why starting a thread as a side effect of importing is bad thread practice. Sure python doesn't cater for it, but IMO that seems to be python failing. Obviously, it's bad practice in Python becau

Re: RegEx: find all occurances of a single character in a string

2004-12-13 Thread Franz Steinhaeusler
On Tue, 14 Dec 2004 14:19:35 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >Franz Steinhaeusler wrote: >> given a string: >> >> st="abcdatraataza" >>^ ^ ^ ^ (these should be found) >> I want to get the positions of all single 'a' characters. > >for m in re.finditer("a+", st): >if

Re: gather information from various files efficiently

2004-12-13 Thread Richie Hindle
[Keith] > Sigh, this reminds me of a discussion I had at my work once... It seems > to write optimal Python code one must understand various probabilites of > your data, and code according to the likely scenario. 8-) s/Python //g -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/

Re: while 1 vs while True

2004-12-13 Thread Fredrik Lundh
Steve Holden wrote: > It was unfortunate that so many people chose to use that for compatibility, > when if they'd used > the same code that the win32all extensions did they could have retained > backward compatibility > even across a change to constants: > > try: > True > except Attribute

Re: Looking for a coder to do some work

2004-12-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Allan Irvine <[EMAIL PROTECTED]> wrote: >HI >> >> Hope this is the right place for this, I am new. I have a spec to >create >> a (dual screen) framework application that >> >> 1 displays mp3, flash, jpegs etc. on top screen >> 2: displays buttons on bottom screen whi

Re: while 1 vs while True

2004-12-13 Thread Peter Otten
Fredrik Lundh wrote: > Steve Holden wrote: > >> It was unfortunate that so many people chose to use that for >> compatibility, when if they'd used the same code that the win32all >> extensions did they could have retained backward compatibility even >> across a change to constants: >> >> try: >>

Re: while 1 vs while True

2004-12-13 Thread Steve Holden
Raymond Hettinger wrote: Dan Bishop wrote: Out of pure curiousity, Why wasn't 'While True' optimized also? Probably has something to do with "True" and "False" not being constants. [Nick Coghlan] Yup. Even 'None' only just became a constant in 2.4. I don't know if 'True' and 'False' are in line f

Re: Looking for a coder to do some work

2004-12-13 Thread Diez B. Roggisch
Have you seen freevo? -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Re: gather information from various files efficiently

2004-12-13 Thread Keith Dart
Fredrik Lundh wrote: ... if dct.has_key(a): dct[a].append(b) else: dct[a] = [b] the drawback here is that if the number of collisions are high, you end up doing lots of extra dictionary lookups. in that case, there are better ways to do this. Sigh, this reminds me of a discussion I had at m

Re: do you master list comprehensions?

2004-12-13 Thread Will Stuyvesant
Okay that was fun. Enlightening as I hoped. unroll() in Python, for arbitrary depth, _flatten in Tkinter (what else is in Tkinter!), sum() abuse. The sum(data,[]) was funniest, it works like ((['foo','bar'] + []) + ['my','your']) + ['holy','grail']. Before I think of such things I have already

Re: lies about OOP

2004-12-13 Thread Stefan Seefeld
Craig Ringer wrote: On Tue, 2004-12-14 at 16:02, Mike Thompson wrote: I would pick the publication of "Design Patterns" in 1995 by the Gang of Four (Gamma, Helm, Johnson, and Vlissides), to be the herald of when "the Joy of OOP" would be "widely known." DP formalized a taxonomy for many of the h

RegEx: find all occurances of a single character in a string

2004-12-13 Thread Franz Steinhaeusler
given a string: st="abcdatraataza" ^ ^ ^ ^ (these should be found) I want to get the positions of all single 'a' characters. (Without another 'a' neighbour) So I tried: r=re.compile('[^a]a([^a]') but this applies only for the a's, which has neighbours. So I need also '^a' and 'a$'.

Re: [dictionary] how to get key by item

2004-12-13 Thread Skip Montanaro
Fredrik> Skip Montanaro wrote: >> That doubles your storage Fredrik> careful: it creates another dictionary structure with the same Fredrik> size as the first one, but it doesn't copy the objects in the Fredrik> dictionary. Yes, sorry. The OP indicated the original dictionar

Re: Regexp problem, which pattern to use in split

2004-12-13 Thread Fredrik Lundh
Hans Almåsbakk wrote: > These lines are in a csv file exported from excel. > Any pointer will be greatly appreciated. Maybe I'm attacking this problem > the wrong way already from the start? (Not that I can see another way > myself :) >>> import csv http://online.effbot.org/2003_08_01_archive.h

Re: Regexp problem, which pattern to use in split

2004-12-13 Thread Matthias Huening
Hans Almåsbakk (14.12.2004 16:02): Any pointer will be greatly appreciated. Maybe I'm attacking this problem the wrong way already from the start? (Not that I can see another way myself :) Hans, did you try the csv module in the Python library? Matthias -- http://mail.python.org/mailman/listinfo/py

Re: RegEx: find all occurances of a single character in a string

2004-12-13 Thread Fredrik Lundh
Franz Steinhaeusler wrote: > given a string: > > st="abcdatraataza" >^ ^ ^ ^ (these should be found) > I want to get the positions of all single 'a' characters. for m in re.finditer("a+", st): if len(m.group()) == 1: print m.start() or, perhaps: indexes = [m.start() for m i

Re: Looking for a coder to do some work

2004-12-13 Thread John Hunter
> "Cameron" == Cameron Laird <[EMAIL PROTECTED]> writes: Cameron> I don't understand the last sentence; in particular, Cameron> "fort hsi" is beyond my power to decode unambiguously. "for this", clearly JDH -- http://mail.python.org/mailman/listinfo/python-list

Re: need some help quickly

2004-12-13 Thread Thomas Guettler
Am Tue, 14 Dec 2004 04:46:24 -0800 schrieb Allan Irvine: > HI > > Hope this is the right place for this, I am new. I have a spec to > create > a (dual screen) framework application that > > 1 displays mp3, flash, jpegs etc. on top screen > 2: displays buttons on bottom screen which alter image w

Re: Regexp problem, which pattern to use in split

2004-12-13 Thread Hans Almåsbakk
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > >>> import csv > > http://online.effbot.org/2003_08_01_archive.htm#librarybook-csv-module > This seems be just the thing I need. Now ofcourse, another problem arouse: The csv module is new in Python 2.3. hans:~# python -V Python 2.1.3 Is there a

Help need with converting Hex string to IEEE format float

2004-12-13 Thread i_vincent
Hi all, Newbie Python programmer here, so please be patient. I have spent all day googling for an answer to my problem, but everything I try fails to work (or works from the Interpreter with a set value but not from my code with dynamic values). Okay, here is the general gist of the problem. I am

Re: gather information from various files efficiently

2004-12-13 Thread Peter Hansen
Keith Dart wrote: Sigh, this reminds me of a discussion I had at my work once... It seems to write optimal Python code one must understand various probabilites of your data, and code according to the likely scenario. And this is different from optimizing in *any* other language in what way? -Pet

Re: PyQt on MAC OS X

2004-12-13 Thread Michael McGarry
whamoo wrote: Michael McGarry <[EMAIL PROTECTED]> wrote: thanks that did the trick!!! One problem is my Window created in Qt appears underneath all others on the screen and focus never goes completely onto this window. Kind of weird. Any ideas? You must use pythonw for graphics application =) So

Re: Help need with converting Hex string to IEEE format float

2004-12-13 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > Newbie Python programmer here, so please be patient. I have spent all > day googling for an answer to my problem, but everything I try fails to > work (or works from the Interpreter with a set value but not from my > code with dynamic values). > > Okay, here is the gen

Re: lies about OOP

2004-12-13 Thread Steve Holden
Paul McGuire wrote: "Jive" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] But by '86, the Joy of OOP was widely known. "Widely known"? Errr? In 1986, "object-oriented" programming was barely marketing-speak. Computing hardware in the mid-80's just wasn't up to the task of dealing

Re: Tibia 0.1 DOM-based website editor

2004-12-13 Thread Richie Hindle
[Robert] > Tibia is an in-browser editor for web pages. It allows you to quickly > and easily modify the content of your web pages. It allows you to > directly view, edit, and save files on your webserver. Very impressive! I ran into a couple of difficulties but otherwise it's a great tool. I h

Re: PIL for Windows for Python 2.4

2004-12-13 Thread Fuzzyman
Steve Holden wrote: > Fuzzyman wrote: > > > If you're determined enough there are instructions here : > > http://www.vrplumber.com/programming/mstoolkit/ > > > > These will get you the Visual Studio 7 tools (free releases of) and > > tell you how to configure distutils to use it. > > > > Hefty dow

Re: Skinnable/Stylable windows in wxPython?

2004-12-13 Thread Roel Schroeven
Daniel Bickett wrote: Solution found! Not only would this make it more multi-platform (I have no access to a GTK machine so I don't know if this works. Could someone please check?) Looks like it works (I had to change frame.Show() to frame.Show(1) though, but that could be because it's an old vers

Re: character encoding conversion

2004-12-13 Thread Max M
Christian Ergh wrote: A smiple way to try out different encodings in a given order: # -*- coding: latin-1 -*- def get_encoded(st, encodings): "Returns an encoding that doesn't fail" for encoding in encodings: try: st_encoded = st.decode(encoding) return st_en

Re: Qt String Question

2004-12-13 Thread Phil Thompson
> Michael McGarry wrote: >> Hi, >> >> How do I convert from a qt.QString to a Python string? >> >> Michael > Apparently the ascii() method of QString does this. (I answered my own > question). Or use the str() builtin. Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: what module can do html encoder??

2004-12-13 Thread Gerrit
richard wrote: > Leon wrote: > > example: > > s = ' ' --->   > > That's technically not HTML encoding, that's replacing a perfectly valid > space character with a *non-breaking* space character. How can you tell? s = 'Â' # non-breaking space s = ' ' # normal space s = 'á' # em-space But

re: usage of __import__ across two files

2004-12-13 Thread Diez B. Roggisch
> tb = __import__('BMTest2') This yields the _module_ BMTest2 in the variable tb. Now in that module there is a class BMToolbar that defines PrintHello - so this should work: tb.BMToolBar(self).PrintHello() It worked with your commented lines because you did from BMTest2 import BMToolba

Re: Why are tuples immutable?

2004-12-13 Thread Nick Coghlan
jfj wrote: Enlighten me. .>>> x = () .>>> y = () .>>> x is y True .>>> x = [] .>>> y = [] .>>> x is y False .>>> x = range(10) .>>> y = tuple(x) # Makes a copy .>>> z = tuple(y) # No need to make a copy .>>> x is y False .>>> y is z True Immutable objects can use optimisation tricks that mutabl

Re: uptime for Win XP?

2004-12-13 Thread Richie Hindle
[Esmail] > Is there a way to display how long a Win XP system has been up? > Somewhat analogous to the *nix uptime command. [Greg] >>> import win32api >>> print "Uptime:", win32api.GetTickCount(), "Milliseconds" Note that in the unlikely event of your Windows machine being up for longer than 2^3

Re: Qt String Question

2004-12-13 Thread Pierre Barbier de Reuille
Michael McGarry wrote: Michael McGarry wrote: Hi, How do I convert from a qt.QString to a Python string? Michael Apparently the ascii() method of QString does this. (I answered my own question). sorry for wasting newsgroup space. Depending on the kind of string you have, latin1() may be a better

Automate Python-2.4 Installs on Windows

2004-12-13 Thread Brad Tilley
Windows users may find this of interest: http://filebox.vt.edu/users/rtilley/downloads/automatic_python_install.html -- http://mail.python.org/mailman/listinfo/python-list

predict directory write permission under windows?

2004-12-13 Thread Qiangning Hong
I want to know if I can write files into a directory before I actually perferm the write behavor. I found os.access(path, os.W_OK) but it uses real uid/gid to check instead of euid/egid so it doesn't fit my problem. I don't know how to get euid/egid under windows so I cannot use the mode infom

Re: Another RegEx Question...

2004-12-13 Thread Roel Schroeven
[EMAIL PROTECTED] wrote: Hello NG, I'm quite new to Python and I don't know if this is a FAQ (I can't find it) or an obvious question. I'm using the RE module in python, and I would like to be able to contruct something like the Window$ "Find Files Or Folders" engine. As the Window$ users kno

A problem with list

2004-12-13 Thread export
The following code ## import string MyList=['abc','def'] for i in MyList: print i ### works as I expect that is I get abc def but when I have Mylist in a file and I read it from the file it does not work as I expect. # import string ff=open('C:\\Robotp\\MyFile.txt'

Re: uptime for Win XP?

2004-12-13 Thread Peter Hansen
Richie Hindle wrote: [Greg] import win32api print "Uptime:", win32api.GetTickCount(), "Milliseconds" Note that in the unlikely event of your Windows machine being up for longer than 2^32 ms (about 49 days), GetTickCount() will wrap back to zero. The real solution, in spite of the dozen alternatives

jython and concatenation of strings

2004-12-13 Thread Jan Gregor
Hello I found that price of += operator on string is too high in jython. For example 5000 such operations took 90 seconds (i generated html copy of table with 1000 rows and 5 columns). Generation of row data into separate string and joining after lead to time 13 seconds !!! What's alternati

Re: can't find python2.4 source code

2004-12-13 Thread Fredrik Lundh
Donnie Leen wrote: >I had tried already, the doesn't contain the sourcecode. > In python2.3.3, the release pakage contained sourcecode is Python-2.3.3.tar. the 2.3.3 sources (http://www.python.org/2.3.3/) are shipped as Python-2.3.3.tgz and Python-2.3.3.tar.bz2. the 2.4 sources (http://www.python

Read a gzip file from inside a tar file

2004-12-13 Thread rohisingh
I have a tar file. The content of the file are as following. [EMAIL PROTECTED] 12-08-04 $ tar tvf 20041208.tar drwxr-xr-x root/root 0 2004-12-08 21:39:19 20041208/ -rw-r--r-- root/root 1576 2004-12-08 21:39:19 20041208/README drwxr-xr-x root/root 0 2004-12-08 21:27:31 20041208

Re: PIL for Windows for Python 2.4

2004-12-13 Thread Fuzzyman
Yep - when it finally works it's nice to see distutils do it's stuff ! Regards, Fuzzy http://www.voidspace.org.uk/atlantibots/pythonutils.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Petr Prikryl
Hi Christian, The suggestion is to mark PREFIX version ++i as syntax error. It is not related to the postfix version of the ++ operator. For prefix in/decrement, there is no extra variable behind. But again, it is not related to the suggestion. The postfix version is already marked as "syntax err

Re: A problem with list

2004-12-13 Thread Fuzzyman
An alternative is reading the list into a string and using my 'listquote' module. It will tun strings into lists (and vice versa) - including nested lists (lists of lists) and properly handling quoted elements. http://www.voidspace.org.uk/atlantibots/pythonutils.html It won't do integer conversio

Re: Compiling PIL for Python 2.4

2004-12-13 Thread Fredrik Lundh
Stefan Behnel wrote: > Sorry, can't help you on the rest (which seems to be rather MS and compiler > specific) no, it's Python 2.4 specific. this is a python newsgroup. > In short, submitting a cross-post reads as: you haven't actually thought > about your problem but want to bug as many peopl

Re: newbie questions

2004-12-13 Thread Steve Holden
houbahop wrote: thanks, very usefull answer. Immutable types (e.g. strings, numbers, tuples) are generally returned directly from functions, rather than returned as 'output parameters'. The ability to return multiple values easily (via "return a, b, c" & "x, y, z = myfunc()" generally eliminate

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Christian Ergh
Ah, ok, i misunderstood you. Well, to mark it as a syntax error sounds good, and at the Moment I would not know a case where this conflicts with a implementation. Chris Petr Prikryl wrote: Hi Christian, The suggestion is to mark PREFIX version ++i as syntax error. It is not related to the postfix

Re: A problem with list

2004-12-13 Thread Jeff Shannon
gawel wrote: [EMAIL PROTECTED] wrote: but when I have Mylist in a file and I read it from the file it does not work as I expect. That's quite simple. Your file contain a string, not a list You must use eval(your_list_as_string). ...except that eval() is a huge security hole. A better bet would b

Re: Suggestion for "syntax error": ++i, --i

2004-12-13 Thread Steven Bethard
Petr Prikryl wrote: Summary: In my opinion, the C-like prefix increment and decrement operators (++i and --i) should be marked as "syntax error". This would give some weird assymetry: >>> i = 1 >>> ++i Traceback ( File "", line 1 ++i ^ SyntaxError: invalid syntax >>> --i Traceback ( Fil

make uninstall?

2004-12-13 Thread Christopher J. Bottaro
I installed Python-2.3.4 from source... configure && make && make install Now I want to remove it, but make uninstall doesn't work. How do I uninstall it? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance (pystone) of python 2.4 lower then python 2.3 ???

2004-12-13 Thread Peter Hansen
Lucas Hofman wrote: [EMAIL PROTECTED] test]$ /usr/local/bin/python2.4 pystone.py Pystone(1.1) time for 5 passes = 1.31 This machine benchmarks at 38167.9 pystones/second A 7% speed DECREASE??? According to the documentation it should be a 5% increase? The machine is a 3.0 GHz Xeon box. Both py

Re: UrlLib2 Proxy and Https

2004-12-13 Thread Jacobo belbo
Thanks ;-) Jacobo "Sandeep" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Check out the following link. It helped me achieve the same thing > (access a HTTPS site via a proxy). > > http://groups.yahoo.com/group/linux-bangalore-programming/message/4208 > Cheers, > Sandeep > http://sa

Re: jython and concatenation of strings

2004-12-13 Thread Diez B. Roggisch
> I found that price of += operator on string is too high in jython. For > example 5000 such operations took 90 seconds (i generated html copy of > table with 1000 rows and 5 columns). Generation of row data into separate > string and joining after lead to time 13 seconds !!! Its generally not

Re: uptime for Win XP?

2004-12-13 Thread Fredrik Lundh
Andrey Ivanov wrote: > Writting this script was harder than I initially thought due to > a lack of documentation for win32all. And I still don't know what > that bizzare_int value stands for (an error/status code?). if I'm not mistaken, the corresponding Win32 function is called PdhGetFormattedCo

Re: uptime for Win XP?

2004-12-13 Thread Peter Hansen
Tim Golden wrote: To add my twopence-ha'penny worth in, the recommended WMI technique is (apparently) to use the Win32_OperatingSystem.LastBootUpTime value: import wmi [snip code] Tim forgot to blow his own horn, so I will: http://tgolden.sc.sabren.com/python/wmi.html ;-) -Peter -- http://mail.p

Re: subprocess.Popen

2004-12-13 Thread P
Michele Simionato wrote: I was looking at Python 2.4 subprocess.Popen. Quite nice and handy, but I wonder why a "kill" method is missing. I am just adding it via subclassing, class Popen(subprocess.Popen): def kill(self, signal = SIGTERM): os.kill(self.pid, signal) but I would prefer to

Re: how do I "peek" into the next line?

2004-12-13 Thread Skip Montanaro
les> suppose I am reading lines from a file or stdin. I want to just les> "peek" in to the next line, and if it starts with a special les> character I want to break out of a for loop, other wise I want to les> do readline(). Create a wrapper around the file object: class Pee

Re: Python mascot proposal

2004-12-13 Thread James Stroud
As far as python.png below is concerned, I am reminded of the structure of the HIV virus: http://www.avert.org/pictures/hivstructure.htm Pleasing to virologists and drug companies, but as a single, computer-type guy, it makes my skin crawl in more ways than one. On Sunday 12 December 2004 07:4

Re: make uninstall?

2004-12-13 Thread Fredrik Lundh
Christopher J. Bottaro wrote: > So Python installs one file and two dirs (containing files/dirs). If I > delete all three of those, it will delete all installed modules as well, > right? I mean, when I installed cx_Oracle, it only installed files in > $PYTHONDIR/lib/python2.3 and $PYTHONDIR/incl

Re: how do I "peek" into the next line?

2004-12-13 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi, > suppose I am reading lines from a file or stdin. > I want to just "peek" in to the next line, and if it starts > with a special character I want to break out of a for loop, > other wise I want to do readline(). > > Is there a way to do this? > for example: > while

Re: uptime for Win XP?

2004-12-13 Thread David Bolen
Andrey Ivanov <[EMAIL PROTECTED]> writes: (...) > Writting this script was harder than I initially thought due to > a lack of documentation for win32all. And I still don't know what > that bizzare_int value stands for (an error/status code?). The pywin32 documentation tends not to duplicate infor

Re: New versions breaking extensions, etc.

2004-12-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Nick Coghlan <[EMAIL PROTECTED]> wrote: >Jive wrote: >> Can someone explain to me why Python 2.4 on MS Windows has these backward >> compatibility problems? What am I missing? > >The problem is the Python C/API. At the moment, it exposes things >directly (like >da

Re: how do I "peek" into the next line?

2004-12-13 Thread les_ander
OK, I am sorry , I did not explain my problem completely. I can easily break from the loop when I see the character in a line that I just read; however my problem involves putting back the line I just read since if I have seen this special character, I have read one line too many. Let me illustrate

Re: how do I "peek" into the next line?

2004-12-13 Thread Fredrik Lundh
<[EMAIL PROTECTED]> wrote: > now suppose I have read the first line already. > then I read the second line and notice > that there is a ">" in front (my special character) > then I want the put back the second line into the > file or the stdin. the line doesn't disappear from the file just becaus

Re: New versions breaking extensions, etc.

2004-12-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jive <[EMAIL PROTECTED]> wrote: . . . >Doesn't Microsoft have an answer for that? There are (at last count) nine >skillion ActiveX >components in the wild. Surely Microsoft didn't blast them in

Re: Reading raw data from disc

2004-12-13 Thread Grant Edwards
On 2004-12-13, Ivo Woltring <[EMAIL PROTECTED]> wrote: > Is it possible to read e.g. the first 3 sectors of a disc > without opening a file or somesuch? Under Linux, no. You have to open the device. > I want to bitwise read a cd-rom or other media without > consulting a table of contents. Jus

Re: Automate Python-2.4 Installs on Windows

2004-12-13 Thread Fredrik Lundh
Martin v. Löwis wrote: > I personally recommend > > http://www.python.org/2.4/msi.html > > to learn about automatic installation. which might be great if you know how things work, but is bloody confusing if you don't. most importantly, how do you set properties? a couple of larger examples woul

Re: Path problem

2004-12-13 Thread Lars Yencken
On 13/12/2004, at 6:39 PM, Binu K S wrote: sys.path[0] will contain the path to the script. From the sys module documentation: "As initialized upon program startup, the first item of this list, path[0], is the directory containing the script that was used to invoke the Python interpreter. If the sc

Re: do you master list comprehensions?

2004-12-13 Thread Fredrik Lundh
Max M wrote: >> I tried funnies like [[w for w in L] for L in data], >> that is correct syntax, but you'd never guess. > > That is absolutely correct. It's not a funnie at all. If you find it odd it's > only because you are > not used to list comprehensiones. well, syntactically correct or not,

Re: PyQt on MAC OS X

2004-12-13 Thread glenn andreas
In article <[EMAIL PROTECTED]>, Michael McGarry <[EMAIL PROTECTED]> wrote: > One problem is my Window created in Qt appears underneath all others on > the screen and focus never goes completely onto this window. Kind of weird. > > Any ideas? > If the application is not properly bundled you wi

Re: Python mascot proposal

2004-12-13 Thread Jive
P.s. I never could stand Beanie and Cecil. -- http://mail.python.org/mailman/listinfo/python-list

Re: Organising data within a program

2004-12-13 Thread James Stroud
Python is an object oriented (OO) language. The very best thing if you have a lot of time is to learn the language fully, read several books on database design, and implement a gui driven app, OO from top to bottom. If you need to get something to work before you have time to become a pythonolo

[dictionary] how to get key by item

2004-12-13 Thread Egor Bolonev
saluton al ciuj i know how to get item by key == dict = {10 : 50, 2 : 12, 4 : 43} print dict[2] 12 but i wonder how to get key by item print dict[12] 2 == is there a more fast way than that one (my dictionary is really big) == dict = {10 : 50, 2 : 12,

Re: ANN: IPython 0.6.5 is out.

2004-12-13 Thread Fernando Perez
Fernando Perez wrote: > I'm glad to announce the release of IPython 0.6.6. IPython's homepage is at: Sorry, the _title_ was incorrect. 0.6.6 is indeed a new release put out today, I just copied an old title and missed the change. Regards, f -- http://mail.python.org/mailman/listinfo/python-

lies about OOP

2004-12-13 Thread projecktzero
I know this might not be the correct group to post this, but I thought I'd start here. A co-worker considers himself "old school" in that he hasn't seen the light of OOP.(It might be because he's in love with Perl...but that's another story.) He thinks that OOP has more overhead and is slower than

Re: New versions breaking extensions, etc.

2004-12-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jive <[EMAIL PROTECTED]> wrote: . . . >Bit by bit, I am remembering now just how stupifyingly brain-dead the MS DLL >scheme is. . .

<    1   2   3   4   >