Python Bootcamp - Last week to Register (June 20-24, 2011)

2011-06-14 Thread Chander Ganesan
Just a reminder that there are only 3 weeks remaining to register for the Open Technology Group's Python Bootcamp, a 5 day hands-on, intensive, in-depth introduction to Python. This course is confirmed and guaranteed to run. Not up for summer travel? Attend the hands-on, instructor-led class

Leo 4.9 b4 released

2011-06-14 Thread Edward K. Ream
Leo 4.9 b4 is now available at: http://sourceforge.net/projects/leo/files/ If you have trouble downloading, please do try an alternate mirror. Unless serious problems are reported, expect Leo 4.9 rc1 this Friday, June 17 and 4.9 final on Tuesday, June 21. Leo is a text editor, data organizer,

Wing IDE 4.0.3 released

2011-06-14 Thread Wingware
Hi, Wingware has released version 4.0.3 of Wing IDE, an integrated development environment designed specifically for the Python programming language. Wing IDE is a cross-platform Python IDE that provides a professional code editor with vi, emacs, and other key bindings, auto-completion, call

Re: Binding was Re: Function declarations ?

2011-06-14 Thread Ethan Furman
Patty wrote: So I am wondering if you learned this in Computer Science or Computer Engineering?, on the job? I learned it on this list. :) ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Xah Lee
On Jun 13, 6:45 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Chris Angelico wrote: And did any of the studies take into account the fact that a lot of computer users - in all but the purest data entry tasks - will use a mouse as well as a keyboard? What I think's really stupid is

Rant on web browsers

2011-06-14 Thread Chris Angelico
Random rant and not very on-topic. Feel free to hit Delete and move on. I've just spent a day coding in Javascript, and wishing browsers supported Python instead (or as well). All I needed to do was take two dates (as strings), figure out the difference in days, add that many days to both dates,

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Xah Lee
On Jun 13, 6:19 am, Steven D'Aprano 〔steve +comp.lang.pyt...@pearwood.info〕 wrote: │ I don't know if there are any studies that indicate how much of a │ programmer's work is actual mechanical typing but I'd be surprised if it │ were as much as 20% of the work day. The rest of the time being

Re: Keyboard Layout: Dvorak vs. Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Xah Lee
Ba Wha 13, 7:23 nz, Ehfgbz Zbql 〔ehfgbzcz...@tznvy.pbz〕 jebgr: │ Qibenx -- yvxr djregl naq nal bgure xrlobneq ynlbhg -- nffhzrf gur │ pbzchgre vf n glcrjevgre. │ Guvf zrnaf va rssrpg ng yrnfg gjb pbafgenvagf, arprffnel sbe gur │ glcrjevgre ohg abg sbe gur pbzchgre: │ │ n. Gur glcvfg pna glcr

Re: I want this to work. [[]] * n

