LauncherPosta: a launcher, a real launcher.

2012-08-22 Thread Facundo Batista
LauncherPosta is a launcher. A real launcher. One that lets you launch programs. This program basically puts an icon in the systray where you can have a fully configurable menu to launch the programs that you most use, only two clicks away, anytime. Website:

PyCon Ireland 2012 (13th - 14th Oct) - Dublin, Ireland

2012-08-22 Thread Vicky Lee - Python Ireland
Hi All, What: PyCon Ireland 2012 Where: Radisson Blu Royal Hotel, Dublin, Ireland When: Sat 13th October - Sun 14th October Tickets are still on sale at: http://python.ie/pycon/2012/registration/ Speakers and talks are now available: http://python.ie/pycon/2012/conference/#talks We are also

PyCon ZA 2012 - Call for Speakers

2012-08-22 Thread Neil Muller
PyCon ZA 2012 - Call for Speakers PyCon ZA will take place October 4-5 in Cape Town, South Africa. There will be two days of talks, and we will hold sprints on the 6 and 7th of October. We are currently accepting proposals for talks. If you would like to give a presentation, please submit your

help me debug my word capitalizer script

2012-08-22 Thread Santosh Kumar
Here is the script I am using: from os import linesep from string import punctuation from sys import argv script, givenfile = argv with open(givenfile) as file: # List to store the capitalised lines. lines = [] for line in file: # Split words by spaces. words =

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-22 Thread Bob Martin
in 679182 20120821 181439 Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 21 Aug 2012 08:07:33 +0200, Alex Strickland s...@mweb.co.za declaimed the following in gmane.comp.python.general: On 2012/08/17 12:42 AM, Madison May wrote: As a lurker, I agree completely with Chris's

Re: Books?

2012-08-22 Thread Michael Poeltl
I would recommend Dive into Python3 just goole-search dive into python3 filetype:pdf and you got it! regards Michael * Anonymous Group anonymous42311...@gmail.com [2012-08-22 03:40]: What books do you recomend for learning python? Preferably free and/or online. --

Re: asking

2012-08-22 Thread mingqiang hu
I mean any of a,b,c in string adfbdfc makes the statement true,can I not use a function? suppose I got lots of substring let's say s1=a,s2=b,s3=c ...,not wrap them as a tuple or a list , just make the statement as simple as possible to check if any of the value is the substring of

Re: something about split()???

2012-08-22 Thread Mark Lawrence
On 22/08/2012 06:46, Terry Reedy wrote: On 8/21/2012 11:43 PM, mingqiang hu wrote: why filter is bad when use lambda ? Inefficient, not 'bad'. Because the equivalent comprehension or generator expression does not require a function call. A case of premature optimisation? :) -- Cheers.

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-22 Thread Guillaume Comte
Le mercredi 22 août 2012 04:10:43 UTC+2, Dennis Lee Bieber a écrit : On Tue, 21 Aug 2012 10:00:28 -0700 (PDT), Guillaume Comte guillaume.comt...@gmail.com declaimed the following in gmane.comp.python.general: A later follow-up Unfortunatly, my_socket.bind((src_addr, 1))

Re: Top-posting c. (was Re: [ANNC] pybotwar-0.8)

2012-08-22 Thread Mark Lawrence
On 22/08/2012 07:25, Bob Martin wrote: in 679182 20120821 181439 Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 21 Aug 2012 08:07:33 +0200, Alex Strickland s...@mweb.co.za declaimed the following in gmane.comp.python.general: On 2012/08/17 12:42 AM, Madison May wrote: As a lurker, I

Re: help me debug my word capitalizer script

2012-08-22 Thread Andreas Perstinger
On 22.08.2012 08:21, Santosh Kumar wrote: with open(givenfile) as file: # List to store the capitalised lines. lines = [] for line in file: # Split words by spaces. words = line.split(' ') The last element in your words list will still have a newline character

Re: Books?

2012-08-22 Thread Mark Lawrence
On 22/08/2012 02:36, Anonymous Group wrote: What books do you recomend for learning python? Preferably free and/or online. Search for the Alan Gauld tutorial. I've never used it myself, but OTOH I've never heard anybody complain about it!!! As someone else has already mentioned it, I'd

Re: help me debug my word capitalizer script

