Re: Hello Sweet Friends

2011-04-20 Thread harrismh777
Ashraf Ali wrote: Friends . What are you looking for? Just visit the folowing link and find what you want I don't like SPAM with my eggs and ham... just eggs and ham... no SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM SPAM. SSSPPPAAAMMM SSSPPPAAAMMM SSSPPPAAAMMM SSPPAAMM SPAM ! ... on

Re: IDLE bug

2011-04-20 Thread harrismh777
Terry Reedy wrote: Go ahead and report, noting which Linux distribution, and include my negative report. Add me as nosy. Done. 11896 created. msg(s) 134194 134195 thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Heiko Wundram
Am 21.04.2011 03:35, schrieb Dan Stromberg: > I think tcpdump and tshark (was tethereal) will put the interface into > promiscuous mode so it can see more traffic; on OSF/1 (Tru64), we had > to do this manually for said programs to see all that was possible > (barring the presence of a switch not r

Hello Sweet Friends

2011-04-20 Thread Ashraf Ali
Friends . What are you looking for? Just visit the folowing link and find what you want www.spicybollywoodpix.blogspot.com hothitsbollywood.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Yico Gaga
well ,i can't visit your website ,required time out ,maybe it's the GFW'S problem ~ 2011/4/21 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

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Chris Angelico
On Thu, Apr 21, 2011 at 3:15 AM, Ron wrote: > Hey everyone. > > I've written an online interactive Python tutorial atop Google App Engine: > http://www.learnpython.org. That looks very handy! And I notice you've protected yourself by running it in a sandbox: import time time.sleep(3) Tracebac

Re: Teaching Python

2011-04-20 Thread Stefan Behnel
Ben Finney, 20.04.2011 02:06: Dan Stromberg writes: On Tue, Apr 19, 2011 at 4:03 PM, geremy condra wrote: When you say 'hacking', you mean ? Presumably he meant the real meaning of the word, not what the press made up and ran with. To be fair, the press already had its own pejorative m

Re: Teaching Python

2011-04-20 Thread harrismh777
Chris Angelico wrote: Hacking?? 1) Tinkering, programming, building furniture with an axe. 2) Breaking and entering in the electronic world. Not so much. In the comp.lang.python community hacking is most easily identified with the many one-liners that show up... that is the underlying spiri

Re: Teaching Python

2011-04-20 Thread Yico Gaga
well... they are freshmen wanna know how to learn programming , actually ,python will be such a great programming language funded their hobbies ,you are looking for material and some website ,yeah ,why not give this problem to your students ,ask the freshmen to prepare for some material and webs

Re: Teaching Python

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 8:17 PM, Steven D'Aprano wrote: > It's hardly just the press. "Hack" is a fine old English word: > "Can you teach me how to hack?" "Sure. Go to the tobacconists and buy him out, then smoke the lot. You'll be hacking like a pro in no time!" Chris Angelico -- http://mail.

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Dan Stromberg
On Wed, Apr 20, 2011 at 7:21 AM, Grant Edwards wrote: > On 2011-04-20, Dan Stromberg wrote: >> On Tue, Apr 19, 2011 at 8:12 PM, Dan Stromberg 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 add

Re: mystery string code - help!

2011-04-20 Thread Uncle Ben
On Apr 20, 1:01 pm, Dan M wrote: > > 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 > athttp://docs.python.org/release/2.3.5/whatsnew/section-slices.html > > Dan Very help

Re: meteclasses 2.x/3.x compatibility

2011-04-20 Thread James Mills
On Wed, Apr 20, 2011 at 10:18 PM, andrew cooke wrote: > 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/sour

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-19, Grant Edwards wrote: > I'm have problems figuring out how to receive UDP broadcast packets on > Linux. Thanks to everybody for their help with what turned out to have little or nothing to do with Python itself. The main problem was reverse-path filtering (which is enabled by defa

multiprocessing in subpackage on windows

2011-04-20 Thread Darren Dale
I have two really simple scripts: C:\Python27\Scripts\foo --- if __name__ == '__main__': import bar bar.main() C:\Python27\Lib\site-packages\bar.py --- from multiprocessing import Pool def task(arg): return arg def main(): pool = Pool() res = pool.apply_async(task, (3.14,))

Re: learnpython.org - an online interactive Python tutorial

2011-04-20 Thread Terry Reedy
On 4/20/2011 1:15 PM, Ron wrote: I've written an online interactive Python tutorial atop Google App Engine: http://www.learnpython.org. Currently giving 500 server error. Hope something clears up. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

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 m

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 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 never gets to your custo

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: 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 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

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 l

RE: renaming files in OS X

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

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 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 connects and sends a

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 "

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: renaming files in OS X

