Re: Problem receiving UDP broadcast packets.

2011-04-19 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 _sou

Re: Pickling over a socket

2011-04-19 Thread Bastian Ballmann
Am Tue, 19 Apr 2011 19:28:50 -0700 (PDT) schrieb Jean-Paul Calderone : > 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 sockets where client and server

Re: List comprehension vs filter()

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 4:08 PM, Ian Kelly 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 body of the code h

Re: List comprehension vs filter()

2011-04-19 Thread Ian Kelly
On Tue, Apr 19, 2011 at 9:59 PM, Chris Angelico wrote: > On Wed, Apr 20, 2011 at 1:45 PM, Chris Rebert 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 varia

Re: IDLE bug

2011-04-19 Thread Terry Reedy
On 4/19/2011 11:39 PM, harrismh777 wrote: Terry Reedy wrote: If one is new to Python and perhaps not sure, or should not be sure, then I prefer that one ask here for a second opinion. Thanks Terry. I am not new to Python, but I am new to Python3, and I'm also relatively new to IDLE. Typically

Re: Teaching Python

2011-04-19 Thread harrismh777
Passiday wrote: I think Python is a very important language to learn - both easy and advanced, with very wide support in different platforms, with loads of great applications that can be scripted by it, and great community support. Yes. In my opinion, Python is the new BASIC. I date back to

Re: Teaching Python

2011-04-19 Thread Passiday
Of course, I meant the "tinkering, playing with, etc." meaning. That would be quite strange to look for an advice "how to break the Pentagon's systems" in public forum :) And while I plan to tell them about the "practical programming" (ie, typical tasks what they would be doing when hired), I t

Re: Teaching Python

2011-04-19 Thread harrismh777
Passiday wrote: I am planning to teach Python to a group of high school students, who have in-depth interest in programming, hacking etc. I am looking for some good material, what I could use as a basic guide when preparing the classes plan for the course - website or book, what would roll ou

Re: multiple Python 2.7 Windows installations

2011-04-19 Thread Mark Hammond
On 20/04/2011 12:40 AM, Eric Frederich wrote: Hello, I am trying to get an installer built with distutils to recognize multiple installations. The installer currently finds my installation at C:\Python27 I have a custom Python27 built myself with Visual Studio sitting somewhere else, say C:\MyPy

Re: Teaching Python

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 1:48 PM, Sourav wrote: > Hacking?? 1) Tinkering, programming, building furniture with an axe. 2) Breaking and entering in the electronic world. I assume the OP meant #1, although when I talk about "hacking" in this sort of sense, I'm thinking more in terms of tinkering w

Re: List comprehension vs filter()

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 1:45 PM, Chris Rebert 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 named posttype. However, since the list comp appears to work

Re: [OT] Piling of prepositions (was: Namespaces in functions vs classes)

2011-04-19 Thread geremy condra
On Tue, Apr 19, 2011 at 7:49 PM, Dave Angel wrote: > On 01/-10/-28163 02:59 PM, Ben Finney wrote: >> >> "Rhodri James"  writes: >> >>> Language abuse: it's not just Python. A donation of just $5 will keep >>> a programmer in prepositions for a month. $50 will supply enough >>> articles to keep a s

Re: Teaching Python

2011-04-19 Thread Sourav
Lot of tutorials on net. Specially Python's own site. Dive into Python seems a good start -- http://mail.python.org/mailman/listinfo/python-list

Re: Teaching Python

2011-04-19 Thread Sourav
Hacking?? -- http://mail.python.org/mailman/listinfo/python-list

Re: List comprehension vs filter()

2011-04-19 Thread Chris Rebert
On Tue, Apr 19, 2011 at 8:23 PM, Chris Angelico wrote: > On Wed, Apr 20, 2011 at 1:22 PM, Chris Rebert wrote: >> On Tue, Apr 19, 2011 at 8:10 PM, Chris Angelico wrote: >> >>> type=lst[0]["type"].lower() >> >> Tangent: Don't call it "type"; you're shadowing the built-in class of >> the same name

Re: IDLE bug

