Re: Dictionary from a list

2009-08-20 Thread Peter Otten
Jan Kaliszewski wrote: 20-08-2009 o 02:05:57 Jan Kaliszewski z...@chopin.edu.pl wrote: Or probably better: from itertools import islice, izip dict(izip(islice(li, 0, None, 2), islice(li, 1, None, 2))) Or similarly, perhaps more readable: iterator = iter(li)

Re: Dictionary from a list

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 08:10:28 +0200, Peter Otten wrote: I just can't stop posting this one: from itertools import izip it = iter([1,2,3,4,5,6]) dict(izip(it, it)) {1: 2, 3: 4, 5: 6} I really tried, but yours drove me over the edge. If you want something to drive you over the edge:

regular expression

2009-08-20 Thread Pierre
Hello, I would like to change the string (1 and (2 or 3)) by (x[1] (x [2] || x[3])) using regular expression... Anyone can help me ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create functors?

2009-08-20 Thread Rami Chowdhury
As near as I can tell, a functor is just an object which is callable like a function I believe that's how they're defined in the C++ world, in which, of course, functions aren't first-class objects... - Rami Chowdhury Never assume malice when stupidity will suffice. -- Hanlon's

Re: regular expression

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 00:18:23 -0700, Pierre wrote: Hello, I would like to change the string (1 and (2 or 3)) by (x[1] (x [2] || x[3])) using regular expression... Anyone can help me ? Do you mean you want to change the string into (x[1] (x[2] || x[3])) ? Does it have to be using

Re: Dictionary from a list

2009-08-20 Thread Tim Chase
Peter Otten wrote: it = iter([1,2,3,4,5,6]) dict(izip(it, it)) {1: 2, 3: 4, 5: 6} devoZip(it). Zip(it) good./devo it's-3:00am-and-i-seriously-need-to-sleep'ly yers... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionary from a list

2009-08-20 Thread Peter Otten
Steven D'Aprano wrote: On Thu, 20 Aug 2009 08:10:28 +0200, Peter Otten wrote: I just can't stop posting this one: from itertools import izip it = iter([1,2,3,4,5,6]) dict(izip(it, it)) {1: 2, 3: 4, 5: 6} I really tried, but yours drove me over the edge. If you want something to

Re: regular expression

2009-08-20 Thread Peter Otten
Pierre wrote: I would like to change the string (1 and (2 or 3)) by (x[1] (x [2] || x[3])) using regular expression... Anyone can help me ? re.compile(r(\d+)).sub(rx[\1], (1 and (2 or 3))) '(x[1] and (x[2] or x[3]))' re.compile(and|or).sub(lambda m, d={and:, or:||}: d[m.group()], _)

Re: PIL and Python

2009-08-20 Thread catafest
On my photo jpg i have this : Image Type: jpeg (The JPEG image format) Width: 1224 pixels Height: 1632 pixels Camera Brand: Sony Ericsson Camera Model: W810i Date Taken: 2009:07:09 08:16:21 Exposure Time: 1/19 sec. ISO Speed Rating: 320 Flash Fired: Flash did not fire, compulsory flash mode.

Re: How to create functors?

2009-08-20 Thread Paul Rubin
Steven D'Aprano ste...@remove.this.cybersource.com.au writes: As near as I can tell, a functor is just an object which is callable like a function without actually being implemented as a function, e.g.: No it's not anything like that either, at least as I'm used to the term in programming or

Re: How to create functors?

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 01:36:14 -0700, Paul Rubin wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: As near as I can tell, a functor is just an object which is callable like a function without actually being implemented as a function, e.g.: No it's not anything like that

Re: What file is foo in package bar in ?

2009-08-20 Thread Nitebirdz
On Thu, Aug 20, 2009 at 01:06:00AM +0200, Christian Heimes wrote: northof40 wrote: Given an arbitary package is there some programmatic way to 'ask' what file the method/function is implemented in ? Indeed, the inspect module contains several useful functions for the job, for example