2012-08-22 Thread Chris Angelico
On Wed, Aug 22, 2012 at 4:21 PM, Santosh Kumar sntshkm...@gmail.com wrote: Purpose of the script: To capitalize the first letter of any word in a given file, leaving words which have 3 or less letters. Bugs: I know it has many bugs or/and it can be improved by cutting down the code, but my

Re: Reimporting modules, and sandboxing?

2012-08-22 Thread Mark Lawrence
On 21/08/2012 22:51, Dan Stromberg wrote: I know I've seen this discussed before, and I came away from observing the discussion thinking Python doesn't do that very well..., but we have some people here who really would like to do this, and I need to better understand the pros and cons now. Is

Re: help me debug my word capitalizer script

2012-08-22 Thread Hans Mulder
On 22/08/12 08:21:47, Santosh Kumar wrote: Here is the script I am using: from os import linesep from string import punctuation from sys import argv script, givenfile = argv with open(givenfile) as file: # List to store the capitalised lines. lines = [] for line in file:

Re: asking

2012-08-22 Thread Dave Angel
On 08/22/2012 03:17 AM, mingqiang hu wrote: I mean any of a,b,c in string adfbdfc makes the statement true,can I not use a function? suppose I got lots of substring let's say s1=a,s2=b,s3=c ...,not wrap them as a tuple or a list , just make the statement as simple as possible to check if any

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-22 Thread Guillaume Comte
I've managed to build the IP header. I've put the source and destination addresses in this header but it doesn't change the real source address... I'm trying to read the ping source code but I'm lost... -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-22 Thread Hans Mulder
On 22/08/12 09:29:37, Guillaume Comte wrote: Le mercredi 22 août 2012 04:10:43 UTC+2, Dennis Lee Bieber a écrit : On Tue, 21 Aug 2012 10:00:28 -0700 (PDT), Guillaume Comte guillaume.comt...@gmail.com declaimed the following in gmane.comp.python.general: A later follow-up

Re: How to set the socket type and the protocol of a socket using create_connection?

2012-08-22 Thread Guillaume Comte
Le mercredi 22 août 2012 11:03:11 UTC+2, Hans Mulder a écrit : On my laptop, 0 appears to be the only port number that bind accepts for a raw socket. Other numbers I tried all raise socket.error: [Errno 49] Can't assign requested address. But this might depend on your OS. What

Re: asking

