Practical Python with Raymond Hettinger - May 16-20, Chicago

2011-04-20 Thread 'David Beazley'
Practical Python Programmingwith Raymond Hettinger http://www.dabeaz.com/chicago/practical.html May 16-20, 2011Chicago, Illinois So, you learned a bit of Python from a book, online tutorial, or yourcoworkers. What's next?  How about learning the ins and outs of Pythonprogramming as you and five

ANNOUNCE: wxPython 2.8.12.0

2011-04-20 Thread Robin Dunn
Announcing -- The 2.8.12.0 release of wxPython is now available for download at http://wxpython.org/download.php. This release has no major new features or enhancements, but there have been plenty of bug fixes since the last stable release. Source code is available as a tarball, and

Extended deadline; IFIP sponsorship: IFIP Working Conference on Domain-Specific Languages

2011-04-20 Thread Emilie Balland
IFIP Working Conference on Domain-Specific Languages (DSL) 6-8 September 2011, Bordeaux, France http://dsl2011.bordeaux.inria.fr/ CALL FOR PAPERS (EXTENDED DEADLINE; IFIP SPONSORSHIP) Domain-specific languages have long been a popular way to shorten the distance from ideas to products in

[ANN] guiqwt v2.1.1

2011-04-20 Thread Pierre.RAYBAUT
Hi all, I am pleased to announce that `guiqwt` v2.1.1 has been released. Main changes since `guiqwt` v2.1.0: * added support for NaNs in image plot items (default behaviour: NaN pixels are transparents) * added oblique averaged cross section feature * bugfixes This version of `guiqwt`

PyCon Australia 2011: registrations now open

2011-04-20 Thread Ryan Kelly
Hi Everyone, I'm pleased to announce that registrations are now open for PyCon Australia 2011. PyCon Australia is Australia's only conference dedicated exclusively to the Python programming language, and will be held at the Sydney Masonic Center over the weekend of August 20 and 21. See below

Re: List comprehension vs filter()

2011-04-20 Thread Ian Kelly
On Tue, Apr 19, 2011 at 9:59 PM, Chris Angelico ros...@gmail.com wrote: On Wed, Apr 20, 2011 at 1:45 PM, Chris Rebert c...@rebertia.com wrote: Built-ins aren't quite the same as globals, but essentially yes: Sure. That might explain some of the weirdness, but it doesn't explain why things

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 4:08 PM, Ian Kelly ian.g.ke...@gmail.com wrote: What is the scope the code is running in?  If this is part of a class definition, that could explain why the lambda is not seeing the type / posttype closure: because there isn't one. It's inside an if, but that's all. The

Re: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Tue, 19 Apr 2011 19:28:50 -0700 (PDT) schrieb Jean-Paul Calderone calderone.jeanp...@gmail.com: It is completely insecure. Do not use pickle and sockets together. Yes pickle is like eval, but that doesnt mean that one should never ever use it over a socket connection. What about ssl

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Heiko Wundram
Am 20.04.2011 01:54, schrieb Grant Edwards: I guess the problem is that I expected to receive a packet on an interface anytime a packet was received with a destination IP address that matched that of the the interface. Apprently there's some filtering in the network stack based on the

Re: Pickling over a socket

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 4:44 PM, Bastian Ballmann ba...@chaostal.de wrote: Yes pickle is like eval, but that doesnt mean that one should never ever use it over a socket connection. What about ssl sockets where client and server authenticate each other? Or you encrypt the pickle dump with

freesoftwaredownload

2011-04-20 Thread need life partnerkumar
http://123maza.com/25/line526/ -- http://mail.python.org/mailman/listinfo/python-list

Writing Exif File