Re: difference between 2 arrays

2009-08-20 Thread Michel Claveau - MVP
(envoyé via news:\\news.wanadoo.fr\comp.lang.python) Hi! Yes, the module sets is written, in doc, like deprecated. But: - sets exist in Python 2.6 ( 2.5 or 2.4) - documentation of sets (module) is better tha, documentation of set (builtin) The best: read the documentaion of the module,

Polling a net address

2009-08-20 Thread Iain
Hi All, I'm writing a system tray application for windows, and the app needs to poll a remote site at a pre-defined interval, and then process any data returned. The GUI needs to remain responsive as this goes on, so the polling needs to be done in the background. I've been looking into Twisted

difference between raw_input() and input()

2009-08-20 Thread baalu aanand
Hi, I have used both raw_input() and input() for a same input value. But these gives different output. I have listed below what actually I have done a = raw_input(===) === 023 a '023' I have given the same value

Zipimport leaks memory?

2009-08-20 Thread ashwin.u....@nokia.com
Hi, We are currently trying to identify and fix all the memory leaks by just doing Py_Initialize-PyRun_SimpleFile(some simple script)-Py_Finalize and found that there are around 70 malloc-ed blocks which are not freed. One of the significant contributor to this number is the 'files' object in

Re: difference between raw_input() and input()

2009-08-20 Thread Chris Rebert
On Thu, Aug 20, 2009 at 3:24 AM, baalu aanandbaaluaan...@gmail.com wrote: Hi,     I have used both raw_input() and input() for a same input value. But these gives different output.     I have listed below what actually I have done             a = raw_input(===)                   === 023  

pexpect on QNX platform

2009-08-20 Thread Asha Gowda
Hi, I found that pexpect is available only for linux. But we need to port to QNX, Is pexpect is available? If yes, where can I find it. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: #elements of seq A in seq B

2009-08-20 Thread Neal Becker
Jan Kaliszewski wrote: 20-08-2009 o 01:19:24 Neal Becker ndbeck...@gmail.com wrote: What would be a time efficient way to count the number of occurrences of elements of sequence A in sequence B? (in this particular case, these sequences are strings, if that matters). If you mean: to

Re: PIL and Python

2009-08-20 Thread MaxTheMouse
On Aug 20, 10:23 am, catafest catalinf...@gmail.com wrote: On my photo jpg i have this : Image Type: jpeg (The JPEG image format) Width: 1224 pixels Height: 1632 pixels Camera Brand: Sony Ericsson Camera Model: W810i Date Taken: 2009:07:09 08:16:21 Exposure Time: 1/19 sec. ISO Speed

New Windows Mobile Smartphones from I-mate

2009-08-20 Thread Muhammad Salman
Windows Mobile smart phone device manufacturer, i-mate has shown off its latest models -the Ultimate 9502 and the Ultimate 8502.for other details http://infomobilepk.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Hi everyone, I get a problem when using binhex module

2009-08-20 Thread Yan Jian
Below is what I copy from the Internet: import binhex import sys infile = in.txt binhex.binhex(infile, sys.stdout) Every time I try to run this script, I get a message saying Traceback (most recent call last): File D:\eclipse_workspace\encode\src\binhex.sample.py, line 6, in module

Re: #elements of seq A in seq B

2009-08-20 Thread Peter Otten
Neal Becker wrote: I meant #occurrences of characters from the set A in string B If a contains few characters: n = sum(b.count(c) for c in a) If a contains many characters: identity = .join(map(chr, range(256))) n = len(b) - len(b.translate(identity, a)) Peter --

pypi category

2009-08-20 Thread jelle
Hi, Would someone be able to inform me how a category can be added to the pypy list of categories? I'd like to add a CAD Geometry category. ( I develop PythonOCC, wrappers for the OpenCASCADE CAD kernel, which is why ) Thanks! -jelle -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi everyone, I get a problem when using binhex module

