Wing IDE 3.2 released

2009-08-21 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

Object Reference question

2009-08-21 Thread josef
To begin, I'm new with python. I've read a few discussions about object references and I think I understand them. To be clear, Python uses a Pass By Object Reference model. x = 1 x becomes the object reference, while an object is created with the type 'int', value 1, and identifier (id(x)). Doing

Re: Waiting for a subprocess to exit

2009-08-21 Thread Miles Kaufmann
On Aug 20, 2009, at 10:13 PM, Ben Finney wrote: 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 + myarg, shell=True) status = os.waitpid(process.pid, 0)

Re: Object Reference question

2009-08-21 Thread Miles Kaufmann
On Aug 20, 2009, at 11:07 PM, josef wrote: To begin, I'm new with python. I've read a few discussions about object references and I think I understand them. To be clear, Python uses a Pass By Object Reference model. x = 1 x becomes the object reference, while an object is created with the type

Re: Object Reference question

2009-08-21 Thread Chris Rebert
On Thu, Aug 20, 2009 at 11:34 PM, Miles Kaufmannmile...@umich.edu wrote: On Aug 20, 2009, at 11:07 PM, josef wrote: snip The following is what I would like to do: I have a list of class instances dk = [ a, b, c, d ], where a, b, c, d is an object reference. Entering dk gives me the object:

Re: #elements of seq A in seq B

2009-08-21 Thread Raymond Hettinger
On Aug 19, 4:19 pm, 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). Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12)

Re: #elements of seq A in seq B

2009-08-21 Thread Raymond Hettinger
On Aug 19, 4:19 pm, 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). Python 3.1.1 (r311:74483, Aug 17 2009, 17:02:12)

Re: Object Reference question

2009-08-21 Thread Hendrik van Rooyen
On Friday 21 August 2009 08:07:18 josef wrote: My main focus of this post is: How do I find and use object reference memory locations? a = [1,2,3,4] id(a) 8347088 - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Object Reference question

2009-08-21 Thread josef
On Aug 21, 1:34 am, Miles Kaufmann mile...@umich.edu wrote: On Aug 20, 2009, at 11:07 PM, josef wrote: To begin, I'm new with python. I've read a few discussions about object references and I think I understand them. To be clear, Python uses a Pass By Object Reference model. x = 1 x

Re: #elements of seq A in seq B

2009-08-21 Thread Peter Otten
Jan Kaliszewski wrote: 20-08-2009 o 13:01:29 Neal Becker ndbeck...@gmail.com wrote: I meant #occurrences of characters from the set A in string B But: 1) separately for each element of A? (see Simon's sollution with defaultdict) 2) or total number of all occurrences of elements of

Re: Object Reference question

2009-08-21 Thread Dave Angel
josef wrote: To begin, I'm new with python. I've read a few discussions about object references and I think I understand them. To be clear, Python uses a Pass By Object Reference model. x = 1 x becomes the object reference, while an object is created with the type 'int', value 1, and identifier

Re: PIL and Python

2009-08-21 Thread catafest
I don't extract data from jpegs. I wanna put some data in this (copyright of my site) ... On Aug 20, 2:01 pm, MaxTheMouse maxthemo...@googlemail.com wrote: 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)

Re: Object Reference question

2009-08-21 Thread Bruno Desthuilliers
josef a écrit : To begin, I'm new with python. I've read a few discussions about object references and I think I understand them. To be clear, Python uses a Pass By Object Reference model. x = 1 x becomes the object reference, while an object is created with the type 'int', value 1, and

Re: difference between 2 arrays

2009-08-21 Thread Gabriel Genellina
En Thu, 20 Aug 2009 06:54:05 -0300, Michel Claveau - MVPenleverLesX_XXmcX@xmclavxeaux.com escribió: 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)

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

2009-08-21 Thread Thomas Dickey
On Aug 20, 6:12 pm, Iñigo Serna inigose...@gmail.com wrote: Hi again, 2009/8/20 Iñigo Serna inigose...@gmail.com I have the same problem mentioned inhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/...some months ago. Python 2.6 program which usesncursesmodule in

