Twisted 13.0.0 released

2013-04-03 Thread Thomas Hervé
On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 13.0. Among the 70 tickets closed, we can see: * A new Introduction to Deferreds document that you can find here: http://twistedmatrix.com/documents/13.0.0/core/howto/defer-intro.html * A fix in

Call for papers for Dyla'13: 7th Workshop on Dynamic Languages and Applications @ECOOP

2013-04-03 Thread Damien Cassou
Call for Papers === Dyla'13, 7th Workshop on Dynamic Languages and Applications Colocated with ECOOP, ECMFA and ECSA In-cooperation with SIGPLAN and SIGSOFT 1–5 July, Montpellier, France http://rmod.lille.inria.fr/web/pier/Events/Dyla13 !!

How to choose between ORMs?

2013-04-03 Thread Alec Taylor
SQLalchemy and Storm are a few of the popular ORMs out there. Personally I have been using web2py's DAL. Other than form generator availability, 'print as raw SQL', multiple primary keys, widgets*, `check` conditions and compatibility with OracleDB, Postgres, SQLite and some of the NoSQL

Re: Performance of int/long in Python 3

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 1:32 AM, Steven D'Aprano wrote: On Wed, 03 Apr 2013 14:31:03 +1100, Neil Hodgson wrote: Sorting a million string list (all the file paths on a particular computer) went from 0.4 seconds with Python 3.2 to 0.78 with 3.3 so we're out of the 'not noticeable by humans' range.

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Wed, Apr 3, 2013 at 3:03 PM, Neil Hodgson nhodg...@iinet.net.au wrote: rusi wrote: Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can. In my personal experience, it's calculators. I put command-line calculators

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Wed, Apr 3, 2013 at 4:32 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 14:31:03 +1100, Neil Hodgson wrote: Sorting a million string list (all the file paths on a particular computer) went from 0.4 seconds with Python 3.2 to 0.78 with 3.3 so we're

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Chris Angelico: I'd be curious to know the sorts of characters used. Given that it's probably a narrow-vs-wide Python difference we're talking here, the actual distribution of codepoints may well make a difference. I was going to upload it but then I thought of potential client

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Terry Jan Reedy: What system *and* what compiler and compiler options. Unless 3.2 and 3.3 are both compiler with the same compiler and settings, we do not know the source of the difference. The version signatures are: 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)]

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Wed, Apr 3, 2013 at 5:29 PM, Neil Hodgson nhodg...@iinet.net.au wrote: Chris Angelico: I'd be curious to know the sorts of characters used. Given that it's probably a narrow-vs-wide Python difference we're talking here, the actual distribution of codepoints may well make a difference.

Re: Performance of int/long in Python 3

2013-04-03 Thread Ian Kelly
On Wed, Apr 3, 2013 at 12:52 AM, Chris Angelico ros...@gmail.com wrote: Hmm. I was about to say Can you just do a quick collections.Counter() of the string widths in 3.3, as an easy way of seeing which ones use BMP or higher characters, but I can't find a simple way to query a string's width.

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Wed, Apr 3, 2013 at 6:06 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Apr 3, 2013 at 12:52 AM, Chris Angelico ros...@gmail.com wrote: Hmm. I was about to say Can you just do a quick collections.Counter() of the string widths in 3.3, as an easy way of seeing which ones use BMP or

Re: Time zone changing while Win app is running

2013-04-03 Thread Steven D'Aprano
On Tue, 02 Apr 2013 17:04:12 -0700, CM wrote: To summarize the issue: In an application, I have been using Python's datetime module to get the current time. But it seems that, at least with Windows (XP), whatever time zone your computer is set to when you start the application, that's what

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Reran the programs taking a bit more care with the encoding of the file. This had no effect on the speeds. There are only a small amount of paths that don't fit into ASCII: ASCII 1076101 Latin1 218 BMP 113 Astral 0 # encoding:utf-8 import codecs, os, time from os.path import join, getsize