2009-08-20 Thread Xavier Ho
On Thu, Aug 20, 2009 at 10:07 PM, Yan Jian ballack...@gmail.com wrote: Does anyone encounter similar situation. Thank you for your help? Yeah, in Python 3.1 I get this: Traceback (most recent call last): File test.py, line 6, in module binhex.binhex(file, sys.stdout) File

Re: Data visualization in Python

2009-08-20 Thread Aaron Watters
On Aug 17, 3:10 pm, kj no.em...@please.post wrote: I'm looking for a good Python package for visualizing scientific/statistical data.  (FWIW, the OS I'm interested in is Mac OS X). Please take a look at the amcharts embedding in WHIFF http://aaron.oirt.rutgers.edu/myapp/amcharts/doc

Re: IDLE is not as interactive as Maple

2009-08-20 Thread André
On Aug 20, 12:22 am, laser laser.y...@gmail.com wrote: In the future, will Python provide programe enviroment like Maple does? A quick, flip answer: perhaps if you design one? Tools for Python are designed by people scratching an itch. That being said, have a look at reinteract:

Re: IDLE is not as interactive as Maple

2009-08-20 Thread Benjamin Kaplan
On Wed, Aug 19, 2009 at 11:22 PM, laserlaser.y...@gmail.com wrote: In the future, will Python provide programe enviroment like Maple does? In Maple, you can remove anything unneeded in the editor. And the code execution order are not necessary in one direction. You can run any command line on

Python libexpat and EXPAT are same/Different?

2009-08-20 Thread hari
Hi all, Am very new to XML, I have a query, Does Python libexpat and EXPAT are same or they are diffrent? Thanks in advance. Regards, Hari -- http://mail.python.org/mailman/listinfo/python-list

Re: Python libexpat and EXPAT are same/Different?

2009-08-20 Thread Stefan Behnel
hari wrote: Am very new to XML, I have a query, Does Python libexpat and EXPAT are same or they are diffrent? Depends on what you mean with EXPAT. Python's expat module that you can find in the standard library is the well known non-validating XML parser originally written by James Clark.

Re: pypi category

2009-08-20 Thread jelle
The pypi list of categories, sorry... -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE is not as interactive as Maple

2009-08-20 Thread sturlamolden
On 19 Aug, 20:22, laser laser.y...@gmail.com wrote: In the future, will Python provide programe enviroment like Maple does? You might be looking for SAGE. http://www.sagemath.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between raw_input() and input()

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 03:24:15 -0700, baalu aanand wrote: Hi, I have used both raw_input() and input() for a same input value. But these gives different output. I have listed below what actually I have done a = raw_input(===) === 023

Re: Hi everyone, I get a problem when using binhex module

2009-08-20 Thread Dave Angel
Yan Jian wrote: Below is what I copy from the Internet: import binhex import sys infile = in.txt binhex.binhex(infile, sys.stdout) Every time I try to run this script, I get a message saying Traceback (most recent call last): File D:\eclipse_workspace\encode\src\binhex.sample.py, line 6,

Re: Executing untrusted code

2009-08-20 Thread Emanuele D'Arrigo
Sorry for digging this back from the grave. I've had to chew on it for a little while. On Aug 8, 1:40 am, Nobody nob...@nowhere.com wrote: If you want to support restricted execution within a language, it has to be built into the language from day one. Trying to bolt it on later is a fool's

Re: Executing untrusted code

2009-08-20 Thread Christian Heimes
Emanuele D'Arrigo write: In what ways would the untrusted string be able to obtain the original, built-in open function and open a file for writing? Yes, if you know some tricks: [cls for cls in object.__subclasses__() if cls.__name__ == 'file'][0] type 'file' Christian --

Re: Executing untrusted code

2009-08-20 Thread Rami Chowdhury
They could, of course, use the file object constructor directly, e.g.: f = file(/etc/passwd, w) On Thu, 20 Aug 2009 08:16:51 -0700, Emanuele D'Arrigo man...@gmail.com wrote: Sorry for digging this back from the grave. I've had to chew on it for a little while. On Aug 8, 1:40 am,