2012-08-22 Thread alex23
On 08/22/2012 03:17 AM, mingqiang hu wrote: I mean any of a,b,c in string adfbdfc  makes the statement true,can I not use a function? any(map(string.__contains__, substrings)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Books?

2012-08-22 Thread Jamie Paul Griffin
[ Mark Lawrence wrote on Wed 22.Aug'12 at 8:43:58 +0100 ] On 22/08/2012 02:36, Anonymous Group wrote: What books do you recomend for learning python? Preferably free and/or online. Search for the Alan Gauld tutorial. I've never used it myself, but OTOH I've never heard anybody

Re: help me debug my word capitalizer script

2012-08-22 Thread Kamil Kuduk
Purpose of the script: To capitalize the first letter of any word in a given file, leaving words which have 3 or less letters. First or all? If first and this is the only purpose of the script you can easily use sed: less file.txt | sed -e s/\b\([a-z]\{4,\}\)/\u\1/g --

Re: help me debug my word capitalizer script

2012-08-22 Thread Chris Angelico
On Wed, Aug 22, 2012 at 8:28 PM, Kamil Kuduk kamil.ku...@gmail.com wrote: Purpose of the script: To capitalize the first letter of any word in a given file, leaving words which have 3 or less letters. First or all? If first and this is the only purpose of the script you can easily use sed:

Re: help me debug my word capitalizer script

2012-08-22 Thread Kamil Kuduk
On Wed, Aug 22, 2012 at 12:41 PM, Chris Angelico ros...@gmail.com wrote: Why less? Why not just redirect input? Yeah, my bad, I somehow used to do it, for grep too, and I know that this is slower Though, this isn't really on topic for Python. I would still go with regexp, something like: with

Re: color coding for numbers

2012-08-22 Thread Ulrich Eckhardt
Am 21.08.2012 19:07, schrieb DJC: On 21/08/12 12:55, Ulrich Eckhardt wrote: Am 21.08.2012 10:38, schrieb namenobodywa...@gmail.com: what is the best way Define best before asking such questions. ;) http://matplotlib.sourceforge.net/api/colors_api.html?highlight=colors#matplotlib.colors

Re: asking

2012-08-22 Thread Tim Chase
On 08/22/12 04:42, alex23 wrote: On 08/22/2012 03:17 AM, mingqiang hu wrote: I mean any of a,b,c in string adfbdfc makes the statement true,can I not use a function? any(map(string.__contains__, substrings)) As map()/reduce() vs. list-comprehension discussions are going on in another

psphere: how to make thread safe

2012-08-22 Thread sajuptpm
Hi, psphere: Python interface for the VMware vSphere Web Services SDK I already developed an app using https://bitbucket.org/jkinred/psphere. But getting lot of errors since psphere is not thread safe (I think). So i wrote couple of scripts to test it (See attached files) and found that

Re: help me debug my word capitalizer script

2012-08-22 Thread Santosh Kumar
OK! The bug one fixed. Thanks to Andreas Perstinger. Let's move to Bug #2: 2. How do I escape the words that are already in uppercase? For example: The input file has this: NASA The script changes this to: Nasa Is it possible to make this script look at a word, see if its first character is

Re: asking

2012-08-22 Thread Steven D'Aprano
On Wed, 22 Aug 2012 02:42:16 -0700, alex23 wrote: On 08/22/2012 03:17 AM, mingqiang hu wrote: I mean any of a,b,c in string adfbdfc  makes the statement true,can I not use a function? any(map(string.__contains__, substrings)) Nice. However, be aware that in Python 2, map() is eager and

Re: xlrd 0.8.0 released!

2012-08-22 Thread Hubert Holin
La Défense, le 22/08/2012 Hi Congratulations for the work well done, and thanks for the help xlrd brings to my work. I would like to keep up with the development but would like to know which is the repo to follow. The Python-Excel website points to https://github.com/python-excel/xlrd, but

Re: Books?

2012-08-22 Thread Steven D'Aprano
On Tue, 21 Aug 2012 18:36:50 -0700, Anonymous Group wrote: What books do you recomend for learning python? Preferably free and/or online. Completely by coincidence, I have just discovered, and I mean *literally* just a few minutes ago, this book:

Re: help me debug my word capitalizer script

2012-08-22 Thread Joel Goldstick
On Wed, Aug 22, 2012 at 9:00 AM, Santosh Kumar sntshkm...@gmail.com wrote: OK! The bug one fixed. Thanks to Andreas Perstinger. Let's move to Bug #2: 2. How do I escape the words that are already in uppercase? For example: The input file has this: NASA The script changes this to: Nasa

Re: Objects in Python

2012-08-22 Thread Joel Goldstick
On Wed, Aug 22, 2012 at 10:13 AM, shaun shaun.wisema...@gmail.com wrote: I'm having an issue its my first time using python and i set up a class one of the methods is supposed to return a string but instead returns: bound method Param.returnString of Param.Param instance at 0x00C 389E0 Im

Re: xlrd 0.8.0 released!

2012-08-22 Thread Chris Withers
On 22/08/2012 15:03, Hubert Holin wrote: I would like to keep up with the development but would like to know which is the repo to follow. The Python-Excel website points to https://github.com/python-excel/xlrd, but that one does not have a 0.8.0 tag (or at least did not have one when I looked a

Re: Objects in Python

2012-08-22 Thread Jussi Piitulainen
shaun writes: I'm having an issue its my first time using python and i set up a class one of the methods is supposed to return a string but instead returns: bound method Param.returnString of Param.Param instance at 0x00C 389E0 Im very new to python and the object orientated feature

Re: Objects in Python

2012-08-22 Thread Peter Otten
shaun wrote: I'm having an issue its my first time using python and i set up a class one of the methods is supposed to return a string but instead returns: bound method Param.returnString of Param.Param instance at 0x00C 389E0 Im very new to python and the object orientated feature

Re: help me debug my word capitalizer script

2012-08-22 Thread Rebelo
Let's move to Bug #2: 2. How do I escape the words that are already in uppercase? For example: The input file has this: NASA The script changes this to: Nasa Is it possible to make this script look at a word, see if its first character is capitalized, if

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated feature doesnt seem to be as well put together as Java. Can anyone help with this problem? From one Java head to another I suggest you park what you know about Java and approach Python with a clear mind.

Re: Books?

2012-08-22 Thread Virgil Stokes
On 22-Aug-2012 16:04, Steven D'Aprano wrote: On Tue, 21 Aug 2012 18:36:50 -0700, Anonymous Group wrote: What books do you recomend for learning python? Preferably free and/or online. Completely by coincidence, I have just discovered, and I mean *literally* just a few minutes ago, this book:

Re: Objects in Python

2012-08-22 Thread John Gordon
In 18409992-1e28-4721-8e64-60c69668d...@googlegroups.com shaun shaun.wisema...@gmail.com writes: I'm having an issue its my first time using python and i set up a class one of the methods is supposed to return a string but instead returns: bound method Param.returnString of Param.Param

Re: Objects in Python

2012-08-22 Thread shaun
Here is some code: //This is the object I want to create: #!/usr/bin/python import cx_Oracle import sys import time import datetime class batchParam: def __init__(self,array): self.array=array def breakuparray(self): for

Re: help me debug my word capitalizer script

2012-08-22 Thread MRAB
On 22/08/2012 09:20, Hans Mulder wrote: [snip] Alternatively, if you want to remove only the line separator, you could do: if line.endswith(linesep): line = line[:-len(linesep)] The 'if' command is only necessary for the last line, which may or may not end in a linesep.

Re: Objects in Python

2012-08-22 Thread Chris Angelico
On Thu, Aug 23, 2012 at 1:25 AM, shaun shaun.wisema...@gmail.com wrote: def breakuparray(self): for row in self.array: mer = row[0].ljust(25, ' ') merc = row[1].ljust(13, ' ') mertype = row[2]

Re: Objects in Python

2012-08-22 Thread Dave Angel
On 08/22/2012 11:25 AM, shaun wrote: Here is some code: //This is the object I want to create: #!/usr/bin/python import cx_Oracle import sys import time import datetime class batchParam: def __init__(self,array): self.array=array

Re: Objects in Python

2012-08-22 Thread MRAB
On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated feature doesnt seem to be as well put together as Java. Can anyone help with this problem? From one Java head to another I suggest you park what you know

Re: Objects in Python

2012-08-22 Thread Mark Lawrence
On 22/08/2012 16:47, Chris Angelico wrote: For what you're doing there, though, a class is overkill. Remember, Python isn't Java; the most natural way to do everything isn't necessarily to write a class that unpacks things and packs them up again in a different way. ChrisA This shows just

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 16:58, MRAB wrote: On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated feature doesnt seem to be as well put together as Java. Can anyone help with this problem? From one Java head to another I

Re: Objects in Python

2012-08-22 Thread Mark Lawrence
On 22/08/2012 17:10, lipska the kat wrote: On 22/08/12 16:58, MRAB wrote: On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated feature doesnt seem to be as well put together as Java. Can anyone help with this

writelines puzzle

2012-08-22 Thread William R. Wing (Bill Wing)
In the middle of a longer program that reads and plots data from a log file, I have added the following five lines (rtt_data is fully qualified file name): wd = open(rtt_data, 'w') stat = wd.write(str(i)) stat = wd.writelines(str(x_dates[:i])) stat = wd.writelines(str(y_rtt[:i])) wd.close() The

Filter versus comprehension (was Re: something about split()???)

2012-08-22 Thread Terry Reedy
On 8/22/2012 3:30 AM, Mark Lawrence wrote: On 22/08/2012 06:46, Terry Reedy wrote: On 8/21/2012 11:43 PM, mingqiang hu wrote: why filter is bad when use lambda ? Inefficient, not 'bad'. Because the equivalent comprehension or generator expression does not require a function call. for each

Re: writelines puzzle

2012-08-22 Thread Chris Kaynor
Reading your post, I do not see for sure what your actual issue is, so I am taking my best guess: that the file does not contain as much data as would be expected. On Wed, Aug 22, 2012 at 8:38 AM, William R. Wing (Bill Wing) w...@mac.com wrote: In the middle of a longer program that reads and

Re: writelines puzzle

2012-08-22 Thread Joel Goldstick
On Wed, Aug 22, 2012 at 11:38 AM, William R. Wing (Bill Wing) w...@mac.com wrote: In the middle of a longer program that reads and plots data from a log file, I have added the following five lines (rtt_data is fully qualified file name): wd = open(rtt_data, 'w') stat = wd.write(str(i)) stat

Re: Objects in Python

2012-08-22 Thread Terry Reedy
On 8/22/2012 10:59 AM, lipska the kat wrote: There is no real enforced concept of information hiding, no binding of type to variable in fact no concept of typing at all as far as I can see. Given that type(valid_name) always returns a type(class), that is a slightly strange statement. What

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 17:30, Mark Lawrence wrote: On 22/08/2012 17:10, lipska the kat wrote: On 22/08/12 16:58, MRAB wrote: On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated feature doesnt seem to be as well put together

Re: writelines puzzle

2012-08-22 Thread Jerry Hill
On Wed, Aug 22, 2012 at 11:38 AM, William R. Wing (Bill Wing) w...@mac.com wrote: Much to my surprise, when I looked at the output file, it only contained 160 characters. Catting produces: StraylightPro:Logs wrw$ cat RTT_monitor.dat 2354[ 734716.72185185 734716.72233796 734716.72445602

Re: Objects in Python

2012-08-22 Thread Ian Kelly
In addition to the excellent feedback that Dave gave you: On Wed, Aug 22, 2012 at 9:25 AM, shaun shaun.wisema...@gmail.com wrote: def breakuparray(self): for row in self.array: mer = row[0].ljust(25, ' ') merc =

How to properly implement worker processes

2012-08-22 Thread Dennis Jacobfeuerborn
Hi, I'm trying to implement a system for periodically checking URLs and I've run into problems with some of the implementation details. The URLs are supposed to be checked continuously until the config for an URL is explicitly removed. The plan is to spawn a worker process for each URL that

Re: help me debug my word capitalizer script

2012-08-22 Thread Terry Reedy
On 8/22/2012 10:46 AM, Rebelo wrote: Is it possible to make this script look at a word, see if its first character is capitalized, if capitalized then skip that word. Unicode has two 'capital' concepts: 'uppercase' and 'titlecase'. They are the same for latin chars but not for all alphabets.

Re: writelines puzzle

2012-08-22 Thread Peter Otten
William R. Wing (Bill Wing) wrote: In the middle of a longer program that reads and plots data from a log file, I have added the following five lines (rtt_data is fully qualified file name): wd = open(rtt_data, 'w') stat = wd.write(str(i)) stat = wd.writelines(str(x_dates[:i])) stat =

Re: How to properly implement worker processes

2012-08-22 Thread Ian Kelly
On Wed, Aug 22, 2012 at 11:29 AM, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: Hi, I'm trying to implement a system for periodically checking URLs and I've run into problems with some of the implementation details. The URLs are supposed to be checked continuously until the config

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 18:01, Terry Reedy wrote: On 8/22/2012 10:59 AM, lipska the kat wrote: There is no real enforced concept of information hiding, no binding of type to variable in fact no concept of typing at all as far as I can see. Given that type(valid_name) always returns a type(class), that

Re: Objects in Python

2012-08-22 Thread Mark Lawrence
On 22/08/2012 18:06, lipska the kat wrote: On 22/08/12 17:30, Mark Lawrence wrote: On 22/08/2012 17:10, lipska the kat wrote: On 22/08/12 16:58, MRAB wrote: On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Im very new to python and the object orientated

Re: Objects in Python

2012-08-22 Thread Ian Kelly
On Wed, Aug 22, 2012 at 11:46 AM, lipska the kat lipskathe...@yahoo.co.uk wrote: If, in a language, I find I am able to say a = 1 then later, in the same scope I can say a = foo then later again in the same scope I can say a = ([1,2,3], xyz, True) then, and I may be missing something

Re: PyCrypto builds neither with MSVC nor MinGW

2012-08-22 Thread bikewave
I also had the unresolved externals problem (not the mdir.h problem, though) and my solution was different. a) reinstall correct python2.6.4, using an Intel-flavor msi vice AMD64-flavor b) source the c:\program files(x86\microsoft visual studio 9.0\vc\bin\vcvars32.bat and shazzm the pycrypto

Re: Objects in Python

2012-08-22 Thread Mark Lawrence
On 22/08/2012 18:46, lipska the kat wrote: On 22/08/12 18:01, Terry Reedy wrote: On 8/22/2012 10:59 AM, lipska the kat wrote: There is no real enforced concept of information hiding, no binding of type to variable in fact no concept of typing at all as far as I can see. Given that

Re: PyCrypto builds neither with MSVC nor MinGW

2012-08-22 Thread Dave Angel
On 08/22/2012 02:21 PM, bikewave wrote: I also had the unresolved externals problem (not the mdir.h problem, though) and my solution was different. a) reinstall correct python2.6.4, using an Intel-flavor msi vice AMD64-flavor b) source the c:\program files(x86\microsoft visual studio

Re: How do I display unicode value stored in a string variable using ord()

2012-08-22 Thread Hans Mulder
On 19/08/12 19:48:06, Paul Rubin wrote: Terry Reedy tjre...@udel.edu writes: py s = chr(0x + 1) py a, b = s That looks like a 3.2- narrow build. Such which treat unicode strings as sequences of code units rather than sequences of codepoints. Not an implementation bug, but

Re: writelines puzzle

2012-08-22 Thread William R. Wing (Bill Wing)
On Aug 22, 2012, at 12:48 PM, Chris Kaynor ckay...@zindagigames.com wrote: Reading your post, I do not see for sure what your actual issue is, so I am taking my best guess: that the file does not contain as much data as would be expected. Sorry, I should have been more explicit. The value

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 19:15, Ian Kelly wrote: On Wed, Aug 22, 2012 at 11:46 AM, lipska the kat lipskathe...@yahoo.co.uk wrote: If, in a language, I find I am able to say a = 1 [snip] You're conflating strong typing with static typing. Strong typing does not refer to restrictions on what type of

Re: Re: Objects in Python

2012-08-22 Thread Evan Driscoll
On 08/22/2012 12:46 PM, lipska the kat wrote: If you can show me a 'type' that cannot be assigned to a in the same scope then I would be most interested to know, I haven't found one yet. As other people have said, you've just pointed out the difference between static typing and dynamic

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 19:07, Mark Lawrence wrote: On 22/08/2012 18:06, lipska the kat wrote: On 22/08/12 17:30, Mark Lawrence wrote: On 22/08/2012 17:10, lipska the kat wrote: On 22/08/12 16:58, MRAB wrote: On 22/08/2012 15:59, lipska the kat wrote: On 22/08/12 15:13, shaun wrote: [snip] Maybe

Re: writelines puzzle

2012-08-22 Thread Dave Angel
On 08/22/2012 02:00 PM, William R. Wing (Bill Wing) wrote: On Aug 22, 2012, at 12:48 PM, Chris Kaynor ckay...@zindagigames.com wrote: Reading your post, I do not see for sure what your actual issue is, so I am taking my best guess: that the file does not contain as much data as would be

Re: writelines puzzle

2012-08-22 Thread William R. Wing (Bill Wing)
On Aug 22, 2012, at 1:28 PM, Jerry Hill malaclyp...@gmail.com wrote: On Wed, Aug 22, 2012 at 11:38 AM, William R. Wing (Bill Wing) w...@mac.com wrote: Much to my surprise, when I looked at the output file, it only contained 160 characters. Catting produces: StraylightPro:Logs wrw$ cat

Re: How to properly implement worker processes

2012-08-22 Thread Dennis Jacobfeuerborn
On Wednesday, August 22, 2012 7:46:34 PM UTC+2, Ian wrote: On Wed, Aug 22, 2012 at 11:29 AM, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: Hi, I'm trying to implement a system for periodically checking URLs and I've run into problems with some of the implementation details.

Re: Objects in Python

2012-08-22 Thread lipska the kat
On 22/08/12 20:03, Evan Driscoll wrote: On 08/22/2012 12:46 PM, lipska the kat wrote: If you can show me a 'type' that cannot be assigned to a in the same scope then I would be most interested to know, I haven't found one yet. [snip] Second, this concept isn't *so* unfamiliar to you. If

Re: Objects in Python

2012-08-22 Thread MRAB
On 22/08/2012 20:45, lipska the kat wrote: On 22/08/12 20:03, Evan Driscoll wrote: On 08/22/2012 12:46 PM, lipska the kat wrote: If you can show me a 'type' that cannot be assigned to a in the same scope then I would be most interested to know, I haven't found one yet. [snip] Second,

Re: Objects in Python

2012-08-22 Thread Mark Lawrence
On 22/08/2012 21:31, MRAB wrote: On 22/08/2012 20:45, lipska the kat wrote: compare this to a function declaration in Python def foo(self): [snip] That's not actually a declaration but a definition. :-) The function's body is bound to the name at runtime, so: def double_it(x):

Re: How to properly implement worker processes

2012-08-22 Thread Ian Kelly
On Wed, Aug 22, 2012 at 1:40 PM, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: I was thinking about something like that but the issue is that this really only works when you don't do any actual blocking work. I may be able to get around the sleep() but then I have to fetch the URL or

Re: Re: Objects in Python

2012-08-22 Thread Evan Driscoll
On 08/22/2012 02:45 PM, lipska the kat wrote: On 22/08/12 20:03, Evan Driscoll wrote: Second, this concept isn't *so* unfamiliar to you. If I give you the following Java code: void foo(Object o) { ... } looking at this method declaration I can see that the method takes an argument of

Re: Objects in Python

2012-08-22 Thread Ben Finney
lipska the kat lipskathe...@yahoo.co.uk writes: If, in a language, I find I am able to say a = 1 then later, in the same scope I can say a = foo then later again in the same scope I can say a = ([1,2,3], xyz, True) then, and I may be missing something here, to me, that doesn't say

Re: Objects in Python

2012-08-22 Thread Ian Kelly
On Wed, Aug 22, 2012 at 5:58 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Those people are confused, then. Python is strongly typed: objects always know their type, the type is always exact, and the type of an object can't be changed. Except when it can. class A: pass ... class B: pass

Re: Objects in Python

2012-08-22 Thread Walter Hurry
On Wed, 22 Aug 2012 18:46:43 +0100, lipska the kat wrote: Well I'm a beginner Then maybe you should read more and write less. -- http://mail.python.org/mailman/listinfo/python-list

Re: Objects in Python

2012-08-22 Thread Chris Angelico
On Thu, Aug 23, 2012 at 5:03 AM, lipska the kat lipskathe...@yahoo.co.uk wrote: On 22/08/12 19:15, Ian Kelly wrote: You're conflating strong typing with static typing. Strong typing does not refer to restrictions on what type of data can be stored where, but to restrictions on how operations

Re: How to properly implement worker processes

2012-08-22 Thread Dennis Jacobfeuerborn
On Wednesday, August 22, 2012 11:15:10 PM UTC+2, Ian wrote: On Wed, Aug 22, 2012 at 1:40 PM, Dennis Jacobfeuerborn djacobfeuerb...@gmail.com wrote: I was thinking about something like that but the issue is that this really only works when you don't do any actual blocking work. I may be

Methods versus functions [was Re: Objects in Python]

2012-08-22 Thread Steven D'Aprano
On Wed, 22 Aug 2012 21:46:29 +0100, Mark Lawrence wrote: On 22/08/2012 20:45, lipska the kat wrote: compare this to a function declaration in Python def foo(self): [...] Looking at the self I'm assuming that's a method and not a function. Actually, it is a function. It doesn't get turned

Re: Objects in Python

2012-08-22 Thread Steven D'Aprano
On Thu, 23 Aug 2012 12:02:16 +1000, Chris Angelico wrote: 2) Related to the above, you can infinitely nest scopes. There's nothing wrong with having six variables called 'q'; you always use the innermost one. Yes, this can hurt readability Well, there you go. There *is* something wrong with