2011-04-20 Thread Jean-Pierre M
I want to enter Comments of a picture in a JPeg file. Is there a library in Python which allow me to do that without having to reinvent the wheel? The target is to read those comments in my private webSite using the php exif_read_data function (http://php.net/manual/fr/book.exif.php) --

Re: List comprehension vs filter()

2011-04-20 Thread Tim Roberts
Chris Angelico ros...@gmail.com wrote: On Wed, Apr 20, 2011 at 1:45 PM, Chris Rebert c...@rebertia.com wrote: Built-ins aren't quite the same as globals, but essentially yes: Sure. That might explain some of the weirdness, but it doesn't explain why things were still weird with the variable

Pairwise count of frequency from an incidence matrix of group membership

2011-04-20 Thread Shafique, M. (UNU-MERIT)
Hi, I have a number of different groups g1, g2, … g100 in my data. Each group is comprised of a known but different set of members from the population m1, m2, …m1000. The data has been organized in an incidence matrix: g1g2g3g4g5 m01 m210010 m301100 m411011 m500110 I need to count how many

Re: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Wed, 20 Apr 2011 16:59:19 +1000 schrieb Chris Angelico ros...@gmail.com: Even public/private key systems won't work here; someone could get hold of your client and its private key, and poof. Oh yeah but than all kinds of trusted computing wont work. Sure one can see it on the net these

Vectors

2011-04-20 Thread Algis Kabaila
Hi, Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such module? platform - ubuntu 10.10 (Linux), Python 3.1 or higher. Thanks for your help to avoid re-invention of the

Re: Writing Exif File

2011-04-20 Thread Chris Rebert
On Wed, Apr 20, 2011 at 12:00 AM, Jean-Pierre M pythonrubyl...@gmail.com wrote: I want to enter Comments of a picture in a JPeg file. Is there  a library in Python which allow me to do that without  having to reinvent the wheel? The target is to read those comments in my private webSite

Re: Vectors

2011-04-20 Thread Chris Rebert
On Wed, Apr 20, 2011 at 12:47 AM, Algis Kabaila akaba...@pcug.org.au wrote: Hi, Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such module? Dunno if it has 3D-specific

Re: Vectors

2011-04-20 Thread Anssi Saari
Algis Kabaila akaba...@pcug.org.au writes: Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such module? NumPy has array (and matrix) types with support for these basic

Re: Pairwise count of frequency from an incidence matrix of group membership

2011-04-20 Thread Peter Otten
Shafique, M. (UNU-MERIT) wrote: Hi, I have a number of different groups g1, g2, … g100 in my data. Each group is comprised of a known but different set of members from the population m1, m2, …m1000. The data has been organized in an incidence matrix: g1g2g3g4g5 m01 m210010 m301100

Re: Pickling over a socket

2011-04-20 Thread Thomas Rachel
Am 20.04.2011 09:34, schrieb Bastian Ballmann: No system is totally secure. You can _always_ poke around if a program uses user input. It depends on what the program does with the input. If it treats it appropriately, nothing can happen. For example one can totally own a complete

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 5:16 PM, Tim Roberts t...@probo.com wrote: It's because, unlike some other languages (like Pascal), Python doesn't have infinitely recursive nested namespaces.  Glossing over details, there is a global namespace, and there is a local namespace.  A new function gets a

[OT] Re: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Wed, 20 Apr 2011 10:25:14 +0200 schrieb Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de: It depends on what the program does with the input. If it treats it appropriately, nothing can happen. Yes, but the question seems to be what is appropriately. What

Re: Pickling over a socket

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 7:17 PM, Bastian Ballmann ba...@chaostal.de wrote: Well you forgot to escape ; and \ but this seems to slide into OT ;) The semicolon doesn't need to be escaped in a quoted string, and the backslash does only if it's the escape character. The string-safetifier function

Re: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Wed, 20 Apr 2011 19:26:44 +1000 schrieb Chris Angelico ros...@gmail.com: Yes, but the other half of the issue is that you have to treat anything that comes over the network as user input, even if you think it's from your own program that you control. Sure. Buffer overruns can happen in

Language lib reference in man format ?

2011-04-20 Thread Andre Majorel
If someone has ever written a script to convert the Python Language Reference and Library Reference to man format, I'm interested. Thanks in advance. -- André Majorel http://www.teaser.fr/~amajorel/ The object of this year's expedition is to see if we can find trace of last year's expedition.

Re: meteclasses 2.x/3.x compatibility