ncurses getch unicode (was: decoding keyboard input when using curses)

2009-08-20 Thread Iñigo Serna
Hello, I have the same problem mentioned in http://groups.google.com/group/comp.lang.python/browse_thread/thread/c70c80cd9bc7bac6?pli=1some months ago. Python 2.6 program which uses ncurses module in a terminal configured to use UTF-8 encoding. When trying to get input from keyboard, a

Re: Dictionary from a list

2009-08-20 Thread iu2
On Aug 20, 9:10 am, Peter Otten __pete...@web.de wrote: Jan Kaliszewski wrote: 20-08-2009 o 02:05:57 Jan Kaliszewski z...@chopin.edu.pl wrote: Or probably better:      from itertools import islice, izip      dict(izip(islice(li, 0, None, 2), islice(li, 1, None, 2))) Or similarly,

Silly question

2009-08-20 Thread David C Ullrich
I just noticed that sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced in 2.x I'm just slow...) -- http://mail.python.org/mailman/listinfo/python-list

Re: Silly question

2009-08-20 Thread Benjamin Kaplan
On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrichdullr...@sprynet.com wrote: I just noticed that  sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced in 2.x I'm just slow...) Well,

Re: Executing untrusted code

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 08:16:51 -0700, Emanuele D'Arrigo wrote: Fair enough. In this context, let's say I do this: import __builtin__ import imp originalBuiltins = imp.new_module(OriginalBuiltins) def readOnlyOpen(filename): return originalBuiltins.open(filename, r) __builtin__.open

Re: Silly question

2009-08-20 Thread Duncan Booth
David C Ullrich dullr...@sprynet.com wrote: I just noticed that sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced in 2.x I'm just slow...) Googling for 'python extended

Re: Executing untrusted code

2009-08-20 Thread Steven D'Aprano
On Thu, 20 Aug 2009 08:16:51 -0700, Emanuele D'Arrigo wrote: In what ways would the untrusted string be able to obtain the original, built-in open function and open a file for writing? On a related topic, you should read this post here:

Annoying octal notation

2009-08-20 Thread David
Hi all, Is there some magic to make the 2.x CPython interpreter to ignore the annoying octal notation? I'd really like 012 to be 12 and not 10. If I want an octal I'll use oct()! Explicit is better than implicit... TIA David -- http://mail.python.org/mailman/listinfo/python-list

ANN: Wing IDE 3.2 released

2009-08-20 Thread Wingware
Hi, Wingware has released version 3.2.0 final of Wing IDE, our integrated development environment for the Python programming language. *Release Highlights* This release includes the following new features: * Support for Python 3.0 and 3.1 * Rewritten version control integration with support

thread and win32com.client problem

2009-08-20 Thread Ray
Hi, I have a problem with thread and win32com.client running python 2.5 on vista (activestate python) import win32com.client, thread def child(test): problem=win32com.client.Dispatch(WScript.Shell) print 'hello from thread', test def parent(): i=0 while 1:

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 18:41:34 +, Duncan Booth wrote: David C Ullrich dullr...@sprynet.com wrote: I just noticed that sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid - otoh if it was introduced

Re: Silly question

2009-08-20 Thread David C Ullrich
On Thu, 20 Aug 2009 14:36:35 -0400, Benjamin Kaplan wrote: On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrichdullr...@sprynet.com wrote: I just noticed that  sequence[i:j:k] syntax in a post here. When did this happen? (I'm just curious whether it existed in 1.5.x or not. If so I'm stupid

Re: thread and win32com.client problem

2009-08-20 Thread Ray
I already find the way to fix it. :-) -- http://mail.python.org/mailman/listinfo/python-list

ANN: discover 0.3.0 released, automatic test discovery for unittest