Re: Objects in Python

2012-08-22 Thread Steven D'Aprano
On Wed, 22 Aug 2012 18:46:43 +0100, lipska the kat wrote: We need to separate out the 'view' from the 'implementation' here. Most developers I know, if looking at the code and without the possibly dubious benefit of knowing that in Python 'everything is an object' would not call this 'strong

Re: Re: Objects in Python

2012-08-22 Thread Evan Driscoll
On 8/22/2012 18:58, Ben Finney wrote: You haven't discovered anything about types; what you have discovered is that Python name bindings are not variables. In fact, Python doesn't have variables – not as C or Java programmers would understand the term. What it has instead are references to

Re: Objects in Python

2012-08-22 Thread Chris Angelico
On Thu, Aug 23, 2012 at 2:11 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 23 Aug 2012 12:02:16 +1000, Chris Angelico wrote: 2) Related to the above, you can infinitely nest scopes. There's nothing wrong with having six variables called 'q'; you always use the

Re: Re: Objects in Python

2012-08-22 Thread Chris Angelico
On Thu, Aug 23, 2012 at 2:49 PM, Evan Driscoll drisc...@cs.wisc.edu wrote: On 8/22/2012 18:58, Ben Finney wrote: You haven't discovered anything about types; what you have discovered is that Python name bindings are not variables. In fact, Python doesn't have variables – not as C or Java