2011-04-19 Thread harrismh777
Terry Reedy wrote: If one is new to Python and perhaps not sure, or should not be sure, then I prefer that one ask here for a second opinion. Thanks Terry. I am not new to Python, but I am new to Python3, and I'm also relatively new to IDLE. Typically I edit with vi, test on the terminal, and

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Roy Smith
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 > discovery command to a particular UDP port. All d

Re: Remote Connection

2011-04-19 Thread ray
On Apr 19, 8:23 pm, Chris Rebert wrote: > On Tue, Apr 19, 2011 at 6:04 PM, ray wrote: > > I wonder if there is a solution to provide remote connections between > > two computers similar to Remote Desktop.  The difference I am looking > > for is to be able to deliver speech/audio from the local ma

Re: List comprehension vs filter()

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 1:22 PM, Chris Rebert wrote: > On Tue, Apr 19, 2011 at 8:10 PM, Chris Angelico wrote: > >> type=lst[0]["type"].lower() > > Tangent: Don't call it "type"; you're shadowing the built-in class of > the same name. By "shadowing" you mean that the global variable still exists

Re: List comprehension vs filter()

2011-04-19 Thread Chris Rebert
On Tue, Apr 19, 2011 at 8:10 PM, Chris Angelico wrote: > type=lst[0]["type"].lower() Tangent: Don't call it "type"; you're shadowing the built-in class of the same name. Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: List comprehension vs filter()

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 1:10 PM, Chris Angelico wrote: > type=lst[0]["type"].lower() > > lst=filter(lambda x: x["type"].lower()==type,lst) # Restrict to that one type After posting, I realised that "type" is a built-in identifier, and did a quick variable name change to "posttype" which shouldn't

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Dan Stromberg
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 promiscuous mode. In fact, it Might be necessary

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Dan Stromberg
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 not > configured correctly and should change the

List comprehension vs filter()

2011-04-19 Thread Chris Angelico
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",...},{"type":"fixed",...},{"type":"c

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-20, Chris Angelico wrote: > On Wed, Apr 20, 2011 at 11:15 AM, 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: [OT] Piling of prepositions (was: Namespaces in functions vs classes)

2011-04-19 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Ben Finney wrote: "Rhodri James" writes: Language abuse: it's not just Python. A donation of just $5 will keep a programmer in prepositions for a month. $50 will supply enough articles to keep a small company understandable for over a year. With your generous help, w

Re: Pickling over a socket

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 6:27 pm, Roger Alexander wrote: > Thanks everybody, got it working. > >  I appreciate the help! > > Roger. It's too bad none of the other respondents pointed out to you that you _shouldn't do this_! Pickle is not suitable for use over the network like this. Your server accepts arbitr

Re: Teaching Python

2011-04-19 Thread Alec Taylor
Here are a few tutorials which may be helpful for notes &etc: Author,Series,Lectures,Slides/Documentation,Assignments,Difficulty MIT,A Gentle Introduction to Programming Using Python,on iTunes Uÿhttp://itunes.apple.com/us/itunes-u/introduction-to-computer-science/id341597455,http://stuff.mit.edu/i

meteclasses 2.x/3.x compatibility

2011-04-19 Thread James Mills
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). Python 2.x: class Foo(object): __meteclass__ = MyMetaClass Python 3.x: class Foo(metaclass=MyMetaClass): pass Thanks, cheers James -- -- James Mills -- -- "Problems are

Re: Teaching Python

2011-04-19 Thread Alec Taylor
Author Series Lectures Slides/Documentation Assignments Difficulty MIT A Gentle Introduction to Programming Using Python on iTunes U http://itunes.apple.com/us/itunes-u/introduction-to-computer-science/id341597455 http://stuff.mit.edu/iap/python/ http://ocw.mit.edu/courses/electrical-engi

Re: Teaching Python

2011-04-19 Thread John Bokma
Passiday writes: > Hello, > > I am planning to teach Python to a group of high school students, who > have in-depth interest in programming, hacking etc. > > I am looking for some good material, what I could use as a basic guide > when preparing the classes plan for the course - website or book,

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 11:15 AM, 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 not > configured correctly and should change the

Re: Remote Connection