2009-08-20 Thread Fuzzyman
The discover module is a backport of the automatic test discovery from the unittest module in Python-trunk (what will become Python 2.7 and 3.2). The discover module should work on versions of Python 2.4 upwards: * discover module on PyPI: http://pypi.python.org/pypi/discover The discover

Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
I have a list of nodes, and I need to find a path from one node to another. The nodes each have a list of nodes they are connected to, set up like this: class Node(object): def __init__(self, connectedNodes): self.connectedNodes = connectedNodes nodes = { 1:

Re: Annoying octal notation

2009-08-20 Thread Johannes Bauer
David schrieb: If I want an octal I'll use oct()! Explicit is better than implicit... A leading 0 *is* explicit. Implicit would be when some functions would interpret a 0 prefix as octal and others wouldn't. Regards, Johannes -- Meine Gegenklage gegen dich lautet dann auf bewusste

Re: thread and win32com.client problem

2009-08-20 Thread Christian Heimes
Ray wrote: I already find the way to fix it. :-) I consider it good style when people describe their solution to a problem, too. Other Python users may run into the same issue someday. :) Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-20 Thread Simon Forman
On Aug 20, 3:06 pm, David 71da...@libero.it wrote: Hi all, Is there some magic to make the 2.x CPython interpreter to ignore the annoying octal notation? No. You would have to modify and recompile the interpreter. This is not exactly trivial, see How to Change Python's Grammar

[no subject]

2009-08-20 Thread artur lukowicz
6344a24de14243c76060bedd42f79bc302679dad -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with arrays in a recursive class function

2009-08-20 Thread Aaron Scott
Never mind -- ditched the attempt and implemented Dijkstra. -- http://mail.python.org/mailman/listinfo/python-list

incrementing string/hex value from file and write back

2009-08-20 Thread Matthias Güntert
Hello guys I would like to read a hex number from an ASCII file, increment it and write it back. How can this be performed? I have tried several approaches: my file serial.txt contains: 0C -- f = open('serial.txt', 'r') val = f.read() val = val.encode('hex')

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Rami Chowdhury
val = val.encode('hex') That's the crucial line -- it's returning a new integer, which you are re-binding to val. If you then did: val = val + 1 you'd be fine, and could then write val back to your file :-) On Thu, 20 Aug 2009 14:08:34 -0700, Matthias Güntert matzeguent...@gmx.de

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Mark Lawrence
Matthias Güntert wrote: Hello guys I would like to read a hex number from an ASCII file, increment it and write it back. How can this be performed? I have tried several approaches: my file serial.txt contains: 0C -- f = open('serial.txt', 'r') val =

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Simon Forman
On Aug 20, 5:08 pm, Matthias Güntert matzeguent...@gmx.de wrote: Hello guys I would like to read a hex number from an ASCII file, increment it and write it back. How can this be performed? I have tried several approaches: my file serial.txt contains: 0C

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Simon Forman
On Aug 20, 5:18 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: val = val.encode('hex') That's the crucial line -- it's returning a new integer, which you are   re-binding to val. If you then did: No, it returns another string, which still isn't the decimal representation of the hex

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Ethan Furman
[fixed top-posting] Rami Chowdhury wrote: On Thu, 20 Aug 2009 14:08:34 -0700, Matthias Güntert matzeguent...@gmx.de wrote: Hello guys I would like to read a hex number from an ASCII file, increment it and write it back. How can this be performed? I have tried several approaches: my file

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Rami Chowdhury
Of course - my apologies, I was being an idiot. On Thu, 20 Aug 2009 14:38:08 -0700, Simon Forman sajmik...@gmail.com wrote: On Aug 20, 5:18 pm, Rami Chowdhury rami.chowdh...@gmail.com wrote: val = val.encode('hex') That's the crucial line -- it's returning a new integer, which you are  

Re: Executing untrusted code

2009-08-20 Thread Emanuele D'Arrigo
Christian, Rami and Steven, thank you all for your help. It wasn't meant to be a challenge, I knew it ought to be easily breakable. I'm no hacker and it just helps to have some examples to better understand the issue. On Aug 20, 7:42 pm, Steven D'Aprano st...@remove- On a related topic, you