[issue15746] test_winsound bombing out on 2003 buildslave

2012-08-22 Thread Trent Nelson
Trent Nelson added the comment: Affirmative: E:\Apps\activestate-python-2.7.2.5-x86python ActivePython 2.7.2.5 (ActiveState Software Inc.) based on Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information.

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: What's the purpose of the new patch, particularly 2/2 since it is equivalent to multiple push() calls? I.e. since this issue has laid dormant for two years, what prompts the sudden activity? -- ___ Python

[issue1207589] Right Click Context Menu

2012-08-22 Thread Nashev
Nashev added the comment: display assigned hot keys in popup menu is must-have feature, that allow users to teach them while using commands by menu or by context menu. For examples look Delphi IDE -- ___ Python tracker rep...@bugs.python.org

[issue15316] runpy swallows ImportError information with relative imports

2012-08-22 Thread Chris Jerdonek
Chris Jerdonek added the comment: Should this issue be fixed before the release? If it is not fixed, certain problems found after the release may become harder to report and diagnose (because the true source of error will be masked). Two months ago issue 15111 which was thought to be the

[issue5088] optparse: inconsistent default value for append actions

2012-08-22 Thread Louis Deflandre
Louis Deflandre added the comment: Hello, Tell me if the issue is too old to deserve comments anymore. But I would like to challenge the conclusion made in this issue. The message msg9944 stated Think of the default as the initial list but it is inconsistent with the proper meaning of