2011-04-19 Thread Chris Rebert
On Tue, Apr 19, 2011 at 6:04 PM, ray wrote: > I wonder if there is a solution to provide remote connections between > two computers similar to Remote Desktop.  The difference I am looking > for is to be able to deliver speech/audio from the local machine to > the remote machine which will process

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-20, Chris Angelico wrote: > On Wed, Apr 20, 2011 at 10:09 AM, Grant Edwards > wrote: >> The management program can then send another broadcast packet to >> configure the IP address of a device. After that, the management >> program switches over to normal unicast TCP and UDP protocols

Remote Connection

2011-04-19 Thread ray
I wonder if there is a solution to provide remote connections between two computers similar to Remote Desktop. The difference I am looking for is to be able to deliver speech/audio from the local machine to the remote machine which will process the audio via Dragon Naturally Speaking. As an addit

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 10:09 AM, Grant Edwards wrote: > The management program can then send another broadcast packet to > configure the IP address of a device. After that, the management > program switches over to normal unicast TCP and UDP protocols (HTTP, > TFTP, etc.) to set up the device. >

Re: My stupidity / strange inconsistency overriding class methods

2011-04-19 Thread Chris Rebert
On Tue, Apr 19, 2011 at 4:52 PM, andrew cooke wrote: > Hi, > > I've been staring at this problem, in various forms, all day.  Am I missing > something obvious, or is there some strange hardwiring of isinstance?  This > is with Python 3.2. > >        class A(metaclass=ABCMeta): >            @clas

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 10:00 AM, Grant Edwards wrote: > If I send a packet to ff:ff:ff:ff:ff:ff--255.255.255.255, it's because > I want everybody on the Ethernet segment to receive it.  If I wanted > only people on a particular subnet (e.g. 10.0.0.0/8) to receive it, I > would have sent it to the

Re: My stupidity / strange inconsistency overriding class methods

2011-04-19 Thread andrew cooke
OK, sorry, I see the mistake. I'm confusing __class__ on the instance and on te class (the latter being the metaclass). Sorry again, Andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-19, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 4:40 PM, Irmen de Jong wrote: >> On 20-4-2011 1:21, Grant Edwards wrote: >>> >>> If I don't call bind(), then the broadcast packets go out the wrong >>> interface on the sending machine. >>> >> >> Fair enough. >> >> Next issue then: as

Re: Teaching Python

2011-04-19 Thread Ben Finney
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 meaning of “hack” before

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-19, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 3:21 PM, Grant Edwards > wrote: >> I'm have problems figuring out how to receive UDP broadcast packets on >> Linux. >> >> Here's the receiving code: >> >> --receive.py--- > >> Bu

Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Gregory Ewing
Jean-Paul Calderone wrote: Also boolean xor is the same as !=. Only if you have booleans. Even without short circuiting, a boolean xor operator could provide the service of automatically booling things for you (is that a word?). Jean-Paul -- http://mail.python.org/mailman/listinfo/python-li

Re: My stupidity / strange inconsistency overriding class methods