Re: ncurses getch unicode (was: decoding keyboard input when using curses)

2009-08-20 Thread Iñigo Serna
Hi again, 2009/8/20 Iñigo Serna inigose...@gmail.com I have the same problem mentioned in http://groups.google.com/group/comp.lang.python/browse_thread/thread/c70c80cd9bc7bac6?pli=1 some months ago. Python 2.6 program which uses ncurses module in a terminal configured to use UTF-8

Re: Annoying octal notation

2009-08-20 Thread Mensanator
On Aug 20, 2:06 pm, David 71da...@libero.it wrote: Hi all, Is there some magic to make the 2.x CPython interpreter to ignore the annoying octal notation? I'd really like 012 to be 12 and not 10. Use 3.1: int('012') 12 (Just kidding! That works in 2.5 also. How are you using it where it's

Re: incrementing string/hex value from file and write back

2009-08-20 Thread Dave Angel
Matthias Güntert wrote: Hello guys I would like to read a hex number from an ASCII file, increment it and write it back. How can this be performed? I have tried several approaches: my file serial.txt contains: 0C -- f = open('serial.txt', 'r') val =

Re: thread and win32com.client problem

2009-08-20 Thread Martin P. Hellwig
Christian Heimes wrote: Ray wrote: I already find the way to fix it. :-) I consider it good style when people describe their solution to a problem, too. Other Python users may run into the same issue someday. :) Christian He probably used: pythoncom.CoInitialize() -- MPH

Re: platform-specific overrides of functions and class methods (expanding on imputils demo code)

2009-08-20 Thread Aahz
In article 77715735-2668-43e7-95da-c91d175b3...@z31g2000yqd.googlegroups.com, lkcl luke.leigh...@googlemail.com wrote: if somebody would like to add this to the python bugtracker, as a contribution, that would be great. alternatively, you might like to have a word with the python developers to

Re: install package in a particular python version

2009-08-20 Thread Benjamin Kaplan
whoops, sent it to you instead of the list On Thu, Aug 20, 2009 at 9:05 PM, Benjamin Kaplanbenjamin.kap...@case.edu wrote: On Thu, Aug 20, 2009 at 8:57 PM, Steve1234sflen...@comcast.net wrote: I installed the boto module in my Ubuntu system using python setup.py install and it installs in my

Re: install package in a particular python version

2009-08-20 Thread David Lyon
On Thu, 20 Aug 2009 17:57:53 -0700 (PDT), Steve1234 sflen...@comcast.net wrote: I installed the boto module in my Ubuntu system using python setup.py install and it installs in my python2.6 version and works great. Now I want to install boto into my python2.5 version because my hosting

Re: #elements of seq A in seq B

2009-08-20 Thread Jan Kaliszewski
a = set(a) n = sum(item in a for item in b) Why set? Does it matter if I say that items in A are already unique? Sets are hash-based, so it's (most probably) far more efficient for sets than for sequences (especially if we say about big/long ones). Regards, *j -- Jan Kaliszewski

Re: How to create functors?

2009-08-20 Thread Charles Yeomans
On Aug 20, 2009, at 5:25 AM, Steven D'Aprano wrote: On Thu, 20 Aug 2009 01:36:14 -0700, Paul Rubin wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: As near as I can tell, a functor is just an object which is callable like a function without actually being implemented as

Re: IDLE is not as interactive as Maple

2009-08-20 Thread laser
Thanks very much for your information. Reinteract looks like exactly what I want. It give me the similary feeling of using Maple. I like this kind of programming style. People who did not have this experience really should take a try. On 8月20日, 下午9时11分, André andre.robe...@gmail.com wrote: On

Re: install package in a particular python version

2009-08-20 Thread Steve1234
Benjamin suggested: sudo python2.5 setup.py install and it works. This makes sense, thanks. I downloaded pythonpkgmgr from source and installed it. I got the error that reguired wx package was missing. I couldn't find this package for Linux or source. --