Re: Waiting for a subprocess to exit

2009-08-21 Thread Ben Finney
Miles Kaufmann mile...@umich.edu writes: On Aug 20, 2009, at 10:13 PM, Ben Finney wrote: Why would I use ‘os.waitpid’ instead of:: process = subprocess.Popen(mycmd + myarg, shell=True) process.wait() status = process.returncode Really, you can just use: process =

Re: Problem with arrays in a recursive class function

2009-08-21 Thread Bruno Desthuilliers
Aaron Scott a écrit : 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

Sanitising arguments to shell commands (was: Waiting for a subprocess to exit)

2009-08-21 Thread Ben Finney
Miles Kaufmann mile...@umich.edu writes: I would recommend avoiding shell=True whenever possible. It's used in the examples, I suspect, to ease the transition from the functions being replaced, but all it takes is for a filename or some other input to unexpectedly contain whitespace or a

Re: Sanitising arguments to shell commands (was: Waiting for a subprocess to exit)

2009-08-21 Thread Chris Rebert
On Fri, Aug 21, 2009 at 2:08 AM, Ben Finneyben+pyt...@benfinney.id.au wrote: snip How can I take a string that is intended to be part of a command line, representing multiple arguments and the shell's own escape characters as in the above example, and end up with a sane command argument list

Re: Sanitising arguments to shell commands

2009-08-21 Thread Jean-Michel Pichavant
Ben Finney wrote: Miles Kaufmann mile...@umich.edu writes: I would recommend avoiding shell=True whenever possible. It's used in the examples, I suspect, to ease the transition from the functions being replaced, but all it takes is for a filename or some other input to unexpectedly contain

Re: Object Reference question

2009-08-21 Thread Ben Finney
josef jos...@gmail.com writes: To be clear, Python uses a Pass By Object Reference model. Yes. (I'm glad this concept has propagated to newcomers so well :-) x = 1 x becomes the object reference It becomes *a* reference to that object, independent of any other references to that same

Re: Sanitising arguments to shell commands

2009-08-21 Thread Ben Finney
Jean-Michel Pichavant jeanmic...@sequans.com writes: Can someone explain the difference with the shell argument ? giving for instance an example of what True will do that False won't. The ‘shell’ argument to the ‘subprocess.Popen’ constructor specifies whether the command-line should be

Re: Sanitising arguments to shell commands

2009-08-21 Thread Ben Finney
Chris Rebert c...@rebertia.com writes: module shlex — Simple lexical analysis New in version 1.5.2. The shlex class makes it easy to write lexical analyzers for simple syntaxes resembling that of the Unix shell. Exactly what I needed: import shlex user_configured_args = --baz 'crunch

Re: Zipimport leaks memory?

2009-08-21 Thread Gabriel Genellina
En Thu, 20 Aug 2009 07:02:26 -0300, ashwin.u@nokia.com ashwin.u@nokia.com escribió: 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

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

2009-08-21 Thread Iñigo Serna
2009/8/21 Thomas Dickey dic...@his.com: On Aug 20, 6:12 pm, Iñigo Serna inigose...@gmail.com wrote:     c = win.getch() You're using getch, not get_wch (Python's ncurses binding may/may not have the latter). curses getch returns 8-bit values, get_wch would return wider values. you are

Re: Sanitising arguments to shell commands

2009-08-21 Thread Jean-Michel Pichavant
Ben Finney wrote: Jean-Michel Pichavant jeanmic...@sequans.com writes: Can someone explain the difference with the shell argument ? giving for instance an example of what True will do that False won't. The ‘shell’ argument to the ‘subprocess.Popen’ constructor specifies whether the

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread alex23
On Aug 21, 11:36 pm, Jonathan Fine jf...@pytex.org wrote: It might seem odd to use 'apply' as a decorator, but it can make sense. Yes, it's an idiom I've used myself for property declarations, but one I find myself using less often: class ColourThing(object): @apply def rgb():

