Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Peter Cacioppi
I don't know if I want to step into the flames here, but my understanding has always been that in the absence of polymorphism the best you can do is "object based" programming instead of "object oriented" programming. Object based programming is a powerful step forward. The insight that by asso

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Steve Hayes
On 17 Oct 2013 05:48:10 GMT, Steven D'Aprano wrote: >On Thu, 17 Oct 2013 00:22:47 -0400, random832 wrote: > >> While this flippant usage of "Nazi" (based on, as I understand it, >> Seinfeld's "soup nazi") may be offensive, it has nothing to do with >> sexism. If the scope of this discussion is to

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Steven D'Aprano
On Thu, 17 Oct 2013 00:22:47 -0400, random832 wrote: > While this flippant usage of "Nazi" (based on, as I understand it, > Seinfeld's "soup nazi") may be offensive, it has nothing to do with > sexism. If the scope of this discussion is to be offensive module names > generally, then the subject li

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Steven D'Aprano
On Wed, 16 Oct 2013 17:53:22 -0700, Mark Janssen wrote: >> And your earlier idea that punched cards didn't have tokens is wildly >> ignorant of the state of software and languages 50 years ago. > > Please tell me how you parsed tokens with binary switches 50 years ago. > Your input is rubbish.

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Ben Finney
Owen Jacobson writes: > 1. What social biases and problems *do* we unwittingly encourage by > way of community-tolerated behaviour? This is a well-worded good question, and I'd like to draw a connection with another one you ask: > 3. How can we reach out to the Ruby community and help *them* ge

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Devin Jeanpierre
On Wed, Oct 16, 2013 at 8:13 PM, Owen Jacobson wrote: -snip- > 1. What social biases and problems *do* we unwittingly encourage by way of > community-tolerated behaviour? Where, if not through the conventions for > naming, do we encourage sexism, racism, and other mindlessly exclusionary > behavio

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread random832
On Wed, Oct 16, 2013, at 23:13, Owen Jacobson wrote: > > * therapist - yeah, It passes as a double meaning - but still. Or a single meaning. Who's to say the person who wrote the module even had any idea it could be read otherwise? > > * shag Something to do with carpet? > > * db_nazi See belo

Sexism in the Ruby community: how does the Python community manage it?

2013-10-16 Thread Owen Jacobson
Last week, Elad Maidar wrote a fairly short but readable opinion piece[0] illustrating some long-standing social problems in the Ruby community, ending with a very specific call to action around naming conventions for Ruby projects and gems. To save you the trouble of scrolling to the bottom of

Re: Python was designed

2013-10-16 Thread Piet van Oostrum
Mark Janssen writes: >> And your earlier idea that punched cards didn't have tokens is wildly >> ignorant of the state of software and languages 50 years ago. > > Please tell me how you parsed tokens with binary switches 50 years > ago. Your input is rubbish. With all due respect, Mark, your re

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Ned Batchelder
On 10/16/13 8:53 PM, Mark Janssen wrote: And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. The mention of punched ca

Re: Markers on a matplotlib plot

2013-10-16 Thread Brandon La Porte
On Wednesday, 16 October 2013 18:31:09 UTC-4, Mark Lawrence wrote: > On 16/10/2013 22:34, Brandon La Porte wrote: > > > I have the following code to make a plot of 4 different supply curves > > (economics). > > > > > > > > > from matplotlib import pyplot as plt > > > > > > price = range(0,5

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread rusi
On Thursday, October 17, 2013 6:17:57 AM UTC+5:30, Ned Batchelder wrote: > On 10/16/13 8:13 PM, Mark Janssen wrote: > > > Who uses "object abstraction" in C? No one. That's why C++ was > > invented. Examples from 1. Linux Kernel 2. Python 3. OS/2 > > But, here it is significant that

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
On Thu, 2013-10-17 at 11:46 +1100, Chris Angelico wrote: > On Thu, Oct 17, 2013 at 11:43 AM, MRAB wrote: > > I'm guessing, but perhaps you need: > > > > instance = getattr(self, "%s" % key) > > How's that different from getattr(self,str(key))? > > ChrisA I get the string of CheckBox instead

Merging xls into a common one

2013-10-16 Thread John Mathew
This code works fine when there are xls in which Row has One column, but not when Row has more column. The expectation is to merge the different xls into a common one. Can somebody please help. import xlwt import xlrd import sys #Create workbook and worksheet wbk = xlwt.Workbook() dest_sheet = w

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:53 AM, Mark Janssen wrote: >> And your earlier idea that punched cards didn't have tokens is wildly >> ignorant of the state of software and languages 50 years ago. > > Please tell me how you parsed tokens with binary switches 50 years > ago. Your input is rubbish. I c

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
> And your earlier idea that punched cards didn't have tokens is wildly > ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. -- MarkJ Tacoma, Washington -- https://mail.python.org/mailman/l

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh writes: > You say right, but i don't any time to read all of content of > http://sscce.org/ , But when i saw its description , i found out , > it's a set of law for good answer/question That's right. Please take the time to help us to help you, by following that advice. > A

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Ned Batchelder
On 10/16/13 8:13 PM, Mark Janssen wrote: Who uses "object abstraction" in C? No one. That's why C++ was invented. If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Or huge slabs of the OS/2 Presentation Manager, which is entirely object oriented and most

Re: how to add object from dict

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:43 AM, MRAB wrote: > I'm guessing, but perhaps you need: > > instance = getattr(self, "%s" % key) How's that different from getattr(self,str(key))? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: how to add object from dict

2013-10-16 Thread MRAB
On 16/10/2013 23:14, Mohsen Pahlevanzadeh wrote: Dear all, I have the following code in projects.py: ##33 for row in xrange(len(uniqueFields)): instance = QtGui.QCheckBox(uniqueFields[row]) projectsFindInstance.projectsInstan

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
You say right, but i don't any time to read all of content of http://sscce.org/ , But when i saw its description , i found out , it's a set of law for good answer/question, Also i saw PEP 8 , it's like old style C, and i like CamelCase. But now, all of my code doesn't work and related to the given

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread alex23
On 17/10/2013 3:57 AM, Mark Janssen wrote: Who uses "object abstraction" in C? No one. That's why C++ was invented. "Aristotle maintained that women have fewer teeth than men; although he was twice married, it never occurred to him to verify this statement by examining his wives' mouths." -

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 11:13 AM, Mark Janssen wrote: > But, here it is significant that the user /consumer (i.e. *at the > workstation* mind you) is *making* the "object" because thier visual > system turns it into one. Otherwise, at the C-level, I'm guessing > it's normal C code without objects

Re: converting letters to numbers

2013-10-16 Thread Oscar Benjamin
On Oct 16, 2013 11:54 PM, "MRAB" wrote: > > On 16/10/2013 23:39, Rotwang wrote: >> >> On 14/10/2013 06:02, Steven D'Aprano wrote: >>> >>> On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: >>> def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 >

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh writes: > Thank you for your useful link , i paste my code into [an external > pastebin service] I'm glad you liked the link, but you haven't followed its advice :-) Also, pointing us to a pastebin is not helpful. Please use a user-agent that won't mangle your code so you c

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
Who uses "object abstraction" in C? No one. That's why C++ was invented. >>> >> If not, Linux, how about Python? >> >> http://hg.python.org/cpython/file/e2a411a429d6/Objects > > Or huge slabs of the OS/2 Presentation Manager, which is entirely > object oriented and mostly C. It's done with S

Re: how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
On Thu, 2013-10-17 at 10:45 +1100, Ben Finney wrote: > Mohsen Pahlevanzadeh writes: > > > and another file,(projectsFind.py) i have the following code: > > #3 > > for key, val in > > self.projectsInstance.addOnFieldsInstance.

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Ben Finney
"Skybuck Flying" writes: > version 0.01 created on 17 october 2013 by Skybuck Flying. Thanks for writing your essay, but it's rather too long and context-free to make a good post here. Could you please post it on your weblog instead? -- \ “Beware of and eschew pompous prolixity.” —Charle

Re: how to add object from dict

2013-10-16 Thread Ben Finney
Mohsen Pahlevanzadeh writes: > and another file,(projectsFind.py) i have the following code: > #3 > for key, val in > self.projectsInstance.addOnFieldsInstance.items(): > instance = getattr(self,"%s" % val) >

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Skybuck Flying
One final example plus further analysis to be perfectly clear what fine code would look like and why it's adventage: At the bottom I come to the conclusion that the proposed loop construct with begin and ending conditions has merit after all ! ;) =D LoopBegin if not BeginningCondition the

Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-10-16 Thread Skybuck Flying
version 0.01 created on 17 october 2013 by Skybuck Flying. (after having some experience with python which lacks repeat until/goto/labels and programming game bots) (the exit conditions described below prevent having to use logic inversion: while BeginCondition and not EndCondition <- ugly logic

how to add object from dict

2013-10-16 Thread Mohsen Pahlevanzadeh
Dear all, I have the following code in projects.py: ##33 for row in xrange(len(uniqueFields)): instance = QtGui.QCheckBox(uniqueFields[row]) projectsFindInstance.projectsInstance.addOnFieldsInstance.update({"%s" % uniqueFields[ro

Testing BlockHosts

2013-10-16 Thread T . h . i . r . d_3y3
Hello Can somebody tell me how I can test BockHosts? I want to see if an IP address gets blocked or not, as I have to provide evidence of testing for a presentation. Any help will be greatly appreciated, thank you -- https://mail.python.org/mailman/listinfo/python-list

Executing a Python application (was: Python TkInter, GTK, GUI overall)

2013-10-16 Thread Ben Finney
Andreas Ecaz writes: > This might seem like a stupid question, but, how do people run the > application? I get that I have to compile it and make it an > executable. But how do I make it an executable? For Windows and Linux? This isn't a question about GUIs, but about making a program executable

Re: converting letters to numbers

2013-10-16 Thread MRAB
On 16/10/2013 23:39, Rotwang wrote: On 14/10/2013 06:02, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65

Re: converting letters to numbers

2013-10-16 Thread Rotwang
On 14/10/2013 06:02, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65) Python uses # for comments, not %

Re: Markers on a matplotlib plot

2013-10-16 Thread Mark Lawrence
On 16/10/2013 22:34, Brandon La Porte wrote: I have the following code to make a plot of 4 different supply curves (economics). from matplotlib import pyplot as plt price = range(0,51) q1 = [x/2.0 for x in price] q2 = [x/4.0 for x in price] q3 = [x/5.0 for x in price] q4 = [x/10.0 for x in pr

Markers on a matplotlib plot

2013-10-16 Thread Brandon La Porte
I have the following code to make a plot of 4 different supply curves (economics). from matplotlib import pyplot as plt price = range(0,51) q1 = [x/2.0 for x in price] q2 = [x/4.0 for x in price] q3 = [x/5.0 for x in price] q4 = [x/10.0 for x in price] markers_on = [20, 40] plt.plot(q1,price,

Python TkInter, GTK, GUI overall

2013-10-16 Thread Andreas Ecaz
I've been looking at TkInter and GTK to do some GUI programming, they're both cross-platform compatible. This might seem like a stupid question, but, how do people run the application? I get that I have to compile it and make it an executable. But how do I make it an executable? For Windows and

Re: How pickle helps in reading huge files?

2013-10-16 Thread Irmen de Jong
On 16-10-2013 23:04, Peter Cacioppi wrote: > On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote: >> I've a huge csv file and I want to read stuff from it again and again. Is it >> useful >> to pickle it and keep and then unpickle it whenever I need to use that data? >> Is it >> faste

Re: How pickle helps in reading huge files?

2013-10-16 Thread Peter Cacioppi
On Tuesday, October 15, 2013 11:55:26 PM UTC-7, Harsh Jha wrote: > I've a huge csv file and I want to read stuff from it again and again. Is it > useful to pickle it and keep and then unpickle it whenever I need to use that > data? Is it faster that accessing that file simply by opening it again

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Chris Angelico
On Thu, Oct 17, 2013 at 5:49 AM, Skip Montanaro wrote: >>> Who uses "object abstraction" in C? No one. That's why C++ was invented. >> >> I wonder if you've heard of something called linux? >> http://lwn.net/Articles/444910/ > > If not, Linux, how about Python? > > http://hg.python.org/cpython/f

Re: converting letters to numbers

2013-10-16 Thread Piet van Oostrum
Charles Hixson writes: > On 10/13/2013 10:02 PM, Steven D'Aprano wrote: >> On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: >> >>> def add(c1, c2): >>> % Decode >>> c1 = ord(c1) - 65 >>> c2 = ord(c2) - 65 >>> % Process >>> i1 = (c1 + c2) % 26 >>> % Encode

Re: converting letters to numbers

2013-10-16 Thread Charles Hixson
On 10/13/2013 10:02 PM, Steven D'Aprano wrote: On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote: def add(c1, c2): % Decode c1 = ord(c1) - 65 c2 = ord(c2) - 65 % Process i1 = (c1 + c2) % 26 % Encode return chr(i1+65) Python uses # for comments, not

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Skip Montanaro
>> Who uses "object abstraction" in C? No one. That's why C++ was invented. > > I wonder if you've heard of something called linux? > http://lwn.net/Articles/444910/ If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Skip -- https://mail.python.org/mailman

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Grant Edwards
On 2013-10-16, Mark Janssen wrote: Types on the other hand correspond to our classifications and so are things in our minds. >>> >>> That is not how a C programmer views it. They have explicit >>> "typedef"s that make it a thing for the computer. >> >> Speaking as a C programmer, no. W

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Grant Edwards
On 2013-10-16, Mark Janssen wrote: > On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards > wrote: >> On 2013-10-15, Mark Janssen wrote: >> >>> Yeah, well 40 years ago they didn't have parsers. >> >> That seems an odd thing to say. People were assembling and compiling >> computer programs long before

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread rusi
On Wednesday, October 16, 2013 11:27:03 PM UTC+5:30, zipher wrote: > >>> Types on the other hand correspond to our classifications and so are > >>> things in our minds. > >> > >> That is not how a C programmer views it. They have explicit > >> "typedef"s that make it a thing for the computer. > >

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
>>> Types on the other hand correspond to our classifications and so are >>> things in our minds. >> >> That is not how a C programmer views it. They have explicit >> "typedef"s that make it a thing for the computer. > > Speaking as a C programmer, no. We have explicit typedefs to create new > la

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards wrote: > On 2013-10-15, Mark Janssen wrote: > >> Yeah, well 40 years ago they didn't have parsers. > > That seems an odd thing to say. People were assembling and compiling > computer programs long before 1973. I'm using the word "parser" in the sens

Re: urllib2 timeout issue

2013-10-16 Thread Tobiah
If run on my Debian Wheezy computer, or on my Debian Squeeze server, the answer is instantaneous : [...] urllib2.URLError: When run on my Raspberry Pi with Raspian Wheezy, the answer is identical but it takes 10 seconds. What happens when you use ping to resolve that address. Do you get th

Re: urllib2 timeout issue

2013-10-16 Thread Tim Chase
On 2013-10-16 13:22, Peter Otten wrote: > The problem might be ipv6-related. I second this as the likely culprit -- I've had to disable IPv6 on my Debian laptop since my AT&T router is brain-dead and doesn't seem to support it, so I would often get timeouts similar to what is the OP describes and

Re: How pickle helps in reading huge files?

2013-10-16 Thread Roy Smith
In article <0044bfd0-f07f-4f7b-b976-5df034b6f...@googlegroups.com>, Harsh Jha wrote: > I've a huge csv file and I want to read stuff from it again and again. Is it > useful to pickle it and keep and then unpickle it whenever I need to use that > data? Is it faster that accessing that file simp

Re: Complex literals (was Re: I am never going to complain about Python again)

2013-10-16 Thread Roy Smith
In article , John Nagle wrote: > Then upgrade to 3D. You can represent latitude and longitude > as a 3-element unit vector. (GPS systems do this; latitude and > longitude are only generated at the end, for output.) And annoyingly so. Somebody I know was building a tracking system based on a

Re: urllib2 timeout issue

2013-10-16 Thread Piet van Oostrum
Jérôme writes: > Hi all. > > I'm having troubles with urllib2 timeout. > > See the following script : > > > import urllib2 > result = urllib2.urlopen("http://dumdgdfgdgmyurl.com/";) > print result.readline() > > > If run on my Debian Wheez

Re: http://pycam.sourceforge.net/

2013-10-16 Thread vinny
"Erminio Ottone" wrote in message news:20131013114826.1419.6522.XPN@sator... Would you like to become a developer of this program ? http://pycam.sourceforge.net/ machines stl models? The problem with stl is its just triangles. Video game stuff. Iv'e machined stl models, only to realize th

Re: urllib2 timeout issue

2013-10-16 Thread Peter Otten
Jérôme wrote: > Hi all. > > I'm having troubles with urllib2 timeout. > > See the following script : > > > import urllib2 > result = urllib2.urlopen("http://dumdgdfgdgmyurl.com/";) > print result.readline() > > > If run on my Debian Whe

Re: urllib2 timeout issue

2013-10-16 Thread Vincent Vande Vyvre
Le 16/10/2013 11:21, Jérôme a écrit : Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen("http://dumdgdfgdgmyurl.com/";) print result.readline() If run on my Debian Whee

urllib2 timeout issue

2013-10-16 Thread Jérôme
Hi all. I'm having troubles with urllib2 timeout. See the following script : import urllib2 result = urllib2.urlopen("http://dumdgdfgdgmyurl.com/";) print result.readline() If run on my Debian Wheezy computer, or on my Debian Squeeze ser

Re: How pickle helps in reading huge files?

2013-10-16 Thread Chris Angelico
On Wed, Oct 16, 2013 at 7:51 PM, rusi wrote: > On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote: >> Keep it in memory > > Thats a strange answer given that the OP says his file is huge. > Of course 'huge' may not really be huge -- that really depends on the h/w > he's us

Re: How pickle helps in reading huge files?

2013-10-16 Thread rusi
On Wednesday, October 16, 2013 12:35:42 PM UTC+5:30, Stéphane Wirtel wrote: > Keep it in memory Thats a strange answer given that the OP says his file is huge. Of course 'huge' may not really be huge -- that really depends on the h/w he's using. -- https://mail.python.org/mailman/listinfo/pytho

Re: How pickle helps in reading huge files?

2013-10-16 Thread Mark Lawrence
On 16/10/2013 07:55, Harsh Jha wrote: I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again and again? Please explain, why

Re: How pickle helps in reading huge files?

2013-10-16 Thread Stephane Wirtel
Keep it in memory > On 16 oct. 2013, at 08:55 AM, Harsh Jha wrote: > > I've a huge csv file and I want to read stuff from it again and again. Is it > useful to pickle it and keep and then unpickle it whenever I need to use that > data? Is it faster that accessing that file simply by opening i

How pickle helps in reading huge files?

2013-10-16 Thread Harsh Jha
I've a huge csv file and I want to read stuff from it again and again. Is it useful to pickle it and keep and then unpickle it whenever I need to use that data? Is it faster that accessing that file simply by opening it again and again? Please explain, why? Thank you. -- https://mail.python.or