2.6 windows install

2009-08-20 Thread Tim Arnold
Hi, I installed python2.6 to a netapp device. I can use it from my local windows machine (XP). But others cannot use it from their pcs. They get this response The system cannot execute the specified program.. If they double click on python.exe, they get a window with: This application has

Waiting for a subprocess to exit

2009-08-20 Thread Ben Finney
Howdy all, I'm looking to replace some usages of ‘os.system’ with the more secure ‘subprocess.Popen’ methods. The module documentation has a section on replacing ‘os.system’ http://docs.python.org/library/subprocess#replacing-os-system, which says to use:: process = subprocess.Popen(mycmd +

Re: 2.6 windows install

2009-08-20 Thread alex23
Tim Arnold tim.arn...@sas.com wrote: Any ideas on what I'm missing here? Most likely the required configuration of the local environments. Did you install Python to the network device from your XP box? That would explain why you can run it: the required registry settings environment variables

Re: install package in a particular python version

2009-08-20 Thread Ben Finney
Steve1234 sflen...@comcast.net writes: I installed the boto module in my Ubuntu system using python setup.py install and it installs in my python2.6 version and works great. That's because your ‘python’ command is doing the same thing as if you'd typed:: $ python2.6 setup.py install The

[issue6444] multiline exception logging via syslog handler

2009-08-20 Thread Simon Litchfield
Simon Litchfield si...@s29.com.au added the comment: From the manual for logging.handlers.SysLogHandler -- emit(record) The record is formatted, and then sent to the syslog server. If exception information is present, it is not sent to the server. Ideal, for me, would be to have each traceback

[issue6738] Wrong doc strings in itertools

2009-08-20 Thread Hagen Fürstenau
New submission from Hagen Fürstenau hfuerste...@gmx.net: The doc strings of itertools.combinations and itertools.combinations_with_replacement are wrong: The parameter r is not optional here (like it is for itertools.permutations). Attached trivial patch. -- components: Library (Lib)

[issue6739] IDLE window won't start or show up after assgining new key in options v2.5.2 and 3.1.1

2009-08-20 Thread CaribbeanCruise
New submission from CaribbeanCruise caribbeancruise...@gmail.com: I tried to assign a new key(lctrl+lshift instead of lctrl+F5) for run- mode in option in v.2.5.2. I tried the new key and it didn't work. And then I got lots of messages. So I killed the IDLE and the rest of python. And run IDLE

[issue6641] strptime doesn't support %z format ?

2009-08-20 Thread Andrew Brown
Andrew Brown abr...@freemail.gr added the comment: I think this bug is just a doc bug. If you check http://docs.python.org/library/datetime.html?highlight=strptime#strftime-behavior and http://docs.python.org/library/time.html?highlight=strptime#time.strptime You can see that the first

[issue6444] multiline exception logging via syslog handler