Re: Performance of int/long in Python 3

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 18:24:25 +1100, Chris Angelico wrote: On Wed, Apr 3, 2013 at 6:06 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Apr 3, 2013 at 12:52 AM, Chris Angelico ros...@gmail.com wrote: Hmm. I was about to say Can you just do a quick collections.Counter() of the string widths

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Wed, Apr 3, 2013 at 6:53 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Here's another way: (sys.getsizeof(s) - sys.getsizeof(''))/len(s) should work. Hmm, I had been under the impression that there was a certain base length below which strings all had the same size.

Re: Performance of int/long in Python 3

2013-04-03 Thread rusi
On Apr 3, 12:37 pm, Neil Hodgson nhodg...@iinet.net.au wrote:     Reran the programs taking a bit more care with the encoding of the file. This had no effect on the speeds. There are only a small amount of paths that don't fit into ASCII: ASCII 1076101 Latin1 218 BMP 113 Astral 0 #

Re: Performance of int/long in Python 3

2013-04-03 Thread jmfauth
This FSR is wrong by design. A naive way to embrace Unicode. jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting USB volume serial number from inserted device on OSX

2013-04-03 Thread Sven
Apologies. The main app is in python, and I would like to know any alternative methods to do this in Python on OS X. Doesn't have to use the OS X APIs. I'll try elsewhere too though. Thanks On 3 April 2013 00:37, Ned Deily n...@acm.org wrote: In article

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Roy Smith: On the other hand, how long did it take you to do the directory tree walk required to find those million paths? I'll bet a long longer than 0.78 seconds, so this gets lost in the noise. About 2 minutes. But that's just getting an example data set. Other data sets may be loaded

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
rusi: Can you please try one more experiment Neil? Knock off all non-ASCII strings (paths) from your dataset and try again. Results are the same 0.40 (well, 0.001 less but I don't think the timer is that accurate) for Python 3.2 and 0.78 for Python 3.3. Neil --

Make python 3.3 the default one and not 2.7

2013-04-03 Thread D. Xenakis
Hi there, i installed python 2.7 (windows 32bit version) from http://www.enthought.com/products/epd_free.php and after that i installed official 3.3 version too. So now i got two python folders like this.. c:/Python27 and c:/Python33 . My problem is that when im trying to execute a .py file,

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread Wolfgang Maier
D. Xenakis gouzounakis at hotmail.com writes: Hi there, i installed python 2.7 (windows 32bit version) from http://www.enthought.com/products/epd_free.php and after that i installed official 3.3 version too. So now i got two python folders like this.. c:/Python27 and c:/Python33 . My

Re: Performance of int/long in Python 3

2013-04-03 Thread Dave Angel
On 04/03/2013 04:22 AM, Neil Hodgson wrote: rusi: Can you please try one more experiment Neil? Knock off all non-ASCII strings (paths) from your dataset and try again. Results are the same 0.40 (well, 0.001 less but I don't think the timer is that accurate) for Python 3.2 and 0.78 for

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread Dave Angel
On 04/03/2013 04:44 AM, D. Xenakis wrote: Hi there, i installed python 2.7 (windows 32bit version) from http://www.enthought.com/products/epd_free.php and after that i installed official 3.3 version too. So now i got two python folders like this.. c:/Python27 and c:/Python33 . My problem is

Solution found! Qpython+ will work on kindle fire (without live connection)

2013-04-03 Thread ah
+ To: tu...@python.org tu...@python.org Sent: Monday, 1 April 2013 9:18 AM Subject: [Tutor] is there a simple stand alone python app I can use on my Kindle fire? Hello, I'm enjoying learning python, and would like to be able to study and practice on the go, using my kindle fire reader.

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Dave Angel: That would seem to imply that the speed regression on your data is NOT caused by the differing size encodings. Perhaps it is the difference in MSC compiler version, or other changes made between 3.2 and 3.3 Its not caused by there actually being different size encodings but

Twisted 13.0.0 released

2013-04-03 Thread Thomas Hervé
On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 13.0. Among the 70 tickets closed, we can see: * A new Introduction to Deferreds document that you can find here: http://twistedmatrix.com/documents/13.0.0/core/howto/defer-intro.html * A fix in

Re: Performance of int/long in Python 3

2013-04-03 Thread Mark Lawrence
On 03/04/2013 09:08, jmfauth wrote: This FSR is wrong by design. A naive way to embrace Unicode. jmf The hole you're digging for yourself is getting bigger and bigger and I'm loving it :) -- If you're using GoogleCrap™ please read this

Re: Performance of int/long in Python 3

2013-04-03 Thread Dave Angel
On 04/03/2013 07:05 AM, Neil Hodgson wrote: Dave Angel: That would seem to imply that the speed regression on your data is NOT caused by the differing size encodings. Perhaps it is the difference in MSC compiler version, or other changes made between 3.2 and 3.3 Its not caused by there

Re: Tkinter

2013-04-03 Thread Jason Swails
On Tue, Apr 2, 2013 at 10:04 PM, Renato Barbosa Pim Pereira renato.barbosa.pim.pere...@gmail.com wrote: Thanks for the advices, I need now one scrollbar to roll under screen, I created the scrollbar but cant roll, please help me on this. http://pastebin.com/L6XWY6cm You need to bind your

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread Mark Lawrence
On 03/04/2013 09:44, D. Xenakis wrote: Hi there, i installed python 2.7 (windows 32bit version) from http://www.enthought.com/products/epd_free.php and after that i installed official 3.3 version too. So now i got two python folders like this.. c:/Python27 and c:/Python33 . My problem is

Re: Creating a dictionary from a .txt file

2013-04-03 Thread Neil Cerutti
On 2013-04-01, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 01 Apr 2013 11:41:03 +, Neil Cerutti wrote: I tried searching for Frost*, an interesting artist I recently learned about. Interesting artist -- is that another term for wanker? *wink* hee-hee. It

Re: How to choose between ORMs?

2013-04-03 Thread Roy Smith
In article mailman.35.1364969706.3114.python-l...@python.org, Alec Taylor alec.tayl...@gmail.com wrote: SQLalchemy and Storm are a few of the popular ORMs out there. Personally I have been using web2py's DAL. Other than form generator availability, 'print as raw SQL', multiple primary

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread D. Xenakis
I tried to reinstall python 3.3 but there was not change :(. I selected to run all component from my PC. I'll give it a try with those registries. -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-04-03 Thread Roy Smith
In article 1f2dnfpbhy54embmnz2dnuvz_osdn...@westnet.com.au, Neil Hodgson nhodg...@iinet.net.au wrote: Roy Smith: On the other hand, how long did it take you to do the directory tree walk required to find those million paths? I'll bet a long longer than 0.78 seconds, so this gets lost

Re: Performance of int/long in Python 3

2013-04-03 Thread Roy Smith
In article mailman.37.1364970149.3114.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Wed, Apr 3, 2013 at 3:03 PM, Neil Hodgson nhodg...@iinet.net.au wrote: rusi wrote: Every program attempts to expand until it can read mail. Those programs which cannot so expand are

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Thu, Apr 4, 2013 at 12:28 AM, Roy Smith r...@panix.com wrote: In article mailman.37.1364970149.3114.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Wed, Apr 3, 2013 at 3:03 PM, Neil Hodgson nhodg...@iinet.net.au wrote: rusi wrote: Every program attempts to expand

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Thu, Apr 4, 2013 at 12:25 AM, Roy Smith r...@panix.com wrote: Fair enough. In fact, given that reading the file from disk is O(n) and sorting it is O(n log n), at some point, the sort will totally swamp the input time. But given the much larger fixed cost of disk access, that might take

Threading within a GUI and OpenCV

2013-04-03 Thread Sam Berry
Hey, I'm fairly new to python, and have had no experience with threading. Iv made a small GUI App using the kivy module and OpenCV, i have currently got a button that when pressed runs a function that records from my webcam for 20 seconds. However i have two other buttons, that when pressed

Re: Performance of int/long in Python 3

2013-04-03 Thread Roy Smith
In article 515be00e$0$29891$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 18:24:25 +1100, Chris Angelico wrote: On Wed, Apr 3, 2013 at 6:06 PM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Apr 3, 2013 at 12:52 AM,

Re: Performance of int/long in Python 3

2013-04-03 Thread Mark Lawrence
On 02/04/2013 10:28, Neil Hodgson wrote: jmfauth: 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] [0.8343414906182101, 0.8336184057396241, 0.8330473419738562] 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit [1.3840254166697845, 1.3933888932429768,

Mixin way?

2013-04-03 Thread andrea crotti
I have some classes that have shared behaviours, for example in our scenario an object can be visited, where something that is visitable would have some behaviour like --8---cut here---start-8--- class Visitable(Mixin): FIELDS = { 'visits': [],

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread D. Xenakis
Τη Τετάρτη, 3 Απριλίου 2013 12:43:43 μ.μ. UTC+3, ο χρήστης Wolfgang Maier έγραψε: D. Xenakis gouzounakis at hotmail.com writes: Hi there, i installed python 2.7 (windows 32bit version) from http://www.enthought.com/products/epd_free.php and after that i installed official

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Thu, Apr 4, 2013 at 12:43 AM, Roy Smith r...@panix.com wrote: This has to inspect the entire string, no? I posted (essentially) this a few days ago: if all(ord(c) = 0x for c in s): return it's all bmp else: return it's got astral crap in it

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread Wolfgang Maier
D. Xenakis gouzounakis at hotmail.com writes: The Python.File entry mentioned there also has the information about the IDLE version to use. Best, Wolfgang I changed this too Python.CompiledFile to my 33 version. Should i not touch this key? The

Sorting [was Re: Performance of int/long in Python 3]

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 07:52:42 -0400, Dave Angel wrote: I thought that the sort algorithm used a hash of all the items to be sorted, and only reverted to a raw comparison of the original values when the hash collided. Is that not the case? Or is the code you post here only used when the hash

Re: Performance of int/long in Python 3

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 09:43:06 -0400, Roy Smith wrote: [...] n = max(map(ord, s)) 4 if n 0x else 2 if n 0xff else 1 This has to inspect the entire string, no? Correct. A more efficient implementation would be: def char_size(s): for n in map(ord, s): if n 0x: return 4

Re: Sorting [was Re: Performance of int/long in Python 3]

2013-04-03 Thread Roy Smith
In article 515c400e$0$29966$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I seem to recall that sort relies only on operator is a language promise, but I can't seem to find it documented anywhere official. That's pretty typical for sort

Re: Performance of int/long in Python 3

2013-04-03 Thread Steven D'Aprano
On Thu, 04 Apr 2013 01:17:28 +1100, Chris Angelico wrote: Probably, but it still has to scan the body of the string. It'd not be too bad if it's all astral, but if it's all BMP, it has to scan the whole string. In the max() case, it has to scan the whole string anyway, as there's no other way

Re: Mixin way?

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 15:04:51 +0100, andrea crotti wrote: I have some classes that have shared behaviours, for example in our scenario an object can be visited, where something that is visitable would have some behaviour like [snip mixins] By the way, it's a common convention to name mixin

Re: Performance of int/long in Python 3

2013-04-03 Thread rusi
On Apr 3, 6:43 pm, Roy Smith r...@panix.com wrote: This has to inspect the entire string, no?  I posted (essentially) this a few days ago:        if all(ord(c) = 0x for c in s):             return it's all bmp         else:             return it's got astral crap in it Astral crap?

Re: Mixin way?

2013-04-03 Thread andrea crotti
2013/4/3 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info [snip] So, if you think of Visitable as a gadget that can be strapped onto your MyObj as a component, then composition is probably a better design. But if you think of Visitable as a mere collection of behaviour and state, then a

Re: Performance of int/long in Python 3

2013-04-03 Thread Ian Kelly
On Wed, Apr 3, 2013 at 5:52 AM, Dave Angel da...@davea.name wrote: I'm also puzzled. I thought that the sort algorithm used a hash of all the items to be sorted, and only reverted to a raw comparison of the original values when the hash collided. Is that not the case? Or is the code you

Re: Performance of int/long in Python 3

2013-04-03 Thread Ian Kelly
On Wed, Apr 3, 2013 at 9:02 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 09:43:06 -0400, Roy Smith wrote: [...] n = max(map(ord, s)) 4 if n 0x else 2 if n 0xff else 1 This has to inspect the entire string, no? Correct. A more efficient

Re: Performance of int/long in Python 3

2013-04-03 Thread Ian Kelly
On Wed, Apr 3, 2013 at 1:53 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: (sys.getsizeof(s) - sys.getsizeof(''))/len(s) s = '\x80\x81\x82\x83\x84\x85' len(s) 6 import sys sys.getsizeof(s) 43 sys.getsizeof(s) - sys.getsizeof('') 18 (sys.getsizeof(s) - sys.getsizeof('')) /

Re: How to choose between ORMs?

2013-04-03 Thread Rodrick Brown
Pick the one you learn and know. Sent from my iPhone On Apr 3, 2013, at 2:17 AM, Alec Taylor alec.tayl...@gmail.com wrote: SQLalchemy and Storm are a few of the popular ORMs out there. Personally I have been using web2py's DAL. Other than form generator availability, 'print as raw SQL',

Re: Performance of int/long in Python 3

2013-04-03 Thread Ethan Furman
On 04/03/2013 09:10 AM, rusi wrote: On Apr 3, 6:43 pm, Roy Smith r...@panix.com wrote: This has to inspect the entire string, no? I posted (essentially) this a few days ago: if all(ord(c) = 0x for c in s): return it's all bmp else: return it's

Re: Mixin way?

2013-04-03 Thread Neil Cerutti
On 2013-04-03, andrea crotti andrea.crott...@gmail.com wrote: Well I can explain better the situation to make it more clear. We are using CouchDb and so far it has been (sigh) a brutal manipulation of dictionaries everywhere, with code duplication and so on. Now I wanted to encapsulate all

Re: Performance of int/long in Python 3

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 10:38:20 -0600, Ian Kelly wrote: On Wed, Apr 3, 2013 at 9:02 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 09:43:06 -0400, Roy Smith wrote: [...] n = max(map(ord, s)) 4 if n 0x else 2 if n 0xff else 1 This has to inspect the

Re: Performance of int/long in Python 3

2013-04-03 Thread Dave Angel
On 04/03/2013 12:30 PM, Ian Kelly wrote: On Wed, Apr 3, 2013 at 5:52 AM, Dave Angel da...@davea.name wrote: I'm also puzzled. I thought that the sort algorithm used a hash of all the items to be sorted, and only reverted to a raw comparison of the original values when the hash collided. Is

Re: Python install Win 7 Problem

2013-04-03 Thread Martin Schöön
On 2013-04-02, balasubramanian Achuthan balasu...@gmail.com wrote: Try using Activestate python. The free version would suffice your needs and it comes with a clean install. I have been travelling and have not had time to read this thread in detail so this may be old hat but on Windows (at

Re: Python install Win 7 Problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 1:51 PM, Martin Schöön wrote: On 2013-04-02, balasubramanian Achuthan balasu...@gmail.com wrote: Try using Activestate python. The free version would suffice your needs and it comes with a clean install. I have been travelling and have not had time to read this thread in detail so

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 12:24 PM, Joe Hill wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: I attempted to print about 10 pages of documentation from the help files using IDLE. On all the pages the side of each page was missing about 1/4 inch of text. You neglected to say what you actually did to have a

Re: Time zone changing while Win app is running

2013-04-03 Thread CM
2013-04-03 14:41:13.124000     WRONG                    ^ (That carrot is supposed to be pointing to the 4 in 14, which should be 18.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Time zone changing while Win app is running

2013-04-03 Thread CM
On Apr 3, 7:37 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Tue, 02 Apr 2013 17:04:12 -0700, CM wrote: To summarize the issue:  In an application, I have been using Python's datetime module to get the current time.  But it seems that, at least with Windows (XP),

Distributing a Python program hell

2013-04-03 Thread John Nagle
I'm struggling with radio hams who are trying to get my antique Teletype program running. I hate having to write instructions like this: Installation instructions (Windows): Download and install Python 2.7 (32-bit) if not already installed. (Python 2.6 or 2.7 is required; pyserial will

Re: Make python 3.3 the default one and not 2.7

2013-04-03 Thread D. Xenakis
thx solved -- http://mail.python.org/mailman/listinfo/python-list

Re: Distributing a Python program hell

2013-04-03 Thread Ian Kelly
On Wed, Apr 3, 2013 at 1:41 PM, John Nagle na...@animats.com wrote: I'm struggling with radio hams who are trying to get my antique Teletype program running. I hate having to write instructions like this: Installation instructions (Windows): You should check out pyInstaller or py2exe or

Re: Distributing a Python program hell

2013-04-03 Thread Neil Cerutti
On 2013-04-03, John Nagle na...@animats.com wrote: I'm struggling with radio hams who are trying to get my antique Teletype program running. I hate having to write instructions like this: Installation instructions (Windows): Download and install Python 2.7 (32-bit) if not already

Re: Distributing a Python program hell

2013-04-03 Thread Grant Edwards
On 2013-04-03, Neil Cerutti ne...@norwich.edu wrote: On 2013-04-03, John Nagle na...@animats.com wrote: I'm struggling with radio hams who are trying to get my antique Teletype program running. I hate having to write instructions like this: [...] Python programs can be distributed as

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 2:50 PM, Joe Hill wrote: On Wed, 03 Apr 2013 14:40:38 -0400, Terry Jan Reedy tjre...@udel.edu wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: I attempted to print about 10 pages of documentation from the help files using IDLE. On all the pages the side of each page was missing

Re: [Twisted-Python] Twisted 13.0.0 released

2013-04-03 Thread Glyph
On Apr 3, 2013, at 4:11 AM, Thomas Hervé the...@free.fr wrote: On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 13.0. Thank you Thomas for managing yet another excellent release! Among the 70 tickets closed, we can see: * A new Introduction to

Re: Time zone changing while Win app is running

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 2:46 PM, CM wrote: On Apr 3, 7:37 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Tue, 02 Apr 2013 17:04:12 -0700, CM wrote: To summarize the issue: In an application, I have been using Python's datetime module to get the current time. But it seems that, at

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Thu, Apr 4, 2013 at 4:43 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 10:38:20 -0600, Ian Kelly wrote: On Wed, Apr 3, 2013 at 9:02 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 09:43:06 -0400, Roy Smith wrote:

Re: Performance of int/long in Python 3

2013-04-03 Thread Chris Angelico
On Thu, Apr 4, 2013 at 2:07 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 04 Apr 2013 01:17:28 +1100, Chris Angelico wrote: Probably, but it still has to scan the body of the string. It'd not be too bad if it's all astral, but if it's all BMP, it has to scan the

Re: [Twisted-Python] Twisted 13.0.0 released

2013-04-03 Thread Laurens Van Houtven
Yay! Thanks, Thomas and everyone who contributed to this release :) On Wed, Apr 3, 2013 at 1:11 PM, Thomas Hervé the...@free.fr wrote: On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 13.0. Among the 70 tickets closed, we can see: * A new

Serpent, a serializer based on ast.literal_eval. Now also with Java and .net implementations

2013-04-03 Thread Irmen de Jong
Hi, I've made serpent, a serializer based around ast.literal_eval(). You can find it on Pypi: http://pypi.python.org/pypi/serpent Serpent takes a Python object tree and turns it into a serialized form that can be safely read back by ast.literal_eval(). This avoids security issues that other

Your message to bind-users awaits moderator approval

2013-04-03 Thread bind-users-bounces
Your mail to 'bind-users' with the subject Delivery reports about your e-mail Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will receive

Re: IDLE printing problem

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 5:16 PM, Joe Hill wrote: On Wed, 03 Apr 2013 16:20:20 -0400, Terry Jan Reedy tjre...@udel.edu wrote: On 4/3/2013 2:50 PM, Joe Hill wrote: On Wed, 03 Apr 2013 14:40:38 -0400, Terry Jan Reedy tjre...@udel.edu wrote: On 4/3/2013 12:24 PM, Joe Hill wrote: I attempted to print

Re: Performance of int/long in Python 3

2013-04-03 Thread Mark Lawrence
On 03/04/2013 22:55, Chris Angelico wrote: On Thu, Apr 4, 2013 at 4:43 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 10:38:20 -0600, Ian Kelly wrote: On Wed, Apr 3, 2013 at 9:02 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03

Re: Data storage Py 3.3

2013-04-03 Thread Irmen de Jong
On 4-4-2013 0:33, Joe Hill wrote: IDLE wants to use Python33 as the data storage folder - with exe files etc. Typically the 'default data storage' is in 'last used' directory or most programs even have a browse setting that one can quickly set and reset. What do people here generally do?

Re: Performance of int/long in Python 3

2013-04-03 Thread Neil Hodgson
Neil Hodgson, replying to self: The assembler (32-bit build) for each PyUnicode_READ looks like Don't have 64-bit MSVC 2010 set up but the code from 64-bit MSVC 2012 is better since there are an extra 8 registers in 64-bit mode: ; 10431: c1 = PyUnicode_READ(kind1, data1, i);

Re: Performance of int/long in Python 3

2013-04-03 Thread Roy Smith
In article aa3b500f-bebf-4d77-9855-3d90b07ea...@y7g2000pbu.googlegroups.com, rusi rustompm...@gmail.com wrote: On Apr 3, 6:43 pm, Roy Smith r...@panix.com wrote: This has to inspect the entire string, no?  I posted (essentially) this a few days ago:        if all(ord(c) = 0x for c

Re: Performance of int/long in Python 3

2013-04-03 Thread Roy Smith
In article 515c448c$0$29966$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 03 Apr 2013 09:43:06 -0400, Roy Smith wrote: [...] n = max(map(ord, s)) 4 if n 0x else 2 if n 0xff else 1 This has to inspect the entire string,

Re: Decorating functions without losing their signatures

2013-04-03 Thread Michele Simionato
On Wednesday, April 3, 2013 3:05:31 AM UTC+2, Rotwang wrote: After thinking about it for a while I've come up with the following abomination Alas, there is actually no good way to implement this feature in pure Python without abominations. Internally the decorator module does something

question about csv.DictReader

2013-04-03 Thread Norman Clerman
Hello, I have the following python script (some of lines are wrapped): #! /usr/bin/env python import csv def dict_test_1(): csv test program # Open the file Holdings_EXA.csv HOLDING_FILE = 'Holdings_EXA.csv' try: csv_file = open(HOLDING_FILE, 'rt') except

In defence of 80-char lines

2013-04-03 Thread Steven D'Aprano
Although PEP 8 is only compulsory for the Python standard library, many users like to stick to PEP 8 for external projects. http://www.python.org/dev/peps/pep-0008/ With perhaps one glaring exception: many people hate, or ignore, PEP 8's recommendation to limit lines to 80 characters.

Re: Decorating functions without losing their signatures

2013-04-03 Thread Rotwang
On 03/04/2013 02:05, Rotwang wrote: [...] After thinking about it for a while I've come up with the following abomination: import inspect def sigwrapper(sig): if not isinstance(sig, inspect.Signature): sig = inspect.signature(sig) def wrapper(f): ps = 'args = []\n\t\t' ks

Re: Decorating functions without losing their signatures

2013-04-03 Thread Rotwang
On 03/04/2013 05:15, Steven D'Aprano wrote: On Wed, 03 Apr 2013 02:05:31 +0100, Rotwang wrote: Hi all, Here's a Python problem I've come up against and my crappy solution. Hopefully someone here can suggest something better. I want to decorate a bunch of functions with different signatures;

Re: In defence of 80-char lines

2013-04-03 Thread Andrew Berg
While I agree that not having a line take up hundreds of characters is a good thing, 80 is really arbitrary in 2013 and having any self-imposed hard limit is silly. When you put a single 4- or 5-character word on a new line because you don't want to go over 80 (or 120 or whatever), the code is

Windows printing problem (was re; IDLE printing problem_

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 6:26 PM, Joe Hill wrote: In light of the fact that this is a new problem and has only occurred in Python - I shall just regard that as either a feature or flaw... Based on what you have said, the problem IS NOT OCCURRING IN PYTHON. It is occurring in the Microsoft HTML help

Re: Data storage Py 3.3

2013-04-03 Thread Terry Jan Reedy
On 4/3/2013 6:53 PM, Irmen de Jong wrote: On 4-4-2013 0:33, Joe Hill wrote: IDLE wants to use Python33 as the data storage folder - with exe files etc. Typically the 'default data storage' is in 'last used' directory or most programs even have a browse setting that one can quickly set and

Re: Decorating functions without losing their signatures

2013-04-03 Thread Rotwang
On 04/04/2013 02:18, Michele Simionato wrote: On Wednesday, April 3, 2013 3:05:31 AM UTC+2, Rotwang wrote: After thinking about it for a while I've come up with the following abomination Alas, there is actually no good way to implement this feature in pure Python without abominations.

Re: In defence of 80-char lines

2013-04-03 Thread Mitya Sirenef
On 04/03/2013 09:59 PM, Andrew Berg wrote: While I agree that not having a line take up hundreds of characters is a good thing, 80 is really arbitrary in 2013 and having any self-imposed hard limit is silly. When you put a single 4- or 5-character word on a new line because you don't want

Re: question about csv.DictReader

2013-04-03 Thread MRAB
On 04/04/2013 02:26, Norman Clerman wrote: Hello, I have the following python script (some of lines are wrapped): #! /usr/bin/env python import csv def dict_test_1(): csv test program # Open the file Holdings_EXA.csv HOLDING_FILE = 'Holdings_EXA.csv' try:

Re: question about csv.DictReader

2013-04-03 Thread Tim Chase
On 2013-04-03 18:26, Norman Clerman wrote: Can anyone explain the presence of the characters \xref\xbb\xbf before the first field contents Holdings ? (you mean \xef, not \xref) This is a byte-order-mark (BOM), which you can read about at [1]. In this case, it denotes the file as UTF-8

Python 3.3 Tkinter Fullscreen - Taskbar not Hiding

2013-04-03 Thread teslafrequency
Hi, I am working with Tkinter, and I have set up some simple code to run: import tkinter import re from tkinter import * global master master = Tk() # Start game Launcher def FormGUI(): master.title(GAME TITLE) SW = master.winfo_screenwidth() / 3.2 SH = master.winfo_screenheight() /

Re: In defence of 80-char lines

2013-04-03 Thread llanitedave
I also tend to prefer a maximum between 110 and 120 characters. I find continuation lines confusing, and when you use some third-party tools, such as wxPython, for example, the boilerplate code leads to some long lines. I would hate to have to break up this line, for instance:

Re: In defence of 80-char lines

2013-04-03 Thread rusi
On Apr 4, 6:36 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Although PEP 8 is only compulsory for the Python standard library, many users like to stick to PEP 8 for external projects. http://www.python.org/dev/peps/pep-0008/

Re: Time zone changing while Win app is running

2013-04-03 Thread CM
I am not the maintainer of the datetime module, but based purely on what you have said, I would consider that a bug. I don't. Do you really want every time function slowed by re-initializing the timezone? It depends; do you know what re-initializing entails and how costly that would be?

  1   2   3   >