Announcing the formation of the PyHam, the Birmingham (AL) Python Users Group

2009-12-05 Thread Mark Freeman
A new Python users group is forming in Birmingham, AL USA. We will be holding a planning meeting at Roque on December 10th at 5:30pm. See our group page (http://groups.google.com/group/pyham) for more details.. While you are there, join the group and say hello! Mark Freeman --

[RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
On behalf of the Python development team, I'm pleased to announce the first alpha release of Python 2.7. Python 2.7 is scheduled to be the last major version in the 2.x series. It includes many features that were first released in Python 3.1. The faster io module, the new nested with statement

Re: [RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
My apologies. The whatsnew link is actually http://docs.python.org/dev/whatsnew/2.7. 2009/12/5 Benjamin Peterson benja...@python.org: On behalf of the Python development team, I'm pleased to announce the first alpha release of Python 2.7. -- Regards, Benjamin --

moin-1.8.6 released

2009-12-05 Thread Reimar Bauer
== MoinMoin 1.8.6 advanced wiki engine released == MoinMoin is an easy to use, full-featured and extensible wiki software package written in Python. It can fulfill a wide range of roles, such as a personal

Announcing fileutils, a UNIX inspired file system library

2009-12-05 Thread . clutchski
Hello! I am happy to announce the release of fileutilshttp://github.com/clutchski/fileutils, a file system library inspired by classic UNIX programs like cp, mkdir and chmod. It is an attempt to smooth out some of the rough edges in the standard library's os and shutil modules, and create an

Re: python bijection

2009-12-05 Thread Raymond Hettinger
[Me] * we've already got one (actually two).   The two dictionary approach... [Francis Carr] Solutions such as bidict just automate the two-dict approach. They do so at the expense of implementing a new API to support it and at the expense with having non-obvious behaviors (i.e. how it

ctypes pointer from offset into array?

2009-12-05 Thread Carl Banks
Is there a way to get the pointer to an array offset in ctypes. Example, say I define an array like so: xfer = (c_char*bufsize)() How would I get a pointer to then nth byte (equivalient of xfer[n])? I guess I would have expected xfer+n to work, but it doesn't. Carl Banks --

Re: python bijection

2009-12-05 Thread Raymond Hettinger
  ...sqlite3 provides another way... In many many cases, using a dB (even a lightweight such as sqlite3) is swatting the fly with a sledgehammer :-) I'm sure it seems that way, but look at the generic description of the problem: I have a list of n-ary tuples with named fields and would like

Re: read from standard input

2009-12-05 Thread Siva B
for the line of code you given, print type(sys.stdin), sys.stdin the output is: class 'idlelib.rpc.RPCProxy' idlelib.rpc.RPCProxy object at 0x00BE8090 there is no change. I have tried it in python2.6 on windows platform. Thanks, Siva On Sat, Dec 5, 2009 at 12:57 PM, Chris Rebert

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread Raymond Hettinger
On Dec 4, 2:03 am, Alf P. Steinbach al...@start.no wrote: Is this guaranteed to work in Python 3.x?   def foo(): pass ...   foo.blah = 222   foo.blah 222 Yes, function attributes are guaranteed to be writable: http://www.python.org/dev/peps/pep-0232/ Raymond --

Re: Install script under a different name

2009-12-05 Thread Floris Bruynooghe
On Dec 5, 1:52 am, Lie Ryan lie.1...@gmail.com wrote: on linux/unix, you need to add the proper #! line to the top of any executable scripts and of course set the executable bit permission (chmod +x scriptname). In linux/unix there is no need to have the .py extension for a file to be

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread northof40
On Dec 5, 2:44 pm, Maxim Khitrov mkhit...@gmail.com wrote: On Fri, Dec 4, 2009 at 6:55 PM, northof40 shearich...@gmail.com wrote: On Dec 5, 12:52 pm, northof40 shearich...@gmail.com wrote: Hi - I'm writing a *very* simple program for my kids. It asks the user to give it the answer to a

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread northof40
On Dec 5, 6:23 pm, Paul Rubin no.em...@nospam.invalid wrote: northof40 shearich...@gmail.com writes: I'm thinking of some logic where a raw_input call is executed and then if more than X seconds elapses before the prompt is replied to the process writes a message Sorry too slow (or

Re: question about subprocess and shells

2009-12-05 Thread Floris Bruynooghe
On Dec 4, 9:38 pm, Ross Boylan r...@biostat.ucsf.edu wrote: If one uses subprocess.Popen(args, ..., shell=True, ...) When args finishes execution, does the shell terminate?  Either way seems problematic. Essentially this is executing /bin/sh args so if you're unsure as to the behaviour just

Re: read from standard input

2009-12-05 Thread Rami Chowdhury
On Saturday 05 December 2009 01:20:12 Siva B wrote: for the line of code you given, print type(sys.stdin), sys.stdin the output is: class 'idlelib.rpc.RPCProxy' idlelib.rpc.RPCProxy object at 0x00BE8090 there is no change. I have tried it in python2.6 on windows platform. Thanks,

Re: subprocess kill

2009-12-05 Thread luca72
On 5 Dic, 03:06, Carl Banks pavlovevide...@gmail.com wrote: On Dec 4, 3:44 pm, luca72 lucabe...@libero.it wrote: On 5 Dic, 00:14, luca72 lucabe...@libero.it wrote: On 5 Dic, 00:03, luca72 lucabe...@libero.it wrote: On 4 Dic, 23:23, Mike Driscoll kyoso...@gmail.com wrote: On

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Raymond Hettinger: On Dec 4, 2:03 am, Alf P. Steinbach al...@start.no wrote: Is this guaranteed to work in Python 3.x? def foo(): pass ... foo.blah = 222 foo.blah 222 Yes, function attributes are guaranteed to be writable: http://www.python.org/dev/peps/pep-0232/ Thanks to all,

can someone explain 'super' to me?

2009-12-05 Thread Michael
From the docs about the built-in function super: super( type[, object-or-type]) Return the superclass of type. If the second argument is omitted the super object returned is unbound. If the second argument is an object, isinstance(obj, type) must be true. If the

Re: Can't print Chinese to HTTP

2009-12-05 Thread Lie Ryan
On 12/5/2009 2:57 PM, Gnarlodious wrote: On Dec 1, 3:06 pm, Terry Reedy wrote: def print(s): return sys.stdout.buffer.write(s.encode('utf-8')) Here is a better solution that lets me send any string to the function: def print(html): return sys.stdout.buffer.write((Content-type:text/

Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
I'm trying to store analytic data in a folder called Analysis. If the user doesn't have the folder, I make one for him, and then write a txt file into it. In this case a histogram of values, x and frequency. However, it appears that I made a mistake somewhere and cannot delete it using the Win

Re: can someone explain 'super' to me?

2009-12-05 Thread Lie Ryan
On 12/5/2009 9:27 PM, Michael wrote: It seems like it can return either a class or an instance of a class. Like super( C, self) is like casting self as superclass C. However if you omit the second argument entirely you get a class. Inside a class C: these are all equivalent:

Re: Can't print Chinese to HTTP

2009-12-05 Thread Alf P. Steinbach
* Lie Ryan: On 12/5/2009 2:57 PM, Gnarlodious wrote: On Dec 1, 3:06 pm, Terry Reedy wrote: def print(s): return sys.stdout.buffer.write(s.encode('utf-8')) Here is a better solution that lets me send any string to the function: def print(html): return

Re: read from standard input

2009-12-05 Thread Bujji
what is the problem you faced in running it on Linux or windows we'll use IDLE only on linux platform like this also you can run see below ubu...@siva:~/Desktop$ python Python 2.6.2 (r262:71600, Oct 7 2009, 11:27:27) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 Type help, copyright, credits or

Re: [distutils] Install script under a different name

2009-12-05 Thread Wolodja Wentland
On Fri, Dec 04, 2009 at 19:34 -0500, Nikolaus Rath wrote: All my Python files have extension .py. However, I would like to install scripts that are meant to be called by the user without the suffix, i.e. the file scripts/doit.py should end up as /usr/bin/doit. Apparently the scripts= option

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread Andreas Waldenburger
On Sat, 05 Dec 2009 11:26:34 +0100 Alf P. Steinbach al...@start.no wrote: * function is misleading in itself (due to the hijacking of this term in mathematics), [...] Can you please elaborate? To me, a function is something that transforms some input to some output [1]. Which is exactly

Re: python bijection

2009-12-05 Thread Lie Ryan
On 12/5/2009 4:18 PM, Steven D'Aprano wrote: Tree is better than Graph not having Tree and Graph package in the standard library force most people to find List-based solution. If you have to be *forced* to use a list-based solution, that's a good sign that a list is *not* the right tool for

Re: editor with autocompletion

2009-12-05 Thread Fabio Zadrozny
On Sat, Dec 5, 2009 at 5:19 AM, Siva B sivait...@gmail.com wrote: Hi All, Thanks for your reply. What I want is An Editor which can support Dynamic Languages with Autocomplete. I have my own language with some file extension (for ex: *.fs ) I can add few keywords to editor, it should

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread anand jeyahar
simple when the python program ended, the file handle created by it was still open... so windows will not allow you to delete it (the standard behaviour, when a parent process dies, with a sub-process running is to keep the child running.) try logging off and back on.it will solve the

Re: editor with autocompletion

2009-12-05 Thread Someone Something
If you're actually going to release this, you shouldn't bundle it with a preexisting text editor (IMHO) in case it goes out of development and then you'll end up like DSL (damn small linux) did. In other words either you get a text editor that's basically never going out of development (emacs, not

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread Rune Strand
The easiest wasy is to use the Timer object in the threading module. from threading import Timer -- http://mail.python.org/mailman/listinfo/python-list

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread Maxim Khitrov
On Sat, Dec 5, 2009 at 9:01 AM, Rune Strand rune.str...@gmail.com wrote: The easiest wasy is to use the Timer object in the threading module. from threading import Timer Doesn't work on Windows. - Max -- http://mail.python.org/mailman/listinfo/python-list

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread Rune Strand
On Dec 5, 3:07 pm, Maxim Khitrov mkhit...@gmail.com wrote: Doesn't work on Windows. - Max Yes, it does. I've used it a lot, also in Py2Exe apps. Try the documentation example yourself def hello(): print hello, world t = Timer(30.0, hello) t.start() # after 30 seconds, hello, world will

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread Maxim Khitrov
On Sat, Dec 5, 2009 at 9:11 AM, Rune Strand rune.str...@gmail.com wrote: On Dec 5, 3:07 pm, Maxim Khitrov mkhit...@gmail.com wrote: Doesn't work on Windows. - Max Yes, it does. I've used it a lot, also in Py2Exe apps.  Try the documentation example yourself def hello():    print hello,

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
The program code is not mine, but I wanted to modify it to produce an Analysis folder when the user wants histogram file, basically, a txt file to appear in Analysis. Elsewhere in the program this is done for another type of data that is directed to an Events folder. I figured I could copy

Nested Dicts

2009-12-05 Thread Victor Subervi
Hi; I have the following error: /var/www/html/angrynates.com/cart/catTree.py in getChildren(levelDict={'cat3': {}}, level=0) 23 if level MAXLEVEL: 24 return #possibly the data has a cycle/loop 25 for (nm, dt) in levelDict: ### ERROR HERE 26 cursor.execute('''select

Re: Nested Dicts

2009-12-05 Thread D'Arcy J.M. Cain
On Sat, 5 Dec 2009 10:52:10 -0500 Victor Subervi victorsube...@gmail.com wrote: Hi; I have the following error: /var/www/html/angrynates.com/cart/catTree.py in getChildren(levelDict={'cat3': {}}, level=0) 23 if level MAXLEVEL: 24 return #possibly the data has a cycle/loop

Re: UnicodeDecodeError? Argh! Nothing works! I'm tired and hurting and...

2009-12-05 Thread Nobody
On Fri, 04 Dec 2009 00:33:57 +, Steven D'Aprano wrote: Just to be contrary, I *like* mbox. Me too. :-) Me too. Why? What features or benefits of mbox do you see that make up for it's disadvantages? Simplicity and performance. Maildir isn't simple when you add in the filesystem or

Re: Nested Dicts

2009-12-05 Thread MRAB
Victor Subervi wrote: Hi; I have the following error: /var/www/html/angrynates.com/cart/catTree.py http://angrynates.com/cart/catTree.py in getChildren(levelDict={'cat3': {}}, level=0) 23 if level MAXLEVEL: 24 return #possibly the data has a cycle/loop 25 for (nm, dt) in

Re: Float precision and float equality

2009-12-05 Thread Mark Dickinson
On Dec 5, 3:37 pm, Anton81 gerenu...@googlemail.com wrote: I'd like to do calculations with floats and at some point equality of two number will be checked. What is the best way to make sure that equality of floats will be detected, where I assume that mismatches beyond a certain point are

Re: ctypes pointer from offset into array?

2009-12-05 Thread sturlamolden
On 5 Des, 10:13, Carl Banks pavlovevide...@gmail.com wrote: Is there a way to get the pointer to an array offset in ctypes. Example, say I define an array like so: xfer = (c_char*bufsize)() How would I get a pointer to then nth byte (equivalient of xfer[n])? I guess I would have expected

Re: ctypes pointer from offset into array?

2009-12-05 Thread sturlamolden
On 5 Des, 10:13, Carl Banks pavlovevide...@gmail.com wrote: Is there a way to get the pointer to an array offset in ctypes. Could also mention that Cython has pointer arithmetics. Cython can be easier to use than ctypes, but is not a standard module. --

Re: Nested Dicts

2009-12-05 Thread Carsten Haese
Victor Subervi wrote: d = {'cat': {'one':'two'}} for a, b in d: ... File stdin, line 2 ^ IndentationError: expected an indented block d = {'cat': {}} for a, b in d: ... File stdin, line 2 ^ IndentationError: expected an indented block So apparently, if either the

Re: [distutils] Install script under a different name

2009-12-05 Thread Nikolaus Rath
Lie Ryan lie.1...@gmail.com writes: On 12/5/2009 11:34 AM, Nikolaus Rath wrote: Hello, All my Python files have extension .py. However, I would like to install scripts that are meant to be called by the user without the suffix, i.e. the file scripts/doit.py should end up as /usr/bin/doit.

Re: Nested Dicts

2009-12-05 Thread Victor Subervi
On Sat, Dec 5, 2009 at 12:01 PM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: d = {'cat': {'one':'two'}} for a, b in d: ... File stdin, line 2 ^ IndentationError: expected an indented block d = {'cat': {}} for a, b in d: ... File stdin, line 2

Re: question about subprocess and shells

2009-12-05 Thread Nobody
On Fri, 04 Dec 2009 13:38:11 -0800, Ross Boylan wrote: If one uses subprocess.Popen(args, ..., shell=True, ...) When args finishes execution, does the shell terminate? Either way seems problematic. That depends upon what args is. On Unix, if args ends with a , the shell will terminate as

Re: TDD with nose or py.test

2009-12-05 Thread Aahz
In article 2519ffb0-fd49-4340-857b-62fca5c71...@33g2000vbe.googlegroups.com, Lacrima lacrima.ma...@gmail.com wrote: I am learning TDD with Python and there is not much information about this topic. Python is shipped with unittest module. That is fine, but I also discovered other libraries: nose

Re: [distutils] Install script under a different name

2009-12-05 Thread Nikolaus Rath
Wolodja Wentland wentl...@cl.uni-heidelberg.de writes: On Fri, Dec 04, 2009 at 19:34 -0500, Nikolaus Rath wrote: All my Python files have extension .py. However, I would like to install scripts that are meant to be called by the user without the suffix, i.e. the file scripts/doit.py should end

Re: Nested Dicts

2009-12-05 Thread Carsten Haese
Victor Subervi wrote: Of course I knew about those indentation errors That may be so, but you cleverly disguised this fact by saying the exact opposite. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread MrJean1
Try using the function timelimited from this recipe http://code.activestate.com/recipes/576780/ An (untested) example with a 60 second timeout would be: try: r = timelimited(60, raw_input, 'enter right or wrong: ') except TimeLimitExpired: except KeyboardInterrupt: /Jean

Re: Question on class module import

2009-12-05 Thread monkeyboy
Thank you, that clears it for me -- http://mail.python.org/mailman/listinfo/python-list

Re: os.remove() permission problem

2009-12-05 Thread Aahz
In article mailman.1254.1259673141.2873.python-l...@python.org, Christian Heimes li...@cheimes.de wrote: You have to set the write and execute permssion on *directory*, not on the file. unlink (aka remove) requires write permission on the directory in order to remove the file. It's like in the

Re: Nested Dicts

2009-12-05 Thread Victor Subervi
On Sat, Dec 5, 2009 at 12:39 PM, Carsten Haese carsten.ha...@gmail.comwrote: Victor Subervi wrote: Of course I knew about those indentation errors That may be so, but you cleverly disguised this fact by saying the exact opposite. I will try not to make such assumptions in the future.

Re: Specifying an API for a straeming parser

2009-12-05 Thread Nobody
On Fri, 04 Dec 2009 13:51:15 -0800, tyler wrote: Howdy folks, I'm working on a JSON Python module [1] and I'm struggling with an appropriate syntax for dealing with incrementally parsing streams of data as they come in (off a socket or file object). The underlying C-level parsing library

Re: python bijection

2009-12-05 Thread geremy condra
On Sat, Dec 5, 2009 at 7:06 AM, Lie Ryan lie.1...@gmail.com wrote: On 12/5/2009 4:18 PM, Steven D'Aprano wrote: Tree is better than Graph not having Tree and Graph package in the standard library force most people to find List-based solution. If you have to be *forced* to use a list-based

[RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
On behalf of the Python development team, I'm pleased to announce the first alpha release of Python 2.7. Python 2.7 is scheduled to be the last major version in the 2.x series. It includes many features that were first released in Python 3.1. The faster io module, the new nested with statement

Re: [RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
My apologies. The whatsnew link is actually http://docs.python.org/dev/whatsnew/2.7. 2009/12/5 Benjamin Peterson benja...@python.org: On behalf of the Python development team, I'm pleased to announce the first alpha release of Python 2.7. -- Regards, Benjamin --

pywin32 question

2009-12-05 Thread yair reshef
i', looking to create a script that will log all data i drag, click or highlight. i dont think its very chalnging, just a matter of finding the right functions. how/can i detect highlighted text mouse events -- http://mail.python.org/mailman/listinfo/python-list

Re: How to tell if you're running on windows?

2009-12-05 Thread r0g
Roy Smith wrote: I'm using 2.5.1. How can I tell if I'm running on windows? The obvious answer, platform.system(), gets complicated. On the python that comes with cygwin, it returns 'CYGWIN_NT-5.2-WOW64', but I've got a native windows build of python where it returns 'Microsoft'. The

Re: Float precision and float equality

2009-12-05 Thread Raymond Hettinger
On Dec 5, 7:37 am, Anton81 gerenu...@googlemail.com wrote: I'd like to do calculations with floats and at some point equality of two number will be checked. What is the best way to make sure that equality of floats will be detected, where I assume that mismatches beyond a certain point are

Re: Question on Python as career

2009-12-05 Thread r0g
TimmyGee wrote: On Dec 4, 1:08 pm, r0g aioe@technicalbloke.com wrote: TimmyGee wrote: On Dec 4, 2:48 am, Grant Edwards inva...@invalid.invalid wrote: On 2009-12-03, r0g aioe@technicalbloke.com wrote: I have done one MA in Linguistics, did a PhD in Natural Language Processing and

Re: Float precision and float equality

2009-12-05 Thread Mark Dickinson
On Dec 5, 8:25 pm, Raymond Hettinger pyt...@rcn.com wrote: On Dec 5, 7:37 am, Anton81 gerenu...@googlemail.com wrote: I'd like to do calculations with floats and at some point equality of two number will be checked. What is the best way to make sure that equality of floats will be

Re: Float precision and float equality

2009-12-05 Thread Raymond Hettinger
On Dec 5, 12:56 pm, Mark Dickinson dicki...@gmail.com wrote: On Dec 5, 8:25 pm, Raymond Hettinger pyt...@rcn.com wrote: On Dec 5, 7:37 am, Anton81 gerenu...@googlemail.com wrote: I'd like to do calculations with floats and at some point equality of two number will be checked. What is

Re: python bijection

2009-12-05 Thread Raymond Hettinger
[geremy condra] I actually considered using dependencies as an example on the graphine for pythonistas[1] article, but decided to do the maze run instead. In any event, the uses of graphs in general computing are well enough established that I don't really think that's where the majority of

Re: How to timeout when waiting for raw_input from user ?

2009-12-05 Thread zeph
Here's what I came up with, though it only asks once question then quits depending on the answer or lack thereof. And while, yes, you can't interrupt a raw_input call from a timer, providing for a blank line (user hitting enter) is a way around it: import threading import Timer from random

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread John Machin
On Dec 6, 2:46 am, W. eWatson wolftra...@invalid.com wrote: [snip]          f = file( s, wb )          if not f:              self.LogError( File creation error 1 )              return False Either you are shadowing the built-in function file() or you haven't tested this code ... file() aka

Re: TDD with nose or py.test

2009-12-05 Thread Roy Smith
In article 2519ffb0-fd49-4340-857b-62fca5c71...@33g2000vbe.googlegroups.com, Lacrima lacrima.ma...@gmail.com wrote: Hello! I am learning TDD with Python and there is not much information about this topic. Python is shipped with unittest module. That is fine, but I also discovered other

Re: python bijection

2009-12-05 Thread geremy condra
On Sat, Dec 5, 2009 at 4:39 PM, Raymond Hettinger pyt...@rcn.com wrote: [geremy condra] I actually considered using dependencies as an example on the graphine for pythonistas[1] article, but decided to do the maze run instead. In any event, the uses of graphs in general computing are well

Re: TDD with nose or py.test

2009-12-05 Thread geremy condra
On Mon, Nov 30, 2009 at 8:46 AM, Lacrima lacrima.ma...@gmail.com wrote: Hello! I am learning TDD with Python and there is not much information about this topic. Python is shipped with unittest module. That is fine, but I also discovered other libraries: nose and py.test. They promise to make

Re: TDD with nose or py.test

2009-12-05 Thread Paul Rubin
geremy condra debat...@gmail.com writes: I use unittest, but mostly because its so close to junit and cppunit, which I also use extensively. Having said that, it *is* in the standard library and is a common denominator between all your options. What happened to doctest? --

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread Steven D'Aprano
On Sat, 05 Dec 2009 11:26:34 +0100, Alf P. Steinbach wrote: Regarding my terminology, routine instead function that everybody except you remarked on, it is of course intentional. [...] I think you failed to realise that your use of the term was ambiguous. It wasn't clear that you were using

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread sturlamolden
On 5 Des, 12:55, Andreas Waldenburger use...@geekmail.invalid wrote: Can you please elaborate? To me, a function is something that transforms some input to some output [1]. Which is exactly what Python functions do, without fail. A mathematical function cannot have side effects. That is what

Re: python bijection

2009-12-05 Thread Raymond Hettinger
On Dec 5, 3:22 pm, geremy condra debat...@gmail.com wrote: On Sat, Dec 5, 2009 at 4:39 PM, Raymond Hettinger pyt...@rcn.com wrote: [geremy condra] I actually considered using dependencies as an example on the graphine for pythonistas[1] article, but decided to do the maze run instead. In

Re: Float precision and float equality

2009-12-05 Thread sturlamolden
On 5 Des, 16:37, Anton81 gerenu...@googlemail.com wrote: I'd like to do calculations with floats and at some point equality of two number will be checked. What is the best way to make sure that equality of floats will be detected, where I assume that mismatches beyond a certain point are due

Re: python bijection

2009-12-05 Thread geremy condra
On Sat, Dec 5, 2009 at 7:18 PM, Raymond Hettinger pyt...@rcn.com wrote: On Dec 5, 3:22 pm, geremy condra debat...@gmail.com wrote: On Sat, Dec 5, 2009 at 4:39 PM, Raymond Hettinger pyt...@rcn.com wrote: [geremy condra] I actually considered using dependencies as an example on the graphine

Re: Are routine objects guaranteed mutable with dictionary?

2009-12-05 Thread Alf P. Steinbach
* Steven D'Aprano: On Sat, 05 Dec 2009 11:26:34 +0100, Alf P. Steinbach wrote: Regarding my terminology, routine instead function that everybody except you remarked on, it is of course intentional. [...] I think you failed to realise that your use of the term was ambiguous. It wasn't clear

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 17:42, John Machin sjmac...@lexicon.net wrote: On Dec 6, 2:46 am, W. eWatson wolftra...@invalid.com wrote: However, even at that, why can't I delete this empty file called Analysis? Are you trying to delete the file from another command window while Python is paused at

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 20:32, J dreadpiratej...@gmail.com wrote: connections eventually.  So being able to find who has a lock on a given file or directory if the program dies unexpectedly would be useful. Google tells me that the program Process Explorer from SysInternals will provide most

Re: Can't print Chinese to HTTP

2009-12-05 Thread Gnarlodious
On Dec 5, 3:54 am, Lie Ryan wrote: Because of the switch to unicode str, a simple print('晉') should've worked flawlessly if your terminal can accept the character, but the problem is your terminal does not. There is nothing wrong with Terminal, Mac OSX supports Unicode from one end to the

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
J wrote: On Sat, Dec 5, 2009 at 20:32, J dreadpiratej...@gmail.com wrote: connections eventually. So being able to find who has a lock on a given file or directory if the program dies unexpectedly would be useful. Google tells me that the program Process Explorer from SysInternals will

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
The original program and code are not mine. I have no idea if that specific piece of code has ever been tested. Generally the program works quite well, and when needed creates the Events folder without any difficulty. That folder is used heavily by writing new data files to it thousands of

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread Stephen Hansen
On Sat, Dec 5, 2009 at 6:20 PM, W. eWatson wolftra...@invalid.com wrote: I'm trying to do a very simple thing. I go to the Analysis folder, and try to use Win XP Pro to delete the empty and unnamed file in it. One just does a right-click on the empty file, and then uses Delete. It won't let me

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread W. eWatson
J wrote: On Sat, Dec 5, 2009 at 21:14, W. eWatson wolftra...@invalid.com wrote: What I'm trying to do is really simple. In the Win XP NG, I have two suggestions to get rid of the Analysis folder and the empty file in it. One is to use a program like you suggested, and the other is to delete it

Re: Why Can't I Delete a File I Created with Win XP?

2009-12-05 Thread J
On Sat, Dec 5, 2009 at 23:17, W. eWatson wolftra...@invalid.com wrote: J wrote: And those are your only options, really.  From what I've been able to see, there is no native ability in Linux to actually see who has a lock on a file that's been opened.  And I completely understand your

Re: TDD with nose or py.test

2009-12-05 Thread geremy condra
On Sat, Dec 5, 2009 at 6:37 PM, Paul Rubin no.em...@nospam.invalid wrote: geremy condra debat...@gmail.com writes: I use unittest, but mostly because its so close to junit and cppunit, which I also use extensively. Having said that, it *is* in the standard library and is a common denominator

How to create a docstring for a module?

2009-12-05 Thread Dr. Phillip M. Feldman
If I create a module xyz.py with a docstring xyz does everything you could possibly want. at the top, the command ?xyz issued at the IPython prompt does not display this docstring. What am I doing wrong? -- View this message in context:

Re: Organization of GUIs

2009-12-05 Thread Tim Roberts
Michael Mossey michaelmos...@gmail.com wrote: I am now wondering if I should write a GUI so that everything is in a true hierarchy, rather than a tangle of objects with democratic relationships---and more specifically, that messages (which may cause state to be changed in the receiver of the

Re: Can't print Chinese to HTTP

2009-12-05 Thread Lie Ryan
On 12/6/2009 12:56 PM, Gnarlodious wrote: On Dec 5, 3:54 am, Lie Ryan wrote: Because of the switch to unicode str, a simple print('晉') should've worked flawlessly if your terminal can accept the character, but the problem is your terminal does not. There is nothing wrong with Terminal, Mac

Re: Socket question

2009-12-05 Thread Tim Roberts
perlsyntax fasteliteprogram...@gmail.com wrote: I just want to know could it be done makeing my own socket tool that connect to two server at the same time.And what link do i need to look at? You can certainly connect to two (or any number) servers at the same time, but you have to create two

Re: subprocess kill

2009-12-05 Thread Yinon Ehrlich
On Dec 5, 12:13 pm, luca72 lucabe...@libero.it wrote: On 5 Dic, 03:06, Carl Banks pavlovevide...@gmail.com wrote: On Dec 4, 3:44 pm, luca72 lucabe...@libero.it wrote: On 5 Dic, 00:14, luca72 lucabe...@libero.it wrote: On 5 Dic, 00:03, luca72 lucabe...@libero.it wrote: On 4

Re: how to debug extended module?

2009-12-05 Thread Yinon Ehrlich
On Dec 3, 8:40 am, junyoung juneng...@gmail.com wrote: On 12월2일, 오전9시54분, junyoung juneng...@gmail.com wrote: On 12월1일, 오후6시14분, Diez B. Roggisch de...@nospam.web.de wrote: junyoung schrieb: Hi, I am a newbie who want to implement a extend module to use native python language

execnet-1.0.1: more robust and rapid python deployment

2009-12-05 Thread holger krekel
Hi everybody, Just uploaded execnet-1.0.1 featuring a new motto: execnet is about rapid-python deployment, be it for multiple CPUs, different platforms or python versions. This release brings a bunch of refinements and most importantly more robust termination, handling of CTRL-C and

Re: Float precision and float equality

2009-12-05 Thread Tim Roberts
Raymond Hettinger pyt...@rcn.com wrote: if not round(x - y, 6): ... That's a dangerous suggestion. It only works if x and y happen to be roughly in the range of integers. For example, here x and y are within roundoff error of each other, but round doesn't know it: x=1e32 y=x+1e16

Re: Organization of GUIs

2009-12-05 Thread zeph
I highly recommend reading the Cocoa documentation, which has volumes on all sorts of things like this. Here's a link that talks about views in that context, and should give you more ideas about well- designed GUI layouts: http://bit.ly/6b8PYh --

[issue7406] int arithmetic relies on C signed overflow behaviour

2009-12-05 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: Thanks Tim. I see that is back in 3.2 rather than in the shift and mask sections. At least I know what to refer to now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7406

[issue7441] Py3.1: Fatal Python Error: Py_Initialize...unknown encoding: chcp 65001.

2009-12-05 Thread Lie Ryan
New submission from Lie Ryan lie.1...@gmail.com: maybe related to #6501 Vista 32-bit SP1, Python 3.1: Microsoft Windows [Version 6.0.6000] Copyright (c) 2006 Microsoft Corporation. All rights reserved. D:\chcp 65001 Active code page: 65001 D:\python -c 'print()' Fatal Python error:

[issue7442] decimal.py: format failure with locale specifier

2009-12-05 Thread Stefan Krah
New submission from Stefan Krah stefan-use...@bytereef.org: Hi, the following works in 2.7 but not in 3.x: import locale from decimal import * locale.setlocale(locale.LC_NUMERIC, 'fi_FI') 'fi_FI' format(Decimal('1000'), 'n') Traceback (most recent call last): File stdin, line 1, in module

[issue7441] Py3.1: Fatal Python Error: Py_Initialize...unknown encoding: chcp 65001.

2009-12-05 Thread flox
flox la...@yahoo.fr added the comment: there's a patch proposed to add cp65001 alias: issue6058 -- nosy: +flox ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7441 ___

[issue6058] Add cp65001 to encodings/aliases.py

2009-12-05 Thread flox
Changes by flox la...@yahoo.fr: -- versions: +Python 2.6, Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6058 ___ ___

[issue6472] Inconsistent use of iterator in ElementTree doc diff between Py and C modules

2009-12-05 Thread Milko Krachounov
Milko Krachounov pyt...@milko.3mhz.net added the comment: This isn't just a documentation issue. A function named getiterator(), for which the docs say that it returns an iterator, should return an iterator, not just an iterable. They have different semantics and can't be used interchangeably,

[issue7443] test.support.unlink issue on Windows platform

2009-12-05 Thread Andrew Svetlov
New submission from Andrew Svetlov andrew.svet...@gmail.com: On Windows there are tiny delay between call to os.unlink and real file removing. Periodically it leads to unittest crashes in cases like this: test.support.unlink(filename) f = open(filename, 'wb') Proposed solution: wait in

  1   2   >