2011-04-20 Thread Steven D'Aprano
On Wed, 20 Apr 2011 11:56:35 +1000, James Mills wrote: Hi all, Is there a compatible way to use meteclasses in both Python 2.x (2.6 to 2.7) and Python 3.x (3.0 to 3.2). Untested: if sys.version = 3: kw = {'metaclass': MyMetaClass} else: kw = {} class Foo(object, **kw): if

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Sherm Pendley
Grant Edwards invalid@invalid.invalid writes: I'm trying to implement a device discovery/configuration protocol that uses UDP broadcast packets to discover specific types of devices on the local Ethernet segment. The management program broadcasts a discovery command to a particular UDP port.

Re: No more Python support in NetBeans 7.0

2011-04-20 Thread Markus
I read it too. I always preferred Netbeans + their Python plugin over Eclipse and PyDev. Perhaps I have another look for working with Aptana + PyDev for my web development stuff, but I am afraid this enviroment (and the base, Eclipse as it's main reason) is as user unfriendly as it always was.

Re: List comprehension vs filter()

2011-04-20 Thread Steven D'Aprano
On Wed, 20 Apr 2011 13:10:21 +1000, Chris Angelico wrote: Context: Embedded Python interpreter, version 2.6.6 I have a list of dictionaries, where each dictionary has a type element which is a string. I want to reduce the list to just the dictionaries which have the same type as the first

Re: Teaching Python

2011-04-20 Thread Steven D'Aprano
On Wed, 20 Apr 2011 10:06:27 +1000, Ben Finney wrote: Dan Stromberg drsali...@gmail.com writes: On Tue, Apr 19, 2011 at 4:03 PM, geremy condra debat...@gmail.com wrote: When you say 'hacking', you mean ? Presumably he meant the real meaning of the word, not what the press made up

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Thomas Heller
Am 20.04.2011 00:21, schrieb Grant Edwards: I'm have problems figuring out how to receive UDP broadcast packets on Linux. [...] On the receiving machine, I've used tcpdump to verify that broadcast packets are being seen and have a destination IP of 255.255.255.255 and destination MAC of

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Adam Tauno Williams
On Wed, 2011-04-20 at 06:07 -0400, Sherm Pendley wrote: Grant Edwards invalid@invalid.invalid writes: I'm trying to implement a device discovery/configuration protocol that uses UDP broadcast packets to discover specific types of devices on the local Ethernet segment. The management

Re: No more Python support in NetBeans 7.0

2011-04-20 Thread Paul Rubin
Markus mm.mpa...@googlemail.com writes: Infoworld awarded it as best Python IDE, testing: Boa Constructor, Eric, ActiveState's Komodo, Oracle's NetBeans, Aptana's Pydev, PyScripter, SPE, Spyder, and WingWare's Wing IDE. I saw somebody using Geany recently and it looked pretty impressive. For

PyCon Australia 2011: registrations now open

2011-04-20 Thread Ryan Kelly
Hi Everyone, I'm pleased to announce that registrations are now open for PyCon Australia 2011. PyCon Australia is Australia's only conference dedicated exclusively to the Python programming language, and will be held at the Sydney Masonic Center over the weekend of August 20 and 21. See below

Re: List comprehension vs filter()

2011-04-20 Thread Peter Otten
Chris Angelico wrote: Context: Embedded Python interpreter, version 2.6.6 I have a list of dictionaries, where each dictionary has a type element which is a string. I want to reduce the list to just the dictionaries which have the same type as the first one.

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 8:16 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: There's your problem. IDEs often play silly buggers with the environment in order to be clever. You've probably found a bug in whatever IDE you're using. And this is why I won't touch the buggers with

Re: My stupidity / strange inconsistency overriding class methods

2011-04-20 Thread andrew cooke
Thanks for finding that reference in the data model docs! I was about to post a bug report because in PEP 3119 it says otherwise: The primary mechanism proposed here is to allow overloading the built-in functions isinstance() and issubclass(). The overloading works as follows: The call

Re: My stupidity / strange inconsistency overriding class methods

2011-04-20 Thread andrew cooke
I didn't phrase that very well. I do see the point about this being an instance lookup on a class... -- http://mail.python.org/mailman/listinfo/python-list

Re: meteclasses 2.x/3.x compatibility

2011-04-20 Thread andrew cooke
What I do in Lepl is use two stages. The first calls the type/metaclass directly and the second subclasses that. This avoids using the sugar that changes between 2 and 3. So, for example, in http://code.google.com/p/lepl/source/browse/src/lepl/matchers/matcher.py#40 I have _Matcher =

py32 on windows - input() includes trailing \r

2011-04-20 Thread Frank Millman
Hi all On linux, python 3.2 - x = input() xyz len(x) 3 x 'xyz' on windows, python 3.2 - x = input() xyz len(x) 4 x 'xyz\r' Is this expected behaviour? Frank Millman -- http://mail.python.org/mailman/listinfo/python-list

Re: IDLE bug

2011-04-20 Thread rantingrick
On Apr 18, 11:16 pm, James Mills prolo...@shortcircuit.net.au wrote: On Tue, Apr 19, 2011 at 2:05 PM, harrismh777 harrismh...@charter.net wrote: Are bug reports wanted here, or just in issue tracker? Pretty sure they're wanted in the Issue Tracker. My opinion is to report bugs on the tracker

Re: Python IDE/text-editor

2011-04-20 Thread Teemu Likonen
* 2011-04-18T21:17:17-07:00 * Westley Martínez wrote: On Tue, 2011-04-19 at 06:51 +0300, Teemu Likonen wrote: * 2011-04-19T00:40:09+10:00 * Alec Taylor wrote: Please continue recommending Vim. * 2011-04-19T02:41:11+10:00 * Alec Taylor wrote: Please continue suggesting Python IDEs and/or

dictionary size changed during iteration

2011-04-20 Thread Laszlo Nagy
Given this iterator: class SomeIterableObject(object): def __iter__(self): ukeys = self.updates.keys() for key in ukeys: if self.updates.has_key(key): yield self.updates[key] for rec in self.inserts: yield rec

Re: py32 on windows - input() includes trailing \r

2011-04-20 Thread Peter Otten
Frank Millman wrote: On linux, python 3.2 - x = input() xyz len(x) 3 x 'xyz' on windows, python 3.2 - x = input() xyz len(x) 4 x 'xyz\r' Is this expected behaviour? No, that's a bug: http://bugs.python.org/issue11272 IMO it's severe enough to warrant a brown-bag

Non hashable object (without __dict__)

2011-04-20 Thread Arthur Mc Coy
Hello, I have a C++ application, I used SWIG to call the python code. I pass myModule.myObject object to the method of python code and what to store it in JSON format. The problem is when I do: o = myModule.myObject() inside python, the o object has __dict__ property, but if I take the

Re: py32 on windows - input() includes trailing \r

2011-04-20 Thread Frank Millman
Peter Otten __pete...@web.de wrote in message news:iomla6$p8f$1...@dough.gmane.org... Frank Millman wrote: On linux, python 3.2 - x = input() xyz len(x) 3 x 'xyz' on windows, python 3.2 - x = input() xyz len(x) 4 x 'xyz\r' Is this expected behaviour? No, that's a bug:

[OT] Disable creation of pyc files in DrPython

2011-04-20 Thread craf
Hi. I wonder if anyone uses Python DrPython as editor. I need to know if you can disable the creation of Pyc files created by the program. In the Geany editor you can add the parameter -B, but not if it can in this editor. Thanks in advance. Regards Cristian Abarzúa F --

Re: dictionary size changed during iteration

2011-04-20 Thread Peter Otten
Laszlo Nagy wrote: Given this iterator: class SomeIterableObject(object): def __iter__(self): ukeys = self.updates.keys() for key in ukeys: if self.updates.has_key(key): yield self.updates[key] for rec

Re: dictionary size changed during iteration

2011-04-20 Thread Peter Otten
Peter Otten wrote: Laszlo Nagy wrote: Given this iterator: class SomeIterableObject(object): def __iter__(self): ukeys = self.updates.keys() for key in ukeys: if self.updates.has_key(key): Hm, I see you are using has_key()

RE: Vectors

2011-04-20 Thread Andreas Tawn
Algis Kabaila akaba...@pcug.org.au writes: Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such module? NumPy has array (and matrix) types with support for these

renaming files in OS X

2011-04-20 Thread jyoung79
Hello, I'm considering using os.rename or shutil for renaming files on OS X (Snow Leopard). However, I've read that shutil doesn't copy the resource fork or metadata for the files on OS X. I'm not sure about os.rename though. I need to keep the resource fork and metadata. Is it better if

Re: List comprehension vs filter()

2011-04-20 Thread Mel
Chris Angelico wrote: On Wed, Apr 20, 2011 at 5:16 PM, Tim Roberts t...@probo.com wrote: You can solve this through the common lamba idiom of a closure: lst=filter(lambda x,posttype=posttype: x[type].lower()==posttype,lst) Seems a little odd, but sure. I guess this means that a function's

Re: dictionary size changed during iteration

2011-04-20 Thread Mel
Laszlo Nagy wrote: Given this iterator: class SomeIterableObject(object): def __iter__(self): ukeys = self.updates.keys() for key in ukeys: if self.updates.has_key(key): yield self.updates[key] for rec

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg drsali...@gmail.com wrote: On Tue, Apr 19, 2011 at 8:12 PM, Dan Stromberg drsali...@gmail.com wrote: I agree though that you're kind of pushing IP in a direction it wasn't intended to go. It just occurred to me: You might get some additional mileage out of

Re: dictionary size changed during iteration

2011-04-20 Thread Mel
Mel wrote: Laszlo Nagy wrote: `ukeys` isn't a different dictionary from `self.updates.keys` I'ts merely another name referring to the same dict object. I think ukeys = dict (self.updates.keys) would do what you want. Sorry. Belay that. Thought I'd had enough coffee. Mel. --

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Roy Smith r...@panix.com wrote: In article iol875$ah2$3...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: I'm trying to implement a device discovery/configuration protocol that uses UDP broadcast packets to discover specific types of devices on the local

Re: No more Python support in NetBeans 7.0

2011-04-20 Thread alister ware
On Wed, 20 Apr 2011 03:24:00 -0700, Paul Rubin wrote: Markus mm.mpa...@googlemail.com writes: Infoworld awarded it as best Python IDE, testing: Boa Constructor, Eric, ActiveState's Komodo, Oracle's NetBeans, Aptana's Pydev, PyScripter, SPE, Spyder, and WingWare's Wing IDE. I saw somebody

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Heiko Wundram modeln...@modelnine.org wrote: Am 20.04.2011 01:54, schrieb Grant Edwards: I guess the problem is that I expected to receive a packet on an interface anytime a packet was received with a destination IP address that matched that of the the interface. Apprently

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg drsali...@gmail.com wrote: On Tue, Apr 19, 2011 at 6:15 PM, Grant Edwards invalid@invalid.invalid wrote: Or can you simply use a stupid netmask like /1 that picks up all the IP ranges? That way, the source-IP check wouldn't fail. That would require that the

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Thomas Heller thel...@ctypes.org wrote: Am 20.04.2011 00:21, schrieb Grant Edwards: I'm have problems figuring out how to receive UDP broadcast packets on Linux. [...] On the receiving machine, I've used tcpdump to verify that broadcast packets are being seen and have a

Re: List comprehension vs filter()

2011-04-20 Thread Ian Kelly
On Wed, Apr 20, 2011 at 4:41 AM, Peter Otten __pete...@web.de wrote: The assignment writes to the local namespace, the lambda function reads from the global namespace; this will only work as expected if the two namespaces are the same: exec type = 42; print filter(lambda x: x == type, [42])

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Heiko Wundram
Am 20.04.2011 16:30, schrieb Grant Edwards: If you need to see the packets regardless, either use a promiscuous mode sniffer (i.e., tcpdump, but that's relatively easy to mirror in Python using SOCK_RAW, capturing packets at the ethernet level), or add a route on your system for the

SLOW AND FAST FUNCTIONS

2011-04-20 Thread Martin
//\ PROJF //P\ SLOW VER // GDRAW PROJF DEMO P // // P // XEQ GDRAW // //P \ PROJF // // \ FAST VER // @ domain [http://meami.org/fastslow.htm] --

Re: renaming files in OS X

2011-04-20 Thread Gnarlodious
Not a Python question. You should go over to http://groups.google.com/group/comp.sys.mac.system/ and ask. -- Gnarlie -- http://mail.python.org/mailman/listinfo/python-list

RE: renaming files in OS X

2011-04-20 Thread jyoung79
Not a Python question. You should go over to http://groups.google.com/group/comp.sys.mac.system/ and ask. -- Gnarlie What do you mean it's not a python question? os.rename is python syntax… how does it work on OS X? Is it the same as the 'mv' command, etc? Jay --

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Heiko Wundram modeln...@modelnine.org wrote: Am 20.04.2011 16:30, schrieb Grant Edwards: If you need to see the packets regardless, either use a promiscuous mode sniffer (i.e., tcpdump, but that's relatively easy to mirror in Python using SOCK_RAW, capturing packets at the

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Grant Edwards invalid@invalid.invalid wrote: On 2011-04-20, Heiko Wundram modeln...@modelnine.org wrote: I've thought about the SOCK_RAW option, but the CPU load of looking all received Ethernet packets in user-space would be a big down-side. Not necessarily: instead of using

Re: Vectors

2011-04-20 Thread RJB
On Apr 20, 6:43 am, Andreas Tawn andreas.t...@ubisoft.com wrote: Algis Kabaila akaba...@pcug.org.au writes: Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Adam Tauno Williams awill...@whitemice.org wrote: On Wed, 2011-04-20 at 06:07 -0400, Sherm Pendley wrote: Grant Edwards invalid@invalid.invalid writes: I'm trying to implement a device discovery/configuration protocol that uses UDP broadcast packets to discover specific types

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg drsali...@gmail.com wrote: - Actually, you Might be able to configure your device to have a netmask of 0.0.0.0, IP address of 255.255.255.255 and broadcast of 255.255.255.255. 255.255.255.255 isn't allowed as an IP address. I tried a netmask of 0.0.0.0, and

RE: Vectors

2011-04-20 Thread Andreas Tawn
On Apr 20, 6:43 am, Andreas Tawn andreas.t...@ubisoft.com wrote: Algis Kabaila akaba...@pcug.org.au writes: Are there any modules for vector algebra (three dimensional vectors, vector addition, subtraction, multiplication [scalar and vector]. Could you give me a reference to such

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Grant Edwards invalid@invalid.invalid wrote: On 2011-04-20, Heiko Wundram modeln...@modelnine.org wrote: Am 20.04.2011 01:54, schrieb Grant Edwards: I guess the problem is that I expected to receive a packet on an interface anytime a packet was received with a destination IP

Why doesn't this asyncore.dispatcher.handle_read() get called?

2011-04-20 Thread Dun Peal
Hi, I'm writing and testing an asyncore-based server. Unfortunately, it doesn't seem to work. The code below is based on the official docs and examples, and starts a listening and sending dispatcher, where the sending dispatcher connects and sends a message to the listener - yet

mystery string code - help!

2011-04-20 Thread Uncle Ben
I found this in one of the online cookbooks: #Raghunath Reddy Peesari 6 years, 3 months ago # | flag #There is more simple way. ### a = 'abcdefghi' a = a[::-1] print a 'ihgfedcba' As a newbie Pythoner, I understand [] -1] but would some tell me how '::' does its magic? Uncle Ben --

Re: mystery string code - help!

2011-04-20 Thread Dan M
As a newbie Pythoner, I understand [] -1] but would some tell me how '::' does its magic? Uncle Ben The -1 is the stride or step argument. It's described at http://docs.python.org/release/2.3.5/whatsnew/section-slices.html Dan -- http://mail.python.org/mailman/listinfo/python-list

learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Ron
Hey everyone. I've written an online interactive Python tutorial atop Google App Engine: http://www.learnpython.org. All you need to do is log in using your Google account and edit the wiki to add your tutorials. Read more on the website. Thanks for your help, and I would appreciate if you

Re: renaming files in OS X

2011-04-20 Thread Philip Semanchuk
On Apr 20, 2011, at 10:02 AM, jyoun...@kc.rr.com jyoun...@kc.rr.com wrote: Hello, I'm considering using os.rename or shutil for renaming files on OS X (Snow Leopard). However, I've read that shutil doesn't copy the resource fork or metadata for the files on OS X. I'm not sure about

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Matty Sarro
Awesome project, I really like it. I'll see if I can't help adding some material that's missing when I get on the train. Keep up the great work! On Wed, Apr 20, 2011 at 1:15 PM, Ron ron.rei...@gmail.com wrote: Hey everyone. I've written an online interactive Python tutorial atop Google App

Re: [OT] Disable creation of pyc files in DrPython

2011-04-20 Thread Alexander Kapps
On 20.04.2011 15:21, craf wrote: Hi. I wonder if anyone uses Python DrPython as editor. I need to know if you can disable the creation of Pyc files created by the program. In the Geany editor you can add the parameter -B, but not if it can in this editor. I don't know DrPython, but Python

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Thu, Apr 21, 2011 at 12:44 AM, Ian Kelly ian.g.ke...@gmail.com wrote: So, the question for the OP:  Is this file being run with execfile? Not execfile per se; the code is fetched from the database and then executed with: PyObject *v=PyRun_StringFlags(code,Py_file_input,py_globals,locals,0);

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Ron
Thanks! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread FELD Boris
Excellent idea, I've some ideas on specific subjects misunderstood by beginners. One idea for facilitating the contribution, create a mercurial repository (or a git), everyone has not a google account and your contributors will be developers so they should use a SCM. Once again, it's an

Re: [OT] Disable creation of pyc files in DrPython

2011-04-20 Thread craf
On 20.04.2011 15:21, craf wrote: Hi. I wonder if anyone uses Python DrPython as editor. I need to know if you can disable the creation of Pyc files created by the program. In the Geany editor you can add the parameter -B, but not if it can in this editor. I don't know DrPython, but Python

Re: List comprehension vs filter()

2011-04-20 Thread Ian Kelly
On Wed, Apr 20, 2011 at 12:03 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Apr 21, 2011 at 12:44 AM, Ian Kelly ian.g.ke...@gmail.com wrote: So, the question for the OP:  Is this file being run with execfile? Not execfile per se; the code is fetched from the database and then executed

Re: [Tutor] NLP

2011-04-20 Thread James Thornton
http://scikit-learn.sourceforge.net/ On Fri, Apr 8, 2011 at 6:52 AM, Ranjith Kumar ranjitht...@gmail.com wrote: Hi all,     Can anyone suggest me any best Natural Language Processing in python other than nltk. -- Cheers, Ranjith Kumar K, Chennai. http://ranjithtenz.wordpress.com

TestFixtures 1.9.2 Released!

2011-04-20 Thread Chris Withers
Hi All, I'm happy to announce a new release of TestFixtures. This release adds a utcnow method to test_datetime that behaves identically to the now method: http://packages.python.org/testfixtures/api.html#testfixtures.tdatetime.utcnow The package is on PyPI and a full list of all the links

RE: renaming files in OS X

2011-04-20 Thread jyoung79
I'm considering using os.rename or shutil for renaming files on OS X (Snow Leopard)... Hi Jay, I don't know if os.rename() does what you want, but why don't you try a simple test and find out? Surely an empirical test is at least as useful as an answer from someone like me who may or

Groups in regular expressions don't repeat as expected

2011-04-20 Thread John Nagle
Here's something that surprised me about Python regular expressions. krex = re.compile(r^([a-z])+$) s = abcdef ms = krex.match(s) ms.groups() ('f',) The parentheses indicate a capturing group within the regular expression, and the + indicates that the group can appear one or more times.

Re: Groups in regular expressions don't repeat as expected

2011-04-20 Thread Neil Cerutti
On 2011-04-20, John Nagle na...@animats.com wrote: Here's something that surprised me about Python regular expressions. krex = re.compile(r^([a-z])+$) s = abcdef ms = krex.match(s) ms.groups() ('f',) The parentheses indicate a capturing group within the regular expression, and the +

Re: renaming files in OS X

2011-04-20 Thread Ned Deily
In article 280cb56a-89b8-4d62-9374-d769b3acf...@semanchuk.com, Philip Semanchuk phi...@semanchuk.com wrote: On Apr 20, 2011, at 10:02 AM, jyoun...@kc.rr.com jyoun...@kc.rr.com wrote: I'm considering using os.rename or shutil for renaming files on OS X (Snow Leopard). However, I've read

Re: Questions about GIL and web services from a n00b

2011-04-20 Thread Chris H
On 4/19/11 3:48 AM, Lamont Nelson wrote: 1. Are you sure you want to use python because threading is not good due to the Global Lock (GIL)? Is this really an issue for multi-threaded web services as seems to be indicated by the articles from a Google search? If not, how do you avoid this

Re: Groups in regular expressions don't repeat as expected

2011-04-20 Thread MRAB
On 20/04/2011 20:20, John Nagle wrote: Here's something that surprised me about Python regular expressions. krex = re.compile(r^([a-z])+$) s = abcdef ms = krex.match(s) ms.groups() ('f',) The parentheses indicate a capturing group within the regular expression, and the + indicates that

Re: Why doesn't this asyncore.dispatcher.handle_read() get called?

2011-04-20 Thread Jean-Paul Calderone
On Apr 20, 12:25 pm, Dun Peal dunpea...@gmail.com wrote: Hi, I'm writing and testing an asyncore-based server. Unfortunately, it doesn't seem to work. The code below is based on the official docs and examples, and starts a listening and sending dispatcher, where the sending dispatcher

RE: renaming files in OS X

2011-04-20 Thread jyoung79
In article 280CB56A-89B8-4D62-9374-D769B3ACFEBB at semanchuk.com, Philip Semanchuk philip at semanchuk.com wrote: On Apr 20, 2011, at 10:02 AM, jyoung79 at kc.rr.com jyoung79 at kc.rr.com wrote: I'm considering using os.rename or shutil for renaming files on OS X (Snow Leopard)…

Re: Language lib reference in man format ?

2011-04-20 Thread andrew cooke
(1) Python's docs use Sphinx, which uses restructured text as a markup. You can generate man pages from restructured text using rst2man (which is installed on my computer, probably as part of python/docutils). HOWEVER I imagine it's not going to work very well, if at all, because Sphinx uses

Re: Groups in regular expressions don't repeat as expected

2011-04-20 Thread John Nagle
On 4/20/2011 12:23 PM, Neil Cerutti wrote: On 2011-04-20, John Naglena...@animats.com wrote: Here's something that surprised me about Python regular expressions. krex = re.compile(r^([a-z])+$) s = abcdef ms = krex.match(s) ms.groups() ('f',) The parentheses indicate a capturing group

Re: who moved reload?

2011-04-20 Thread mark
On Tue, 2011-04-19 at 12:41 -0400, Calvin Spealman wrote: I have a great solution : stop using reload. It often dangerous and more often silly. Yeah, I'm there. Some of this is just learning a new way of thinking about the language. I can see that not using reload at all makes more sense

Re: Why doesn't this asyncore.dispatcher.handle_read() get called?

2011-04-20 Thread Dun Peal
On Apr 20, 3:01 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com wrote: You didn't let the program run long enough for the later events to happen.  loop(count=1) basically means one I/O event will be processed - in the case of your example, that's an accept().  Then asyncore is done and it

Re: Teaching Python

2011-04-20 Thread Terry Reedy
On 4/20/2011 6:17 AM, Steven D'Aprano wrote: It's hardly just the press. Hack is a fine old English word: The jungle explorer hacked at the undergrowth with his machete. I was so hungry, I didn't take the time to neatly slice up the meat, but just hacked off a chunk and stuffed it in my

  1   2   >