2009-08-20 Thread Max Arnold
Max Arnold lwa...@gmail.com added the comment: Sorry for long delay, I was on vacation. I have installed sysklogd, metalog and syslog-ng on a virtual machine and executed test script. First two daemons log exception as single concatenated line. Syslog-ng splits it as described in original

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread Eric
Eric surprisin...@gmail.com added the comment: I checked the latest documentation for 3.1.1 (http://docs.python.org/3.1/library/imaplib.html), but I can't find any reference to needing to encode information myself for the login procedure. Is there some other documentation you are referring to?

[issue6740] Compounded expressions with lambda functions are evaluated incorrectly

2009-08-20 Thread Michal Vyskocil
New submission from Michal Vyskocil mvysko...@suse.cz: The compounded expressions with lambda functions are evaluated incorrectly. The simple expressions, or a named functions are evaluated good. The problem is only in the evaluation of compounded expressions. It seems that after evaluate of the

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I can't find any reference to needing to encode information myself for the login procedure. Is there some other documentation you are referring to? Exactly, the Python imaplib documentation should be fixed (the doc, not the

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread Marcin Bachry
Marcin Bachry hegel...@gmail.com added the comment: It seems most IMAP4 methods accept str as arguments right now (I checked: list, lsub, myrights, select, status, search, fetch) and login() is a sole exception. I know the protocol is mostly ascii only, but still having possibility of using str

[issue1294959] Problems with /usr/lib64 builds.

2009-08-20 Thread Matthias Klose
Matthias Klose d...@debian.org added the comment: both patches assume that everybody uses lib64 for 64bit libs, which is not true for Debian/Ubuntu. Even the FHS doesn't mandate the use of lib64. -- nosy: +doko ___ Python tracker

[issue6722] collections.namedtuple: confusing example

2009-08-20 Thread Alexey Shamrin
Alexey Shamrin sham...@gmail.com added the comment: Raymond, sorry if I wasn't clear. I'm fine with the API (haven't used it yet though, because I was stuck after skimming through its documentation). I suggest to make *first* example simple (without verbose=True) and to move an example with

[issue6722] collections.namedtuple: confusing example

2009-08-20 Thread Alexey Shamrin
Alexey Shamrin sham...@gmail.com added the comment: Roundup broke formatting... I've attached a text file with the proposed example. -- Added file: http://bugs.python.org/file14747/namedtuple_doc_example.txt ___ Python tracker rep...@bugs.python.org

[issue6741] Garbage collector release method

2009-08-20 Thread Lev
New submission from Lev lgards...@gmail.com: WinCRT debug detects several memory leaks after calling py_Initialize (); py_Finalize(); functions. Most of them are garbage collector visible python's objects. I suggest to create release method in garbage collector which will distruct all objects

[issue6742] Embedding python into shared library crash on AIX

2009-08-20 Thread damahay123
New submission from damahay123 hong@algorithmics.com: Hi there, I'm trying to embedding my python code into a .so on AIX and load it with my main application. Since there is no libpython2.6.so available on AIX, I have to link my .so with libpython2.6.a. I have to make some twist to make it

[issue6743] pprint.pprint should support no objects to print blank lines allow args

2009-08-20 Thread Mary Stern
New submission from Mary Stern maryst...@yahoo.com: Using print in python 3 I would like to simple replace print with pprint.pprint. However pprint cannot be called with no arguments, so this cannot currently be done (the error is TypeError: pprint() takes at least 1 positional argument (0

[issue6734] Imap lib implicit conversion from bytes to string

2009-08-20 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: It seems most IMAP4 methods accept str as arguments right now (I checked: list, lsub, myrights, select, status, search, fetch) and login() is a sole exception. I know the protocol is mostly ascii only, but still having

[issue6743] pprint.pprint should support no objects to print blank lines allow args

2009-08-20 Thread Mary Stern
Mary Stern maryst...@yahoo.com added the comment: Sorry: you also need to print out the args! :) .. like this: def pprint(object='\n', *args, stream=None, indent=1, width=80, depth=None): Pretty-print a Python object to a stream [default is sys.stdout]. printer = PrettyPrinter(

[issue1424148] urllib.FancyURLopener.redirect_internal looses data on POST!

2009-08-20 Thread Senthil
Senthil orsent...@gmail.com added the comment: I agree with John on this ticket. At the outset, this is Not a bug. And reading through the referenced ticket indicates the design decision for the behavior. In summary: quote This suggests to me that *no* automatic repeat of POST requests should

[issue6711] macurl2path has typos that raise AttributeError

2009-08-20 Thread Senthil
Changes by Senthil orsent...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6711 ___ ___ Python-bugs-list

[issue2637] urllib.quote() escapes characters unnecessarily and contrary to docs

2009-08-20 Thread Senthil
Senthil orsent...@gmail.com added the comment: I see adding this information to the docs, might clarify a bit. By default, this function is intended for quoting the path section of the URL. This is already present in the function docstring. If there is no objection, I shall commit the

  1   2   >