Re: Object Reference question

2009-08-21 Thread josef
On Aug 21, 4:26 am, Ben Finney ben+pyt...@benfinney.id.au wrote: josef jos...@gmail.com writes: To be clear, Python uses a Pass By Object Reference model. Yes. (I'm glad this concept has propagated to newcomers so well :-) I found one really good discussion on python semantics versus other

Problem with winreg - The object is not a PyHKEY object

2009-08-21 Thread Jamie
My goal is to remotely remove the registry keys for McAfee. I don't know how winreg handles an exception if a key doesn't exist, but I setup my script to skip the exception. But it doesn't seem to work right.. I think the script should be self explanitory, please help! Please forgive me, but I'm a

Re: Annoying octal notation

2009-08-21 Thread David
Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto: David schrieb: If I want an octal I'll use oct()! Explicit is better than implicit... A leading 0 *is* explicit. It isn't explicit enough, at least IMO. regards David --

Re: Annoying octal notation

2009-08-21 Thread David
Il Thu, 20 Aug 2009 15:18:35 -0700 (PDT), Mensanator ha scritto: (Just kidding! That works in 2.5 also. How are you using it where it's coming out wrong? I can see you pulling '012' out of a text file and want to calculate with it, but how would you use a string without using int()? Passing

Re: Annoying octal notation

2009-08-21 Thread MRAB
David wrote: Il Thu, 20 Aug 2009 22:24:24 +0200, Johannes Bauer ha scritto: David schrieb: If I want an octal I'll use oct()! Explicit is better than implicit... A leading 0 *is* explicit. It isn't explicit enough, at least IMO. Is this better? Python 3.1 (r31:73574, Jun 26 2009,

Re: PIL and Python

2009-08-21 Thread Michele Petrazzo
catafest wrote: I don't extract data from jpegs. I wanna put some data in this (copyright of my site) ... My wrap for freeimage, called freeimagepy :) can't, as now, wrote exif information on the image, but since freeimage can do it, I think that it's not so difficult to add this type of

Re: Problem with winreg - The object is not a PyHKEY object

2009-08-21 Thread Stephen Hansen
On Fri, Aug 21, 2009 at 9:33 AM, Jamie jamie.iva...@gmail.com wrote: My goal is to remotely remove the registry keys for McAfee. I don't know how winreg handles an exception if a key doesn't exist, but I setup my script to skip the exception. But it doesn't seem to work right.. I think the

TypeError while checking for permissions with os.access() on windows xp

2009-08-21 Thread ryniek90
I've got some code that checks priviliges on two paths: First - chosen by user Second - hardcoded home directory represented by **os.getenv('HOME')** - (os.getenv('HOME') works both on Linux and Windows) Here's the code: def __check_set_perm(self, rd_obj_path, backup_dest): try:

Re: Python and PHP encryption/decryption

2009-08-21 Thread Piet van Oostrum
Diez B. Roggisch de...@nospam.web.de (DBR) wrote: DBR Jean-Claude Neveu schrieb: I'm looking for a recommendation about encryption/decryption packages for Python. I'm working on a project that will require me to store some values in a database in encrypted format. I'll be storing them from

Re: TypeError while checking for permissions with os.access() on windows xp

2009-08-21 Thread Simon Forman
On Aug 21, 1:33 pm, ryniek90 rynie...@gmail.com wrote: I've got some code that checks priviliges on two paths: First - chosen by user Second - hardcoded home directory represented by **os.getenv('HOME')** - (os.getenv('HOME') works both on Linux and Windows) Here's the code: def

Re: convert date time

2009-08-21 Thread D'Arcy J.M. Cain
On Fri, 21 Aug 2009 14:14:32 -0400 Ronn Ross ronn.r...@gmail.com wrote: I want to split it into two fields one with the date formatted like this: -MM-DD 2009-08-02 and the time to be 24 hour or military time. How every you call it. Similar to this: 15:22:00 I found it easy to

Re: Mac OS 9.2

2009-08-21 Thread Tommy Nordgren
On Aug 18, 2009, at 6:04 PM, madzientist wrote: hi, i have to work with mac OS 9.2 for legacy reasons...is there a compiled version of python for this os ? i need to get input about variable values from the user and then print out some text files that make use of this input. a gui would be

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 17:45:11 -0700, John Machin wrote: On Aug 21, 5:33 am, David C Ullrich dullr...@sprynet.com wrote: So I'm slow, fine. (There were several times when I was using 1.5.3 and wished they were there - transposing matrices, etc.) 1.5.THREE ?? Not sure. 1.SOMETHING. Sorry

Re: convert date time

2009-08-21 Thread Ronn Ross
On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain da...@druid.net wrote: On Fri, 21 Aug 2009 14:14:32 -0400 Ronn Ross ronn.r...@gmail.com wrote: I want to split it into two fields one with the date formatted like this: -MM-DD 2009-08-02 and the time to be 24 hour or military time.

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread Jonathan Fine
alex23 wrote: Unfortunately, apply() has been removed as a built-in in 3.x. I'm not sure if it has been relocated to a module somewhere, there's no mention of such in the docs. The old use of apply() You can save yourself the tidy up by using the same name for the function the label:

Re: convert date time

2009-08-21 Thread D'Arcy J.M. Cain
On Fri, 21 Aug 2009 14:43:55 -0400 Ronn Ross ronn.r...@gmail.com wrote: On Fri, Aug 21, 2009 at 2:26 PM, D'Arcy J.M. Cain da...@druid.net wrote: You don't say what database you are using but you may find it simpler to do the conversion in your SELECT statement. For example, see

Re: Silly question

2009-08-21 Thread David C Ullrich
On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: In article mailman.143.1250793404.2854.python-l...@python.org, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrichdullr...@sprynet.com wrot= e: I just noticed that sequence[i:j:k] Well, I got some

Re: Annoying octal notation

2009-08-21 Thread Derek Martin
John Nagle wrote: Yes, and making lead zeros an error as suggested in PEP 3127 is a good idea. It will be interesting to see what bugs that flushes out. James Harris wrote: It maybe made sense once but this relic of the past should have been consigned to the waste bin of history long ago.

Re: Silly question

2009-08-21 Thread David C Ullrich
On Fri, 21 Aug 2009 14:40:30 -0500, David C Ullrich wrote: On Thu, 20 Aug 2009 16:51:00 -0700, Aahz wrote: In article mailman.143.1250793404.2854.python-l...@python.org, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Thu, Aug 20, 2009 at 2:13 PM, David C Ullrichdullr...@sprynet.com

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

2009-08-21 Thread Thomas Dickey
On Fri, 21 Aug 2009, Iñigo Serna wrote: 2009/8/21 Thomas Dickey dic...@his.com: On Aug 20, 6:12 pm, Iñigo Serna inigose...@gmail.com wrote:     c = win.getch() You're using getch, not get_wch (Python's ncurses binding may/may not have the latter). curses getch returns 8-bit values,

Re: zlib interface semi-broken

2009-08-21 Thread Travis
I've come up with a good test for issue5210 and uploaded it to the bug tracker. This patch should be ready for inclusion now. -- Obama Nation | My emails do not have attachments; it's a digital signature that your mail program doesn't understand. | http://www.subspacefield.org/~travis/ If you

Re: proposal: add setresuid() system call to python

2009-08-21 Thread travis
On Fri, Jul 17, 2009 at 04:59:53PM -0400, Jean-Paul Calderone wrote: On Fri, 17 Jul 2009 15:01:41 -0500, travis+ml-pyt...@subspacefield.org wrote: I am suggesting that the setresuid function be added to python, perhaps in the OS module, because it has the clearest semantics for manipulating

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Simon Forman sajmikins at gmail.com writes: No. You would have to modify and recompile the interpreter. This is not exactly trivial, see How to Change Python's Grammar http://www.python.org/dev/peps/pep-0306/ And even that's incorrect. You'd have to modify the tokenizer. --

Re: 2.6 windows install

2009-08-21 Thread Matimus
On Aug 20, 10:21 am, Tim Arnold tim.arn...@sas.com wrote: 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

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Derek Martin code at pizzashack.org writes: More than flushing out bugs, it will *cause* them in ubiquity, requiring likely terabytes of code to be poured over and fixed. 2to3, however, can fix it for you extreme easily. -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying octal notation

2009-08-21 Thread Derek Martin
On Fri, Aug 21, 2009 at 08:25:45PM +, Benjamin Peterson wrote: More than flushing out bugs, it will *cause* them in ubiquity, requiring likely terabytes of code to be poured over and fixed. 2to3, however, can fix it for you extreme easily. Sure, but that won't stop people who've been

Re: Annoying octal notation

2009-08-21 Thread Piet van Oostrum
Derek Martin c...@pizzashack.org (DM) wrote: DM I fail to see how 0O012, or even 0o012 is more intelligible than 012. DM The latter reads like a typo, and the former is virtually DM indistinguishable from 00012, O0012, or many other combinations that DM someone might accidentally type (or

Re: 2.6 windows install

2009-08-21 Thread Martin v. Löwis
The default windows install puts Python26.dll in \windows\system32. I haven't tried this, but you could probably fix your install by moving Python26.dll into the Python26 directory. Only the admin installation should do that (for all users). The just for me installation won't. Regards, Martin

Re: proposal: add setresuid() system call to python

2009-08-21 Thread travis+ml-python
On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid): return _setresuid(__uid_t(ruid), __uid_t(euid), __uid_t(suid)) def setresuid(ruid, euid,

IDLE file saving problem

2009-08-21 Thread newb.py
I am learning Python and need to use use IDLE, but I am having a problem. When I open a new window in IDLE and write my code, all is well. The coloring works and is very helpful. However, when I save the file I am working on, all the color disappears. And what is more frustrating is that when I

Re: IDLE file saving problem

2009-08-21 Thread MRAB
newb.py wrote: I am learning Python and need to use use IDLE, but I am having a problem. When I open a new window in IDLE and write my code, all is well. The coloring works and is very helpful. However, when I save the file I am working on, all the color disappears. And what is more frustrating

Re: Annoying octal notation

2009-08-21 Thread MRAB
Piet van Oostrum wrote: Derek Martin c...@pizzashack.org (DM) wrote: DM I fail to see how 0O012, or even 0o012 is more intelligible than 012. DM The latter reads like a typo, and the former is virtually DM indistinguishable from 00012, O0012, or many other combinations that DM someone might

Re: Three-Phase-Diagrams with matplotlib

2009-08-21 Thread Mark Lawrence
M. Hecht wrote: Hello, does anyone know whether it is possible to draw three-phase-diagrams with matplotlib? A three-phase-diagram is a triangular diagram applied in chemistry e.g. for slags where one has three main components of a chemical substance at the corners and points or lines within

Re: IDLE file saving problem

2009-08-21 Thread r
On Aug 21, 4:10 pm, MRAB pyt...@mrabarnett.plus.com wrote: [snip] That happens if you don't provide the extension, eg you save as my_script instead of my_script.py. (Perhaps IDLE should add the extension if the user doesn't.) Yes, and much more needs improvement! I have made many changes

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread Jonathan Gardner
On Aug 21, 6:36 am, Jonathan Fine jf...@pytex.org wrote:     �...@apply      def tags():          value = []          # complicated code          return value Is this different from: tags = [] # complicated code I can see the argument that you are cleaning up a lot of intermediary

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread Jonathan Gardner
On Aug 21, 9:09 am, alex23 wuwe...@gmail.com wrote: On Aug 21, 11:36 pm, Jonathan Fine jf...@pytex.org wrote: class ColourThing(object):     @apply     def rgb():         def fset(self, rgb):             self.r, self.g, self.b = rgb         def fget(self):             return (self.r,

Reading, writing files

2009-08-21 Thread seanm
In the book I am using, they give the following function as an example: def copyFile(oldFile, newFile): f1 = open(oldFile, 'r') f2 = open(newFile, 'w') while True: text = f1.read(50) if text == : break f2.write(text) f1.close() f2.close()

Help Please

2009-08-21 Thread newb.py
In the book I am using, they give the following function as an example: def copyFile(oldFile, newFile): f1 = open(oldFile, 'r') f2 = open(newFile, 'w') while True: text = f1.read(50) if text == : break f2.write(text) f1.close() f2.close()

Re: Reading, writing files

2009-08-21 Thread Albert Hopkins
On Fri, 2009-08-21 at 15:21 -0700, seanm wrote: In the book I am using, they give the following function as an example: def copyFile(oldFile, newFile): f1 = open(oldFile, 'r') f2 = open(newFile, 'w') while True: text = f1.read(50) if text == :

Re: Help Please

2009-08-21 Thread Albert Hopkins
Why do you post the same question twice within 5 minutes of each other? -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading, writing files

2009-08-21 Thread MRAB
seanm wrote: In the book I am using, they give the following function as an example: def copyFile(oldFile, newFile): f1 = open(oldFile, 'r') f2 = open(newFile, 'w') while True: text = f1.read(50) This will read up to 50 characters from the input file. At the end of the

Re: Object Reference question

2009-08-21 Thread Ben Finney
josef jos...@gmail.com writes: On Aug 21, 4:26 am, Ben Finney ben+pyt...@benfinney.id.au wrote: Note that, after that list is created, each item in that list is *also* a reference to the corresponding object. That is, ‘a’ is a reference to an object, and ‘dk[0]’ is a *different* reference

Re: Sanitising arguments to shell commands

2009-08-21 Thread Ben Finney
Rick King rickbk...@comcast.net writes: shlex doesn't handle unicode input though, so, in general, it's not a good solution. Argh. Is there a Python bug tracker number for fixing that? Or is there a better solution? -- \ “Pinky, are you pondering what I'm pondering?” “I think so, |

Re: proposal: add setresuid() system call to python

2009-08-21 Thread Carl Banks
On Aug 21, 1:50 pm, travis+ml-pyt...@subspacefield.org wrote: On Mon, Jul 20, 2009 at 04:10:35PM +0200, Hrvoje Niksic wrote: To emulate the os-module-type calls, it's better to raise exceptions than return negative values: def setresuid(ruid, euid, suid):     return

Re: Annoying octal notation

2009-08-21 Thread James Harris
On 21 Aug, 20:48, Derek Martin c...@pizzashack.org wrote: ... James Harris wrote: It maybe made sense once but this relic of the past should have been consigned to the waste bin of history long ago. Sigh.  Nonsense.  I use octal notation *every day*, for two extremely prevalent purposes:

Re: Silly question

2009-08-21 Thread David C . Ullrich
On Fri, 21 Aug 2009 14:45:55 -0500, David C Ullrich dullr...@sprynet.com wrote: [...] Oops. Should have tested that a little more carefully before posting. No time to fix it right now, customer just got here. Let's just say we're looking for the primes between sqrt(n) and n... from math import

Re: Code formatting question: conditional expression

2009-08-21 Thread Aahz
In article 87ocqchl2k@benfinney.id.au, Ben Finney ben+pyt...@benfinney.id.au wrote: Diez B. Roggisch de...@nospam.web.de writes: excessblk = None if total P.BASE: excessblk = ... You don't lose any vertical space, I don't see vertical space as such a scarce resource; we don't have

Re: Annoying octal notation

2009-08-21 Thread James Harris
On 21 Aug, 22:18, MRAB pyt...@mrabarnett.plus.com wrote: Piet van Oostrum wrote: Derek Martin c...@pizzashack.org (DM) wrote: DM I fail to see how 0O012, or even 0o012 is more intelligible than 012. DM The latter reads like a typo, and the former is virtually DM indistinguishable from

Re: Sanitising arguments to shell commands

2009-08-21 Thread Chris Rebert
On Fri, Aug 21, 2009 at 3:55 PM, Ben Finneyben+pyt...@benfinney.id.au wrote: Rick King rickbk...@comcast.net writes: shlex doesn't handle unicode input though, so, in general, it's not a good solution. Argh. Is there a Python bug tracker number for fixing that? Indeed there is:

Re: Annoying octal notation

2009-08-21 Thread Ben Finney
Derek Martin c...@pizzashack.org writes: James Harris wrote: It maybe made sense once but this relic of the past should have been consigned to the waste bin of history long ago. Sigh. Nonsense. I use octal notation *every day*, for two extremely prevalent purposes: file creation umask,

Invitation to connect on LinkedIn

2009-08-21 Thread Tim Heath
LinkedIn Tim Heath requested to add you as a connection on LinkedIn: -- Jaime, I'd like to add you to my professional network on LinkedIn. - Tim View invitation from Tim Heath

Re: Annoying octal notation

2009-08-21 Thread Ben Finney
Derek Martin c...@pizzashack.org writes: Sure, but that won't stop people who've been writing code for 20 years from continuing to type octal that way... Humans can learn fairly easily, but UN-learning is often much harder, especially when the behavior to be unlearned is still very commonly

Decompressing gzip over FTP

2009-08-21 Thread SeanMon
Is there a way to decompress a large (2GB) gzipped file being retrieved over FTP on the fly? I'm using ftplib.FTP to open a connection to a remote server, and I have had no success connecting retrbinary to gzip without using an intermediate file. Is there any way to get a file-like object

Re: Decompressing gzip over FTP

2009-08-21 Thread Christian Heimes
SeanMon schrieb: Is there a way to decompress a large (2GB) gzipped file being retrieved over FTP on the fly? I'm using ftplib.FTP to open a connection to a remote server, and I have had no success connecting retrbinary to gzip without using an intermediate file. Is there any way to get a

Re: Decompressing gzip over FTP

2009-08-21 Thread SeanMon
On Aug 21, 9:40 pm, Christian Heimes li...@cheimes.de wrote: SeanMon schrieb: Is there a way to decompress a large (2GB) gzipped file being retrieved over FTP on the fly? I'm using ftplib.FTP to open a connection to a remote server, and I have had no success connecting retrbinary to

Questions on XML

2009-08-21 Thread joy99
Dear Group, I like to convert some simple strings of natural language to XML. May I use Python to do this? If any one can help me, on this. I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I use Python to help me in this regard? How can I learn good XML aspects of Python. If

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread alex23
Jonathan Gardner jgard...@jonathangardner.net wrote: This is brilliant. I am going to use this more often. I've all but given up on property() since defining get_foo, get_bar, etc... has been a pain and polluted the namespace. Unfortunately I can't remember who I first learned it from - it was

Re: Using 'apply' as a decorator, to define constants

2009-08-21 Thread Steven D'Aprano
On Fri, 21 Aug 2009 15:17:40 -0700, Jonathan Gardner wrote: Unfortunately, apply() has been removed as a built-in in 3.x. I'm not sure if it has been relocated to a module somewhere, there's no mention of such in the docs. apply = lambda f: f() It's one of those functions that is

Re: Annoying octal notation

2009-08-21 Thread Steven D'Aprano
On Fri, 21 Aug 2009 14:48:57 -0500, Derek Martin wrote: It maybe made sense once but this relic of the past should have been consigned to the waste bin of history long ago. Sigh. Nonsense. I use octal notation *every day*, for two extremely prevalent purposes: file creation umask, and

Re: Questions on XML

2009-08-21 Thread David Smith
joy99 wrote: Dear Group, I like to convert some simple strings of natural language to XML. May I use Python to do this? If any one can help me, on this. I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I use Python to help me in this regard? How can I learn good XML

Re: 2.6 windows install

2009-08-21 Thread Kevin D . Smith
On 2009-08-21 10:39:09 -0500, Martin v. Löwis mar...@v.loewis.de said: 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 are added by the installer, none of which is occurring on any

Re: 2.6 windows install

2009-08-21 Thread Kevin D . Smith
On 2009-08-21 11:43:31 -0500, Kevin D. Smith kevin.sm...@sixquickrun.com said: On 2009-08-21 10:39:09 -0500, Martin v. Löwis mar...@v.loewis.de said: Did you install Python to the network device from your XP box? That would explain why you can run it: the required registry settings

Re: Questions on XML

2009-08-21 Thread Rami Chowdhury
I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I use Python to help me in this regard? I can say from experience that Python on Windows (at least, Python 2.5 on 32-bit Vista) works perfectly well with UTF-8 files containing Bangla. I have had trouble with working

Re: Questions on XML

2009-08-21 Thread Stefan Behnel
Rami Chowdhury wrote: I am using primarily UTF-8 based strings, like Hindi or Bengali. Can I use Python to help me in this regard? I can say from experience that Python on Windows (at least, Python 2.5 on 32-bit Vista) works perfectly well with UTF-8 files containing Bangla. I have had

[issue6741] Garbage collector release method

2009-08-21 Thread Lev
Lev lgards...@gmail.com added the comment: I,m trying to develop this patch now, but I'm facing the challenge (wrong ref_count or list corruption in dict objects). If I can solve it, I publish patch here. -- ___ Python tracker

[issue6749] Support for encrypted zipfiles when interpreting zipfile as script

2009-08-21 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Can you provide a patch? -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6749 ___

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

2009-08-21 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Can this fix be considered for inclusion in 3.1.2? I don't think it should be integrated into 3.1. It *is* a new feature. -- title: Add os.link() and os.symlink() and os.path.islink() support for Windows - Add os.link() and

[issue6239] c_char_p return value returns string, not bytes

2009-08-21 Thread kai zhu
kai zhu kaizhu...@gmail.com added the comment: i just found this bug independently, but yes its a bug, which i hope gets fixed for sake of extension community: // test.c beg char s[4] = ab\xff; char *foo() { return s; } // test.c end $ gcc -fPIC -g -c -Wall test.c $ gcc -shared test.o -o

[issue6444] multiline exception logging via syslog handler

2009-08-21 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Do you suggest to file bug report to syslog-ng maintainer? Yes, I do. Otherwise you can't use it as a drop-in replacement, which people would expect to be possible. -- status: open - closed ___

[issue6667] logging config - using of FileHandler's delay argument?

2009-08-21 Thread Vinay Sajip
Changes by Vinay Sajip vinay_sa...@yahoo.co.uk: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6667 ___ ___

[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Jackson Yang
New submission from Jackson Yang jackson.y...@augmentum.com: # Bug Description In a multi-threaded environment, the Win32 Python3000 built-in function print may give the output several times. # How to Reproduce: import threading event = threading.Event() class Test(threading.Thread): def

[issue6751] Default return value in ConfigParser

2009-08-21 Thread Juan Javier
New submission from Juan Javier jjdomingu...@yahoo.com: I think it is useful, at least for me, to add an argument, default, to [Safe,Raw]ConfigParser.get that, if present, will be returned if the methid fails to return the value. That is, instead of rasing an exception, return default, if

[issue6752] -1**2=-1

2009-08-21 Thread rahul
New submission from rahul rahulalone1...@gmail.com: what is the reason for this -- components: 2to3 (2.x to 3.0 conversion tool) messages: 91809 nosy: rahul1618 severity: normal status: open title: -1**2=-1 type: compile error versions: Python 2.5

  1   2   >