2011-06-14 Thread SherjilOzair
Thanks. This works. :) Regards, Sherjil Ozair -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyboard Layout: Dvorak vs. Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Xah Lee
for some reason, was unable to post the previous message. (but can post others) So, the message is rot13'd and it works. Not sure what's up with Google groups. (this happened a few years back once. Apparantly, the message content might have something to do with it because rot13 clearly works.

Re: working with raw image files

2011-06-14 Thread Martin De Kauwe
what is a .raw file, do you mean a flat binary? -- http://mail.python.org/mailman/listinfo/python-list

ftplib: Software caused connection abort, how I solved it

2011-06-14 Thread Mad Sweeney
My program polls FTP servers at intervals for jobs to process. Its running as a service on Windows server 2000 or 2003 :-(. About 13% of times the retrbinary and less often the nlst calls would fail with Software caused connection abort. I could find no relevant solution on the intertubes. I

Re: Rant on web browsers

2011-06-14 Thread Martin P. Hellwig
On 14/06/2011 07:31, Chris Angelico wrote: cut But if anyone feels like writing an incompatible browser, please can you add Python scripting? You might find that Pyjamas already fill your needs python/javascript wise. It is truly great to just write python, translate it, and then have it

Re: Rant on web browsers

2011-06-14 Thread Chris Angelico
On Tue, Jun 14, 2011 at 6:39 PM, Martin P. Hellwig martin.hell...@gmail.com wrote: On 14/06/2011 07:31, Chris Angelico wrote: cut But if anyone feels like writing an incompatible browser, please can you add Python scripting? You might find that Pyjamas already fill your needs

UPnP client

2011-06-14 Thread Nikos Fotoulis
Hi. Recently i needed some code to be able to listen on the public IP address outside my modem router. Eventually, i came up with a minimal UPnP implementation and because it seems to work and i'm happy about it, i've decided to post it here at clpy in case anybody else may have a use for it. You

Python-URL! - weekly Python news and links (Jun 14)

2011-06-14 Thread Cameron Laird
[Originally drafted by Gabriel Genellina.] QOTW: Well, it's incompatible with the Python compiler I keep in my head. Have these developers no consideration for backward-thinking- compatibility? (Ben Finney, 2011-06-10, on certain old but not-so-obvious change) Python versions 2.7.2 and

Dictionaries and incrementing keys

2011-06-14 Thread Steve Crook
Hi all, I've always done key creation/incrementation using: if key in dict: dict[key] += 1 else: dict[key] = 1 Today I spotted an alternative: dict[key] = dict.get(key, 0) + 1 Whilst certainly more compact, I'd be interested in views on how pythonesque this method is. --

pkg_resources ?

2011-06-14 Thread km
Hi all, I am trying to look at the source code of a python script (run.py). But it reads ###code - run.py #!/usr/bin/env python # EASY-INSTALL-SCRIPT: 'pbpy==0.1','run.py' __requires__ = 'pbpy==0.1' import pkg_resources pkg_resources.run_script('pbpy==0.1',

Re: Dictionaries and incrementing keys

2011-06-14 Thread Peter Otten
Steve Crook wrote: I've always done key creation/incrementation using: if key in dict: dict[key] += 1 else: dict[key] = 1 Your way is usually faster than dict[key] = dict.get(key, 0) + 1 Whilst certainly more compact, I'd be interested in views on how pythonesque this

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Elena
On 13 Giu, 11:22, Chris Angelico ros...@gmail.com wrote: On Mon, Jun 13, 2011 at 6:42 PM, Yang Ha Nguyen cmp...@gmail.com wrote: Could you show which studies?  Do they do research just about habit or other elements (e.g. movement rates, comfortablility, ...) as well? Have they ever heard

Re: Dictionaries and incrementing keys

2011-06-14 Thread AlienBaby
On Jun 14, 12:16 pm, Peter Otten __pete...@web.de wrote: Steve Crook wrote: I've always done key creation/incrementation using: if key in dict:     dict[key] += 1 else:     dict[key] = 1 Your way is usually faster than dict[key] = dict.get(key, 0) + 1 Whilst certainly more

Re: Rant on web browsers

2011-06-14 Thread Novocastrian_Nomad
CoffeeScript maybe? http://jashkenas.github.com/coffee-script -- http://mail.python.org/mailman/listinfo/python-list

Re: Dictionaries and incrementing keys

2011-06-14 Thread Steve Crook
On Tue, 14 Jun 2011 05:37:45 -0700 (PDT), AlienBaby wrote in Message-Id: 078c5e9a-8fad-4d4c-b081-f69d0f575...@v11g2000prk.googlegroups.com: How do those methods compare to the one I normally use; try: dict[key]+=1 except: dict[key]=1 This is a lot slower in percentage terms. You should

Re: Dictionaries and incrementing keys

2011-06-14 Thread Steve Crook
On Tue, 14 Jun 2011 13:16:47 +0200, Peter Otten wrote in Message-Id: it7fu4$rc5$1...@solani.org: Your way is usually faster than dict[key] = dict.get(key, 0) + 1 Thanks Peter, ran it through Timeit and you're right. It's probably also easier to read the conditional version, even if it is

Re: Dictionaries and incrementing keys

2011-06-14 Thread Steven D'Aprano
On Tue, 14 Jun 2011 10:57:44 +, Steve Crook wrote: Hi all, I've always done key creation/incrementation using: if key in dict: dict[key] += 1 else: dict[key] = 1 Today I spotted an alternative: dict[key] = dict.get(key, 0) + 1 Whilst certainly more compact, I'd be

Leo 4.9 b4 released

2011-06-14 Thread Edward K. Ream
Leo 4.9 b4 is now available at: http://sourceforge.net/projects/leo/files/ If you have trouble downloading, please do try an alternate mirror. Unless serious problems are reported, expect Leo 4.9 rc1 this Friday, June 17 and 4.9 final on Tuesday, June 21. Leo is a text editor, data organizer,

Re: Dictionaries and incrementing keys

2011-06-14 Thread Steven D'Aprano
On Tue, 14 Jun 2011 12:53:11 +, Steve Crook wrote: On Tue, 14 Jun 2011 05:37:45 -0700 (PDT), AlienBaby wrote in Message-Id: 078c5e9a-8fad-4d4c-b081-f69d0f575...@v11g2000prk.googlegroups.com: How do those methods compare to the one I normally use; try: dict[key]+=1 except:

Re: Binding was Re: Function declarations ?

2011-06-14 Thread Patty
- Original Message - From: Ethan Furman et...@stoneleaf.us To: python-list@python.org Sent: Monday, June 13, 2011 10:55 PM Subject: Re: Binding was Re: Function declarations ? Patty wrote: So I am wondering if you learned this in Computer Science or Computer Engineering?, on the

Re: Rant on web browsers

2011-06-14 Thread Patty
- Original Message - From: Chris Angelico ros...@gmail.com To: python-list@python.org Sent: Monday, June 13, 2011 11:31 PM Subject: Rant on web browsers Random rant and not very on-topic. Feel free to hit Delete and move on. I've just spent a day coding in Javascript, and wishing

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Dotan Cohen
On Mon, Jun 13, 2011 at 10:21, Elena egarr...@gmail.com wrote: On 13 Giu, 06:30, Tim Roberts t...@probo.com wrote: Studies have shown that even a strictly alphabetical layout works perfectly well, once the typist is acclimated. Once the user is acclimated to move her hands much  more (about

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Matt Chaput
On 13/06/2011 11:55 PM, zainul franciscus wrote: Iknow you guys must be thinking Hmm, Miranda, isn't that an IM application ?; Yep I hear you, I'll change the name once I get a good name. I am open for any suggestions. Actually I was thinking isn't that a functional programming language? My

Python Pickle Problems (Ellipsis + Other Objects)

2011-06-14 Thread Sunjay Varma
See more details in my forum post: http://www.python-forum.org/pythonforum/viewtopic.php?f=18t=26724 I'm trying to pickle a bunch of functions (mostly built-in) and pickle keeps giving me errors. I have no Ellipsis in my data at all, and for some reason, pickle seems to think I do. Here is

What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Zachary Dziura
I have a dict that I would like to print out in a series of columns, rather than as a bunch of lines. Normally when you do print(dict), the output will look something like this: {'Header2': ['2', '5', '8'], 'Header3': ['3', '6', '9'], 'Header1': ['1', '4', '7'], 'Header4': ['10', '11', '12']} I

Wing IDE 4.0.3 released

2011-06-14 Thread Wingware
Hi, Wingware has released version 4.0.3 of Wing IDE, an integrated development environment designed specifically for the Python programming language. Wing IDE is a cross-platform Python IDE that provides a professional code editor with vi, emacs, and other key bindings, auto-completion, call

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Zachary Dziura
On Jun 13, 11:55 pm, zainul franciscus zainul.francis...@gmail.com wrote: I started an open source file organizer called Miranda.  Miranda is inspired by Belvedere written by Adam Pash of Lifehacker (http:// lifehacker.com/341950/belvedere-automates-your-self+cleaning-pc). I know you guys

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Terry Reedy
On 6/14/2011 11:29 AM, Zachary Dziura wrote: I have a dict that I would like to print out in a series of columns, rather than as a bunch of lines. Normally when you do print(dict), the output will look something like this: {'Header2': ['2', '5', '8'], 'Header3': ['3', '6', '9'], 'Header1':

Re: working with raw image files

2011-06-14 Thread Terry Reedy
On 6/14/2011 3:49 AM, Martin De Kauwe wrote: what is a .raw file, do you mean a flat binary? Perhaps tiff-like. https://secure.wikimedia.org/wikipedia/en/wiki/Raw_image_format Providing a detailed and concise description of the content of raw files is highly problematic. There is no single

Re: Dictionaries and incrementing keys

2011-06-14 Thread Asen Bozhilov
Steve Crook wrote: Whilst certainly more compact, I'd be interested in views on how pythonesque this method is. Instead of calling function you could use: d = {} d[key] = (key in d and d[key]) + 1 Regards. -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread geremy condra
On Tue, Jun 14, 2011 at 7:54 AM, Matt Chaput m...@whoosh.ca wrote: On 13/06/2011 11:55 PM, zainul franciscus wrote: Iknow you guys must be thinking Hmm, Miranda, isn't that an IM application ?; Yep I hear you, I'll change the name once I get a good name. I am open for any suggestions.

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Zach Dziura
d={'Header2': ['2', '5', '8'], 'Header3': ['3', '6', '9'],     'Header1': ['1', '4', '7'], 'Header4': ['10', '11', '12']} arr = [] for key,value in d.items():      line = ['{:10s}'.format(key)]      for num in value:          line.append('{:10s}'.format(num))      arr.append(line) for

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Alister Ware
On Mon, 13 Jun 2011 20:55:54 -0700, zainul franciscus wrote: I started an open source file organizer called Miranda. Miranda is inspired by Belvedere written by Adam Pash of Lifehacker (http:// lifehacker.com/341950/belvedere-automates-your-self+cleaning-pc). I know you guys must be thinking

Re: Infinite recursion in __reduce__ when calling original base class reduce, why?

2011-06-14 Thread Irmen de Jong
On 14-6-2011 2:40, Chris Torek wrote: Nonetheless, there is something at least slightly suspicious here: [... snip explanations...] Many thanks Chris, for the extensive reply. There's some useful knowledge in it. My idea to call the base class reduce as the default fallback causes the

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Karim
On 06/14/2011 05:29 PM, Zachary Dziura wrote: I have a dict that I would like to print out in a series of columns, rather than as a bunch of lines. Normally when you do print(dict), the output will look something like this: {'Header2': ['2', '5', '8'], 'Header3': ['3', '6', '9'], 'Header1':

Question regarding DNS resolution in urllib2

2011-06-14 Thread saurabh verma
hi , I trying to use urllib2 in my script , but the problem is lets say a domains resolves to multiple IPs , If the URL is served by plain http , I can add “Host: domain” header and check whether all IPs are returning proper responses or not , but in case of https , I have to trust on my local

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread MRAB
On 14/06/2011 18:48, Zach Dziura wrote: [snip] I just have one quick question. On the line where you have zip(*arr), what is the * for? Is it like the pointer operator, such as with C? Or is it exactly the pointer operator? [snip] The * in the argument list of a function call unpacks the

Re: working with raw image files

2011-06-14 Thread kafooster
Ok, I solved the problem with matplotlib fileobj = open(hand.raw, 'rb') data = numpy.fromfile(fileobj,dtype=np.uint16) data = numpy.reshape(data,(96,470,352)) imshow(data[:,:,40],cmap='gray') show() the error was caused by different order of data, however it still reads the dataset as half of it

Re: working with raw image files

2011-06-14 Thread MRAB
On 14/06/2011 21:13, kafooster wrote: Ok, I solved the problem with matplotlib fileobj = open(hand.raw, 'rb') data = numpy.fromfile(fileobj,dtype=np.uint16) data = numpy.reshape(data,(96,470,352)) imshow(data[:,:,40],cmap='gray') show() the error was caused by different order of data, however

Re: pkg_resources ?

2011-06-14 Thread Ned Deily
In article BANLkTi=-=jjlk_4awqgna3h7kv3aa9y...@mail.gmail.com, km srikrishnamo...@gmail.com wrote: I am trying to look at the source code of a python script (run.py). But it reads ###code - run.py #!/usr/bin/env python # EASY-INSTALL-SCRIPT:

Re: working with raw image files

2011-06-14 Thread Dan Stromberg
On Tue, Jun 14, 2011 at 1:26 PM, MRAB pyt...@mrabarnett.plus.com wrote: On 14/06/2011 21:13, kafooster wrote: I would like to visualize this data with PIL, but PIL works only with 8bit data. How could I resample my array from 16bit to 8bit? Multiply the numpy array by a scaling factor,

Re: working with raw image files

2011-06-14 Thread kafooster
On 14 Cze, 22:26, MRAB pyt...@mrabarnett.plus.com wrote: Multiply the numpy array by a scaling factor, which is float(max_8bit_value) / float(max_16bit_value). could you please explain it a little? I dont understand it. like multiplying each element? --

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 3:33 AM, geremy condra debat...@gmail.com wrote: My suggestion: Cruftbuster 'Phile' Or 'Philtre'. A philtre is a very useful thing to have around a house... just ask Aline Sangazure. I'd like to join this project, as a tester. Chris Angelico --

Re: Rant on web browsers

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 12:11 AM, Patty pa...@cruzio.com wrote: Hi Chris - I am just learning JavaScript and this was helpful to me, not a rant.  I am reading JavaScript:  The Good Parts so he is jumping around in topic and I can just use this when learning about dates and ints coming up.

Re: working with raw image files

2011-06-14 Thread MRAB
On 14/06/2011 22:20, kafooster wrote: On 14 Cze, 22:26, MRABpyt...@mrabarnett.plus.com wrote: Multiply the numpy array by a scaling factor, which is float(max_8bit_value) / float(max_16bit_value). could you please explain it a little? I dont understand it. like multiplying each element?

break in a module

2011-06-14 Thread Eric Snow
When you want to stop execution of a statement body early, for flow control, there is a variety ways you can go, depending on the context. Loops have break and continue. Functions have return. Generators have yield (which temporarily stops execution). Exceptions sort of work for everything,

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Andrew Berg
On 2011.06.13 08:58 PM, Chris Angelico wrote: That's one of the reasons I like my laptop keyboard so much. I find that the terribly tiny keys on a laptop keyboard make them very evil. I don't see how anyone could type fast on one of them without making tons of errors. I constantly have to fix

Re: Rant on web browsers

2011-06-14 Thread Asen Bozhilov
Chris Angelico wrote: I've just spent a day coding in Javascript, and wishing browsers supported Python instead (or as well). All I needed to do was take two dates (as strings), figure out the difference in days, add that many days to both dates, and put the results back into DOM Input

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread Redcat
The chief geek has given his nod of approval to publish Miranda through how-to geek, and I can pitch any of your software to him, and write an article about it - provided that the chief geek approve the software. I wouldn't mind contributing some time to this project. --

Re: break in a module

2011-06-14 Thread MRAB
On 14/06/2011 23:28, Eric Snow wrote: [snip] With modules I sometimes have code at the beginning to do some small task if a certain condition is met, and otherwise execute the rest of the module body. Here's my main use case: some module import sys import importlib import util #

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread zainul franciscus
On Jun 15, 10:43 am, Redcat red...@catfolks.net wrote: The chief geek has given his nod of approval to publish Miranda through how-to geek, and I can pitch any of your software to him, and write an article about it - provided that the chief geek approve the software. I wouldn't mind

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread zainul franciscus
Hi Chris, Thank you for the reply. I should have mentioned where I am hosting the code *doh slap on the wrist. I am hosting the code in google code: http://code.google.com/p/mirandafileorganizer/ There is a link to the user/developer guide on how to get started with the software:

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread zainul franciscus
Hi Chris, Thank you for the reply. I should have mentioned where I am hosting the code *doh slap on the wrist. I am hosting the code in google code: http://code.google.com/p/mirandafileorganizer/ There is a link to the user/developer guide on how to get started with the software:

Re: break in a module

2011-06-14 Thread Ethan Furman
MRAB wrote: On 14/06/2011 23:28, Eric Snow wrote: I would rather have something like this: some module import sys import importlib import util # some utility module somewhere... if __name__ == __main__: name = util.get_module_name(sys.modules[__name__]) module =

Re: working with raw image files

2011-06-14 Thread Dave Angel
On 01/-10/-28163 02:59 PM, kafooster wrote: On 14 Cze, 22:26, MRABpyt...@mrabarnett.plus.com wrote: Multiply the numpy array by a scaling factor, which is float(max_8bit_value) / float(max_16bit_value). could you please explain it a little? I dont understand it. like multiplying each

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Ben Finney
Zachary Dziura zcdzi...@gmail.com writes: What I want to know is how I can print out that information in a column, where the header is the first line of the column, with the data following underneath, like so: I'm glad you got some good replies. It probably reflects badly on me that my first

Re: break in a module

2011-06-14 Thread Erik Max Francis
Eric Snow wrote: With modules I sometimes have code at the beginning to do some small task if a certain condition is met, and otherwise execute the rest of the module body. Here's my main use case: some module import sys import importlib import util # some utility module somewhere...

Re: break in a module

2011-06-14 Thread Erik Max Francis
Ethan Furman wrote: MRAB wrote: On 14/06/2011 23:28, Eric Snow wrote: I would rather have something like this: some module import sys import importlib import util # some utility module somewhere... if __name__ == __main__: name =

Re: working with raw image files

2011-06-14 Thread kafooster
On 15 Cze, 00:06, MRAB pyt...@mrabarnett.plus.com wrote: Yes. Something like this: fileobj = open(hand.raw, 'rb') data = numpy.fromfile(fileobj, dtype=numpy.uint16) fileobj.close() data = data * float(0xFF) / float(0x) data = numpy.array(data, dtype=numpy.uint8) data =

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 9:40 AM, Ben Finney ben+pyt...@benfinney.id.au wrote: Zachary Dziura zcdzi...@gmail.com writes: What I want to know is how I can print out that information in a column, where the header is the first line of the column, with the data following underneath, like so: I'm

Re: working with raw image files

2011-06-14 Thread kafooster
On 15 Cze, 01:25, Dave Angel da...@ieee.org wrote: On 01/-10/-28163 02:59 PM, kafooster wrote: On 14 Cze, 22:26, MRABpyt...@mrabarnett.plus.com  wrote: Multiply the numpy array by a scaling factor, which is float(max_8bit_value) / float(max_16bit_value). could you please explain it a

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 12:50 AM, Dotan Cohen dotanco...@gmail.com wrote: And disproportionate usage of fingers. On QWERTY the weakest fingers (pinkies) do almost 1/4 of the keypresses when modifier keys, enter, tab, and backspace are taken into account. That's true on a piano too, though. My

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 8:29 AM, Andrew Berg bahamutzero8...@gmail.com wrote: On 2011.06.13 08:58 PM, Chris Angelico wrote: That's one of the reasons I like my laptop keyboard so much. I find that the terribly tiny keys on a laptop keyboard make them very evil. I don't see how anyone could

Re: working with raw image files

2011-06-14 Thread MRAB
On 15/06/2011 00:59, kafooster wrote: On 15 Cze, 00:06, MRABpyt...@mrabarnett.plus.com wrote: Yes. Something like this: fileobj = open(hand.raw, 'rb') data = numpy.fromfile(fileobj, dtype=numpy.uint16) fileobj.close() data = data * float(0xFF) / float(0x) data = numpy.array(data,

Re: Looking for Coders or Testers for an Open Source File Organizer

2011-06-14 Thread zainul franciscus
Thank you for the reply. I should have mentioned where I am hosting the code *doh slap on the wrist. I am hosting the code in google code: http://code.google.com/p/mirandafileorganizer/ There is a link to the user/developer guide on how to get started with the software:

Re: Question regarding DNS resolution in urllib2

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 4:34 AM, saurabh verma nitw.saur...@gmail.com wrote: hi , I trying to use urllib2 in my script , but the problem is lets say a domains resolves to multiple IPs , If the URL is served by plain http , I can add “Host: domain” header and check whether all IPs are

Re: break in a module

2011-06-14 Thread Ben Finney
Eric Snow ericsnowcurren...@gmail.com writes: When you want to stop execution of a statement body early, for flow control, there is a variety ways you can go, depending on the context. Loops have break and continue. Functions have return. Generators have yield (which temporarily stops

Re: break in a module

2011-06-14 Thread Eric Snow
On Tue, Jun 14, 2011 at 5:51 PM, Erik Max Francis m...@alcyone.com wrote: Ethan Furman wrote: To me, too -- too bad it doesn't work: c:\temp\python32\python early_abort.py  File early_abort.py, line 7    return       ^ SyntaxError: 'return' outside function Nor should it.  There's

Re: Paramiko Threading Error

2011-06-14 Thread mud
On Jun 10, 3:47 am, David 71da...@libero.it wrote: Il Tue, 7 Jun 2011 19:25:43 -0700 (PDT), mud ha scritto: Hi All, Does anybody know what the following error means with paramiko, and how to fix it. I don't know what is causing it and why. I have updated paramiko to version

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Andrew Berg
On 2011.06.14 07:18 PM, Chris Angelico wrote: There are many different designs of laptop keyboard. Tiny netbooks seem to have the very worst, leaving it nearly impossible to get any decent work done (there may be exceptions to that, but I've seen a lot of bad netbook keyboards). My current

Re: working with raw image files

2011-06-14 Thread Nobody
On Tue, 14 Jun 2011 19:25:32 -0400, Dave Angel wrote: You said in an earlier message to ignore the RAW format. However, if your file matches a typical camera's raw file It doesn't. He's dealing with a raw array of fixed-size integers (i.e. what you would get if you took a C array and wrote

Re: break in a module

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 10:51 AM, Eric Snow ericsnowcurren...@gmail.com wrote:  if condition_1:      ...      return  if condition_2:      ...      return  # now do my expensive module stuff  # finally handle being run as a script  if __name__ == __main__:      ... The best way I can

Re: break in a module

2011-06-14 Thread Ben Finney
Eric Snow ericsnowcurren...@gmail.com writes: I apologize if my example was unclear. I kept it pretty simple. That's a good goal, but unfortunately in this case it means the purpose is opaque. In general it would be nice to do some checks up front and decide whether or not to continue

Re: working with raw image files

2011-06-14 Thread Nobody
On Tue, 14 Jun 2011 13:13:07 -0700, kafooster wrote: Ok, I solved the problem with matplotlib fileobj = open(hand.raw, 'rb') data = numpy.fromfile(fileobj,dtype=np.uint16) data = numpy.reshape(data,(96,470,352)) imshow(data[:,:,40],cmap='gray') show() the error was caused by different

Re: working with raw image files

2011-06-14 Thread Dave Angel
On 01/-10/-28163 02:59 PM, kafooster wrote: On 15 Cze, 01:25, Dave Angelda...@ieee.org wrote: On 01/-10/-28163 02:59 PM, kafooster wrote: On 14 Cze, 22:26, MRABpyt...@mrabarnett.plus.comwrote: Multiply the numpy array by a scaling factor, which is float(max_8bit_value) /

Re: break in a module

2011-06-14 Thread Eric Snow
On Tue, Jun 14, 2011 at 7:33 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: I have never seen code that needs this, and can't imagine why the above would be a good design for a module. Is there real code online somewhere that we can see which serves as a real example for your use case?

Re: break in a module

2011-06-14 Thread Cameron Simpson
On 14Jun2011 18:51, Eric Snow ericsnowcurren...@gmail.com wrote: | On Tue, Jun 14, 2011 at 5:51 PM, Erik Max Francis m...@alcyone.com wrote: | Ethan Furman wrote: | | To me, too -- too bad it doesn't work: | | c:\temp\python32\python early_abort.py |  File early_abort.py, line 7 |    return

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread rusi
On Jun 15, 5:11 am, Chris Angelico ros...@gmail.com wrote: On Wed, Jun 15, 2011 at 12:50 AM, Dotan Cohen dotanco...@gmail.com wrote: And disproportionate usage of fingers. On QWERTY the weakest fingers (pinkies) do almost 1/4 of the keypresses when modifier keys, enter, tab, and backspace

Re: break in a module

2011-06-14 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Eric Snow wrote: snip Unfortunately not. Most of this line of thinking is the result of looking at import functionality in different ways, including with regards to the problem of modules getting imported twice (once as __main__). I've been doing work on multi-file

Dynamic URL shortening

2011-06-14 Thread Littlefield, Tyler
Hello all: I started working on a project with someone else quite recently, and he has a request. The project requires an URL shortener, and he would like it to be dynamic for both users and developers. Apparently some applications on the mac allow for the user to input some data on a URL

Re: Dynamic URL shortening

2011-06-14 Thread Chris Angelico
On Wed, Jun 15, 2011 at 2:03 PM, Littlefield, Tyler ty...@tysdomain.com wrote: Hello all: I started working on a project with someone else quite recently, and he has a request. The project requires an URL shortener, and he would like it to be dynamic for both users and developers. Apparently

Re: Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-14 Thread Dotan Cohen
On Wed, Jun 15, 2011 at 06:00, rusi rustompm...@gmail.com wrote: For keyboarding (in the piano/organ sense) the weakest finger is not the fifth/pinky but the fourth. Because for the fifth you will notice that the natural movement is to stiffen the finger and then use a slight outward

Re: What is the Most Efficient Way of Printing A Dict's Contents Out In Columns?

2011-06-14 Thread Terry Reedy
On 6/14/2011 2:37 PM, MRAB wrote: On 14/06/2011 18:48, Zach Dziura wrote: [snip] I just have one quick question. On the line where you have zip(*arr), what is the * for? Is it like the pointer operator, such as with C? Or is it exactly the pointer operator? [snip] The * in the argument list

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This change is reasonable for the long term. But it *will* break a lot of code. [If you favor a specific change, please indicate what that is. I'm assuming you support my proposal for the moment :-] I agree it will break a lot of code,

[issue12319] [http.client] HTTPConnection.putrequest not support chunked Transfer-Encodings to send data

2011-06-14 Thread Petri Lehtinen
Petri Lehtinen pe...@digip.org added the comment: harobed wrote: I use http.client in WebDAV client. Mac OS X Finder WebDAV client perform all his request in chunk mode : PUT and GET. Here, I use http.client to simulate Mac OS X Finder WebDAV client. Now I'm confused. Per the HTTP

[issue10224] Build 3.x documentation using python3.x

2011-06-14 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Actually, on Windows, PYTHON is typically not set at all. So the likelihood of it being set to Python 3 is very low, unless you are trying to build Python documentation from time to time. Sye: I fail to see the point of your patch.

[issue11934] build with --prefix=/dev/null and zlib enabled in Modules/Setup failed

2011-06-14 Thread Petri Lehtinen
Changes by Petri Lehtinen pe...@digip.org: -- nosy: +petri.lehtinen ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11934 ___ ___ Python-bugs-list

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The change to sys.platform=='linux' would break code even on current platforms. OTOH, we have sys.platform=='win32' even on Windows 64bit; would this favor keeping 'linux2' on all versions of Linux as well? --

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: The change to sys.platform=='linux' would break code even on current platforms. Correct. Compared to introducing 'linux3', I consider this the better change - it likely breaks earlier (i.e. when porting to Python 3.3). OTOH, we have

[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

2011-06-14 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: I'm sure Linus Torvalds is fully aware of the possible consequences of the version change, and just accepted the breakage that this would cause. Any application relying on sys.platform == 'linux2' is already broken. It's exactly the

[issue10527] multiprocessing.Pipe problem: handle out of range in select()

2011-06-14 Thread Dan Kenigsberg
Dan Kenigsberg dan...@redhat.com added the comment: I would rate this issue as a performance bug, not a mere feature request. If the python process has more than 1023 open file descriptors, multiprocessing.Pipe.poll() becomes unusable. This is a serious barrier to using multiprocessing in a

[issue12331] lib2to3 tests write into protected directory

2011-06-14 Thread Vinay Sajip
New submission from Vinay Sajip vinay_sa...@yahoo.co.uk: Some of the tests for lib2to3 write into folders which are protected in an installed Python. This means that regression tests fail when run on an installed Python, even though they run wihtout these errors on a source build. I think

  1   2   >