2011-04-19 Thread andrew cooke
Also, there's something strange about the number of arguments (they're not consistent between the two examples - the "A" to __instancecheck__ should not be needed). Yet it compiles and runs like that. Very confused :o( -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-19, Irmen de Jong wrote: > On 20-4-2011 1:21, Grant Edwards wrote: >> >> If I don't call bind(), then the broadcast packets go out the wrong >> interface on the sending machine. > > Fair enough. > > Next issue then: as far as I know, broadcast packets are by default > not routed across

My stupidity / strange inconsistency overriding class methods

2011-04-19 Thread andrew cooke
Hi, I've been staring at this problem, in various forms, all day. Am I missing something obvious, or is there some strange hardwiring of isinstance? This is with Python 3.2. class A(metaclass=ABCMeta): @classmethod def __instancecheck__(cls, instance): return F

Re: Teaching Python

2011-04-19 Thread Allan Davis
How about this. http://inventwithpython.com/ thanks, Allan On Tue, Apr 19, 2011 at 7:35 PM, geremy condra wrote: > On Tue, Apr 19, 2011 at 4:24 PM, Dan Stromberg > wrote: > > On Tue, Apr 19, 2011 at 4:03 PM, geremy condra > wrote: > >> On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: > >>>

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 4:40 PM, Irmen de Jong wrote: > On 20-4-2011 1:21, Grant Edwards wrote: >> >> If I don't call bind(), then the broadcast packets go out the wrong >> interface on the sending machine. >> > > Fair enough. > > Next issue then: as far as I know, broadcast packets are by default

Re: Teaching Python

2011-04-19 Thread PATRICIA MEDINA
We have been teaching game programming using python in my school district for a few years now. We started out using python programming for the absolute beginner. It was good, but didn't use pygame and was mostly text based until the last 2 chapters. Another book for reference is Game Programmi

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 1:21, Grant Edwards wrote: > > If I don't call bind(), then the broadcast packets go out the wrong > interface on the sending machine. > Fair enough. Next issue then: as far as I know, broadcast packets are by default not routed across subnets by gateways. Which is a good thing.

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 3:21 PM, Grant Edwards wrote: > I'm have problems figuring out how to receive UDP broadcast packets on > Linux. > > Here's the receiving code: > > --receive.py--- > But, the receiving Python program never sees any pac

[OT] Piling of prepositions (was: Namespaces in functions vs classes)

2011-04-19 Thread Ben Finney
"Rhodri James" writes: > Language abuse: it's not just Python. A donation of just $5 will keep > a programmer in prepositions for a month. $50 will supply enough > articles to keep a small company understandable for over a year. With > your generous help, we can beat this scourge! I lately lost

Re: Teaching Python

2011-04-19 Thread geremy condra
On Tue, Apr 19, 2011 at 4:24 PM, Dan Stromberg wrote: > On Tue, Apr 19, 2011 at 4:03 PM, geremy condra wrote: >> On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: >>> Hello, >>> >>> I am planning to teach Python to a group of high school students, who have >>> in-depth interest in programming, h

Re: Teaching Python

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: > Hello, > > I am planning to teach Python to a group of high school students, who have > in-depth interest in programming, hacking etc. > > I am looking for some good material, what I could use as a basic guide when > preparing the classes plan f

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
On 2011-04-19, Irmen de Jong wrote: > On 20-4-2011 0:21, Grant Edwards wrote: >> I'm have problems figuring out how to receive UDP broadcast packets on >> Linux. >> > [...] > >> Here's the sending code: >> >> send.py--- >> #!/usr/bin/py

Re: Teaching Python

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 4:03 PM, geremy condra wrote: > On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: >> Hello, >> >> I am planning to teach Python to a group of high school students, who have >> in-depth interest in programming, hacking etc. >> >> I am looking for some good material, what I

Re: Problem receiving UDP broadcast packets.

2011-04-19 Thread Irmen de Jong
On 20-4-2011 0:21, Grant Edwards wrote: > I'm have problems figuring out how to receive UDP broadcast packets on > Linux. > [...] > Here's the sending code: > > send.py--- > #!/usr/bin/python > import sys,socket,time > > host = sys.arg

Re: Teaching Python

2011-04-19 Thread geremy condra
On Tue, Apr 19, 2011 at 3:42 PM, Passiday wrote: > Hello, > > I am planning to teach Python to a group of high school students, who have > in-depth interest in programming, hacking etc. > > I am looking for some good material, what I could use as a basic guide when > preparing the classes plan f

Teaching Python

2011-04-19 Thread Passiday
Hello, I am planning to teach Python to a group of high school students, who have in-depth interest in programming, hacking etc. I am looking for some good material, what I could use as a basic guide when preparing the classes plan for the course - website or book, what would roll out the topi

Re: Pickling over a socket

2011-04-19 Thread Roger Alexander
Thanks everybody, got it working. I appreciate the help! Roger. -- http://mail.python.org/mailman/listinfo/python-list

Problem receiving UDP broadcast packets.

2011-04-19 Thread Grant Edwards
I'm have problems figuring out how to receive UDP broadcast packets on Linux. Here's the receiving code: --receive.py--- #!/usr/bin/python import socket host = '' port = 5010 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockop

Re: Namespaces in functions vs classes

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 8:00 AM, Rhodri James wrote: > Language abuse: it's not just Python.  A donation of just $5 will keep a > programmer in prepositions for a month.  $50 will supply enough articles to > keep a small company understandable for over a year.  With your generous > help, we can be

Re: Namespaces in functions vs classes

2011-04-19 Thread Rhodri James
On Tue, 19 Apr 2011 17:47:40 +0100, Gerald Britton wrote: Gerald Britton wrote: I now understand the Python does not consider a class definition as a separate namespace as it does for function definitions. That is a helpful understanding. That is not correct. Classes are separate namesp

Re: multiple Python 2.7 Windows installations

2011-04-19 Thread Martin v. Loewis
> I tried to create another 2.7 key but regedit wouldn't let me. > So, if I can only have one 2.7 key, it would seem that the routine > GetPythonVersions will only ever get 1 version of 2.7. > Does this mean that it is unsupported to have more than one Python 2.7 > installation on Windows? Exactly

Re: [ANN] Python 2.5.6 Release Candidate 1

2011-04-19 Thread Martin v. Loewis
> Thanks Martin, I'm glad these older releases are still getting important > fixes. > > I notice http://www.python.org/download/releases/2.5.6/NEWS.txt says the > release date was 17 Apr 2010. Presumably that should have said 2011. Thanks for pointing it out. I fixed it in the repository, so it

Re: What breaks if I remove lib/python2.7/test/* ?

2011-04-19 Thread Irmen de Jong
On 19-4-2011 19:06, cjblaine wrote: > What breaks if I remove lib/python2.7/test/* ? What purpose does it serve? > > It is 26MB for me. > > I am trying to trim my Python install for good reason. > > Thanks for any info! Terry answered what it is for. Personally, I also once used some functions

ANNOUNCE: wxPython 2.8.12.0

2011-04-19 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 bina

Re: optparse eats $

2011-04-19 Thread Michael Kent
Try this on your *nix command line: echo ">$100" On a *nix command line, the '$1' part of ">$100" will be seen as 'give me the value of the shell variable "1"', and since it has no value, will result in an empty string. So it's not optparse, or Python, because the literal string you intend to

Re: optparse eats $

2011-04-19 Thread Peter Otten
tazz_ben wrote: > So, I'm using optparse as follows: > > Command line: > python expense.py ">$100" -f ~/desktop/test.txt > ['>00'] > > > In Main: > > desc = '' > p = optparse.OptionParser(description=desc) > > utilities = optparse.OptionGroup(p, 'Utility Options') > utilities.add_option('--fi

Re: optparse eats $

2011-04-19 Thread John Gordon
In tazz_ben writes: > So, any ideas? Why is including a $ eating both the dollar signa and the 1? Unix command lines tend to assume any $ inside double-quotes is a shell variable name. Try enclosing in single-quotes instead. -- John Gordon A is for Amy, who fell down the

optparse eats $

2011-04-19 Thread tazz_ben
So, I'm using optparse as follows: Command line: python expense.py ">$100" -f ~/desktop/test.txt ['>00'] In Main: desc = '' p = optparse.OptionParser(description=desc) utilities = optparse.OptionGroup(p, 'Utility Options') utilities.add_option('--file', '-f', dest="file", help="Define

Re: Noob Question

2011-04-19 Thread Felipe Bastos Nunes
Yes, Dan is right, it looked for the sources, and you have only binaries on your system. Look in your distribution repositories for the *-devel or alike for the 5 that failed and try again. 2011/4/19 Dan Stromberg > On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray > wrote: > > Hi All, > > > > I

Re: Pickling over a socket

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 5:30 AM, Dan Stromberg wrote: > I played around with it until something worked, and ended up with the > below.  The most significant change was probably using sc.makefile > instead of s.makefile in the server... Oh! I didn't notice that in the OP. Yep, that would do it! C

Re: Pickling over a socket

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 11:53 AM, Roger Alexander wrote: > Hi, > > I'm trying to understand how to pickle Python objects over a TCP > socket. > > In the example below (based on code from Foundations of Python Network > Programming), a client creates a dictionary (lines 34-38) and uses > pickle.dum

Re: Pickling over a socket

2011-04-19 Thread Chris Angelico
On Wed, Apr 20, 2011 at 4:53 AM, Roger Alexander wrote: > Hi, > > I'm trying to understand how to pickle Python objects over a TCP > socket. > > In the example below (based on code from Foundations of Python Network > Programming), a client creates a dictionary (lines 34-38) and uses > pickle.dump

Re: Pickling over a socket

2011-04-19 Thread Chris Rebert
On Tue, Apr 19, 2011 at 11:53 AM, Roger Alexander wrote: > Hi, > > I'm trying to understand how to pickle Python objects over a TCP > socket. > > In the example below (based on code from Foundations of Python Network > Programming), a client creates a dictionary (lines 34-38) and uses > pickle.dum

Re: Noob Question

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray wrote: > Hi All, > > I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When > I run 'make test', I receive several errors. The readme states that you can > generally ignore messages about skipped tests, but as you can see be

Re: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 1:33 PM, Rob McGillivray wrote: I am trying to install from an RPM downloaded from python.org. That puzzles me. For *nix, I do not see .rpm, just tarballs, on http://python.org/download/releases/3.2/ -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Pickling over a socket

2011-04-19 Thread Roger Alexander
Hi, I'm trying to understand how to pickle Python objects over a TCP socket. In the example below (based on code from Foundations of Python Network Programming), a client creates a dictionary (lines 34-38) and uses pickle.dump at line 42 to write the pickled object using file handle make from a s

force --install-layout=deb on systems where that makes sense?

2011-04-19 Thread Lee Harr
Is there a way to make distutils use --install-layout=deb but only on systems where that makes sense? I just noticed that if someone installs without that switch, my app will not be able to find its data files, because sys.prefix = /usr  but the installation is actually in to /usr/local I suppo

RE: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Rob McGillivray
Hi Terry, Much appreciate the pointers! :-) I am trying to install from an RPM downloaded from python.org. I'm pretty new to Linux etc (very pleased to be finally getting into the wide world of OSS), so I'm double-challenged on a number of fronts right now. I will run the failed tests in verbo

Re: What breaks if I remove lib/python2.7/test/* ?

2011-04-19 Thread Terry Reedy
On 4/19/2011 1:06 PM, cjblaine wrote: What breaks if I remove lib/python2.7/test/* ? What purpose does it serve? It allows you to run the test suite. Some people like to run it when they install. Or they may run a module test if they have a problem with a specific module or edit the Python c

Re: Namespaces in functions vs classes

2011-04-19 Thread Terry Reedy
On 4/19/2011 10:58 AM, Gerald Britton wrote: serve method unless it is qualified. I now understand the Python does not consider a class definition as a separate namespace as it does for function definitions. Class namespaces are separate namespaces but not in the same way as for functions. C

What breaks if I remove lib/python2.7/test/* ?

2011-04-19 Thread cjblaine
What breaks if I remove lib/python2.7/test/* ? What purpose does it serve? It is 26MB for me. I am trying to trim my Python install for good reason. Thanks for any info! -- http://mail.python.org/mailman/listinfo/python-list

Re: Namespaces in functions vs classes

2011-04-19 Thread Ian Kelly
On Tue, Apr 19, 2011 at 10:31 AM, Ethan Furman wrote: > Gerald Britton wrote: >> >> I now understand the Python does >> not consider a class definition as a separate namespace as it does for >> function definitions.  That is a helpful understanding. > > That is not correct.  Classes are separate n

3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 10:55 AM, Rob McGillivray wrote: I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When I run 'make test', I receive several errors. Welcome to Python. Newbie lesson 1: write an informative subject line that will catch the attention of people who can answe

Re: Namespaces in functions vs classes

2011-04-19 Thread Gerald Britton
>Gerald Britton wrote: >> I now understand the Python does >> not consider a class definition as a separate namespace as it does for >> function definitions. That is a helpful understanding. >That is not correct. Classes are separate namespaces -- they just >aren't automatically searched. The o

Re: who moved reload?

2011-04-19 Thread Calvin Spealman
I have a great solution : stop using reload. It often dangerous and more often silly. On Apr 7, 2011 5:44 AM, "harrismh777" wrote: All right... somebody is sacked (er, fired) ! Who moved reload()? This kinda stuff is driving me bonkers... there was no need to move reload() anyplace... ... so

Re: Namespaces in functions vs classes

2011-04-19 Thread Ethan Furman
Gerald Britton wrote: I now understand the Python does not consider a class definition as a separate namespace as it does for function definitions. That is a helpful understanding. That is not correct. Classes are separate namespaces -- they just aren't automatically searched. The only name

Re: "Fatal Python Error" Need Help

2011-04-19 Thread Ned Deily
In article , Yogesh Gupta wrote: > I am trying to run a python based program on MacOSX, which needs following > packages > > numpy > PIL > matplotlib > > I can successfully import all 3 using python2.5 (only using /sw64/bin/python > or /sw64/bin/python2.5) , although i have python2.6 and 2.7 in

Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 10:23 am, Grant Edwards wrote: > On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes wrote: > > Am 18.04.2011 21:58, schrieb John Nagle: > >> ?? ?? This is typical for languages which backed into a "bool" type, > >> rather than having one designed in. ??The usual result is a boolean > >>

"Fatal Python Error" Need Help

2011-04-19 Thread Yogesh Gupta
Hello, I am trying to run a python based program on MacOSX, which needs following packages numpy PIL matplotlib I can successfully import all 3 using python2.5 (only using /sw64/bin/python or /sw64/bin/python2.5) , although i have python2.6 and 2.7 installed. I get following error when in run ex

Noob Question

2011-04-19 Thread Rob McGillivray
Hi All, I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When I run 'make test', I receive several errors. The readme states that you can generally ignore messages about skipped tests, but as you can see below, some of the tests failed and a number were 'unexpected skips

Re: How to create a (transparent) decorator with status information?

2011-04-19 Thread Timo Schmiade
On Tue, Apr 19, 2011 at 08:20:05AM -0600, Ian Kelly wrote: > On Tue, Apr 19, 2011 at 1:12 AM, Timo Schmiade wrote: > > Just one question remains now: What is a "Borg" in this context? > > http://code.activestate.com/recipes/66531/ > -- > http://mail.python.org/mailman/listinfo/python-list Thank

Re: Namespaces in functions vs classes

2011-04-19 Thread Gerald Britton
Ethan -- I'm just getting back to this question. If you recall, you asked: [snip] 8< "script with possible name clashes" eggs = 'scrambled eggs' meat = 'steak' class Breakfast(): meat = 'spam' def serve(self): print("Here's

multiple Python 2.7 Windows installations

2011-04-19 Thread Eric Frederich
Hello, I am trying to get an installer built with distutils to recognize multiple installations. The installer currently finds my installation at C:\Python27 I have a custom Python27 built myself with Visual Studio sitting somewhere else, say C:\MyPython27. I looked at PC/bdist_wininst/install.c

Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Grant Edwards
On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes wrote: > Am 18.04.2011 21:58, schrieb John Nagle: >> ?? ?? This is typical for languages which backed into a "bool" type, >> rather than having one designed in. ??The usual result is a boolean >> type with numerical semantics, like >> >> ??>>> Tru

Re: How to create a (transparent) decorator with status information?

2011-04-19 Thread Ian Kelly
On Tue, Apr 19, 2011 at 1:12 AM, Timo Schmiade wrote: > Just one question remains now: What is a "Borg" in this context? http://code.activestate.com/recipes/66531/ -- http://mail.python.org/mailman/listinfo/python-list

Re: installing setuptools on Windows custom python install

2011-04-19 Thread Eric Frederich
I do not have a DLLs folder. I created this installation of Python myself since I needed it built with Visual Studio 2005. I followed instructions under PC\readme.txt This file mentioned nothing about a DLLs folder. >From PC\readme.txt . The best installation strategy is to put the Py

Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Westley Martínez
On Tue, 2011-04-19 at 19:00 +1000, Chris Angelico wrote: > On Tue, Apr 19, 2011 at 6:43 PM, Steven D'Aprano > wrote: > > but I don't see how > > > > (arbitrary expression) + (another expression) + ... + (last expression) > > > > can have any guarantees applied. I mean, you can't even guarantee tha

  1   2   >