2011-04-20 Thread Ned Deily
In article <280cb56a-89b8-4d62-9374-d769b3acf...@semanchuk.com>, Philip Semanchuk wrote: > On Apr 20, 2011, at 10:02 AM, > wrote: > > 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

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

2011-04-20 Thread Neil Cerutti
On 2011-04-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, an

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 o

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

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 t

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 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 > > > > > _

Re: List comprehension vs filter()

2011-04-20 Thread Ian Kelly
On Wed, Apr 20, 2011 at 12:03 PM, Chris Angelico wrote: > On Thu, Apr 21, 2011 at 12:44 AM, Ian Kelly 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_Str

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

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 excell

Re: learnpython.org - an online interactive Python tutorial

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

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Thu, Apr 21, 2011 at 12:44 AM, Ian Kelly 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); Is Py_file_input t

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 itse

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 wrote: > Hey everyone. > > I've written an online interactive Python tutorial atop Google App Engine: > http://www

Re: renaming files in OS X

2011-04-20 Thread Philip Semanchuk
On Apr 20, 2011, at 10:02 AM, 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 os.rename though. > I need to

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 he

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

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 -- http

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 Handler.handle_rea

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Grant Edwards wrote: > On 2011-04-20, Heiko Wundram 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

RE: Vectors

2011-04-20 Thread Andreas Tawn
> On Apr 20, 6:43 am, Andreas Tawn wrote: > > > Algis Kabaila 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 ha

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg 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 it didn't make any

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Adam Tauno Williams wrote: > On Wed, 2011-04-20 at 06:07 -0400, Sherm Pendley wrote: >> Grant Edwards 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

Re: Vectors

2011-04-20 Thread RJB
On Apr 20, 6:43 am, Andreas Tawn wrote: > > Algis Kabaila 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 mat

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Grant Edwards wrote: > On 2011-04-20, Heiko Wundram 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 UDP datagrams to send the data, >> u

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Heiko Wundram 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 ethernet level), or

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 -- http://mail.python.o

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

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] -- http://mail.python.org/mai

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 192

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 == t

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Thomas Heller 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 destination

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 6:15 PM, Grant Edwards > 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 device somehow knows that it's no

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Heiko Wundram 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 there's some >> filte

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 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 recen

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Roy Smith wrote: > In article , > Grant Edwards 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 Ethernet segment. The management program broadcasts a >> discover

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. Me

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Grant Edwards
On 2011-04-20, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 8:12 PM, Dan Stromberg 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 > popping the network adapter into prom

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] >

Re: List comprehension vs filter()

2011-04-20 Thread Mel
Chris Angelico wrote: > On Wed, Apr 20, 2011 at 5:16 PM, Tim Roberts 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 > def

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: Vectors

2011-04-20 Thread Andreas Tawn
> Algis Kabaila 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 > operati

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 a

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] >

[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 -- http://mail.python.o

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: h

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 passed

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 e

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: 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 Py

Re: IDLE bug

2011-04-20 Thread rantingrick
On Apr 18, 11:16 pm, James Mills wrote: > On Tue, Apr 19, 2011 at 2:05 PM, harrismh777 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 AND here since this list is viewed by more peo

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: 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 = AB

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: 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 i

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 8:16 PM, Steven D'Aprano 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 a 30 ft pole, at least not >

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. > > lst=[{"type":"calc"

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 f

Re: No more Python support in NetBeans 7.0

2011-04-20 Thread Paul Rubin
Markus 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 Python gui debuggers, w

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 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 >

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 ff:ff:

Re: Teaching Python

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

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

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. But

Re: Problem receiving UDP broadcast packets.

2011-04-20 Thread Sherm Pendley
Grant Edwards 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. All devices who ge

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):

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: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Wed, 20 Apr 2011 19:26:44 +1000 schrieb Chris Angelico : > 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 all sorts

Re: Pickling over a socket

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 7:17 PM, Bastian Ballmann 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 that I used with DB

[OT] Re: Pickling over a socket

2011-04-20 Thread Bastian Ballmann
Am Wed, 20 Apr 2011 10:25:14 +0200 schrieb Thomas Rachel : > 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 do yu want with filters here? Not filtering is appropriate > ag

Re: List comprehension vs filter()

2011-04-20 Thread Chris Angelico
On Wed, Apr 20, 2011 at 5:16 PM, Tim Roberts 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 new local nam

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 computer

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 > m301

Re: Vectors

2011-04-20 Thread Anssi Saari
Algis Kabaila 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 operations you mentio

Re: Vectors

2011-04-20 Thread Chris Rebert
On Wed, Apr 20, 2011 at 12:47 AM, Algis Kabaila 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 features, but NumPy

Re: Writing Exif File

2011-04-20 Thread Chris Rebert
On Wed, Apr 20, 2011 at 12:00 AM, Jean-Pierre M 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 using the php > exif_re

  1   2   >