[issue10852] SSL/TLS sni use in smtp, pop, imap, nntp, ftp client libs by default

2012-08-22 Thread danblack
danblack added the comment: Thanks for the patch Daniel. 3.3 is nearing the release candidate phase, so I'm re-targetting to 3.4. I'll take a detailed look soon. Welcome. Just noticed conflicts with #4473 in the client POP implementation. Hopefully they are close anyway. (I suppose

[issue14292] OS X installer build script doesn't set $CXX, so it ends up as c++

2012-08-22 Thread Ronald Oussoren
Ronald Oussoren added the comment: The attached patch sets not just 'CC' but 'CXX' as well. I haven't tested the patch beyond building on an OSX 10.8 system (that is, the primary use of the script is not tested) -- ___ Python tracker

[issue7741] Allow multiple statements in code.InteractiveConsole.push

2012-08-22 Thread Nick Coghlan
Nick Coghlan added the comment: Aaron was looking for something to work on for the PyConAU sprints, and set himself the task of closing as many issues related to the code module as possible. The main outcome of that was the new test suite added in #12643, which should make it easier to work

[issue15757] ./configure --with-pydebug on FreeBSD results in -O2 -pipe eventually ending up in CFLAGS.

2012-08-22 Thread Stefan Krah
Stefan Krah added the comment: So, looks like FreeBSD's /usr/share/mk/sys.mk is to blame here. It unconditionally sets CFLAGS to `-O2 -pipe`. I've been debugging this once, too. My conclusion was that if the OS is set up that way, we shouldn't do anything about it in the Python source tree.

[issue14292] OS X installer build script doesn't set $CXX, so it ends up as c++

2012-08-22 Thread Ronald Oussoren
Changes by Ronald Oussoren ronaldousso...@mac.com: Added file: http://bugs.python.org/file26957/issue14292.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14292 ___

  1   2   >