Re: How to read and post tracebacks (was Registry Key Value Help)

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 4:16 PM, Rustom Mody wrote: > Something like this is what I had in mind > http://help.openerp.com/question/9704/how-to-read-and-understand-errors-from-tracebacks/ > Hrm, site's having trouble. First time I tried it, it came back with a gateway timeout. Seemed to work second

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 3:16 PM, Ethan Furman wrote: > On 01/02/2014 04:06 PM, Chris Angelico wrote: >> >> >> Here's a crazy idea. Suppose we have a "sticky falseness" that can >> quietly propagate through an expression the way a NaN can... then we >> could just float that right through the .group(

Re: How to read and post tracebacks (was Registry Key Value Help)

2014-01-02 Thread Rustom Mody
On Fri, Jan 3, 2014 at 9:33 AM, Chris Angelico wrote: > On Fri, Jan 3, 2014 at 2:58 PM, Rustom Mody wrote: >> Why not write up a few lines on "How to read and post python tracebacks" >> and post it on the wiki? > > You mean "copy and paste the whole output"? I'm not sure what more > needs to be s

Re: Blog "about python 3"

2014-01-02 Thread Steven D'Aprano
Robin Becker wrote: > For fairly sensible reasons we changed the internal default to use unicode > rather than bytes. After doing all that and making the tests compatible > etc etc I have a version which runs in both and passes all its tests. > However, for whatever reason the python 3.3 version r

Re: About some problem

2014-01-02 Thread Mark Lawrence
On 03/01/2014 04:18, Ethan Furman wrote: On 01/02/2014 05:14 PM, Mark Lawrence wrote: On 02/01/2014 23:49, Steven D'Aprano wrote: Mark Lawrence wrote: raise "Not Valid DB Type" is perfectly valid in Python 2. Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5, string ex

Re: Ifs and assignments

2014-01-02 Thread Ethan Furman
On 01/02/2014 04:06 PM, Chris Angelico wrote: Here's a crazy idea. Suppose we have a "sticky falseness" that can quietly propagate through an expression the way a NaN can... then we could just float that right through the .group() call. class truth: def __new__(cls, x): if x: retu

Re: About some problem

2014-01-02 Thread Ethan Furman
On 01/02/2014 05:14 PM, Mark Lawrence wrote: On 02/01/2014 23:49, Steven D'Aprano wrote: Mark Lawrence wrote: raise "Not Valid DB Type" is perfectly valid in Python 2. Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5, string exceptions display a warning but continue to

Re: How to read and post tracebacks (was Registry Key Value Help)

2014-01-02 Thread Roy Smith
In article , Chris Angelico wrote: > On Fri, Jan 3, 2014 at 2:58 PM, Rustom Mody wrote: > > Why not write up a few lines on "How to read and post python tracebacks" > > and post it on the wiki? > > You mean "copy and paste the whole output"? I'm not sure what more > needs to be said about post

Re: Ifs and assignments

2014-01-02 Thread Mark Lawrence
On 03/01/2014 04:25, Chris Angelico wrote: On Fri, Jan 3, 2014 at 3:14 PM, Roy Smith wrote: Or turn it into a generator: That certainly makes your mainline code cleaner... Cleaner perhaps, but not clearer. Instead of seeing the original function (say, a database retrieve-next call), you see a

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 3:14 PM, Roy Smith wrote: > Or turn it into a generator: > That certainly makes your mainline code cleaner... Cleaner perhaps, but not clearer. Instead of seeing the original function (say, a database retrieve-next call), you see a wrapper and have to go dig to find out wha

Re: Ifs and assignments

2014-01-02 Thread Roy Smith
In article , Chris Angelico wrote: > while (var = func()) > { > > } > > In Python, that gets a lot clunkier. The most popular way is to turn > it into an infinite loop: > > while True: > var = func() > if not var: break > Or turn it into a generator: def funcinator(

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 3:00 PM, Roy Smith wrote: > I do this all the time: > > t0 = time.time() > [some code] > t1 = time.time() > dt = t1 = t0 # <-- spot the typo? Yep, I see that... now that it's pointed out as a typo. Without the marker, I'd assume it's correct chained assignment, and only a

Re: Ifs and assignments

2014-01-02 Thread Roy Smith
In article , Chris Angelico wrote: > On Fri, Jan 3, 2014 at 2:33 PM, Steven D'Aprano > wrote: > > Personally, I find it hard to care about assignment as an expression. I find > > the obvious C-inspired syntax terrible, as it is too easy to mistakenly use > > == instead of = or visa versa: > >

Re: How to read and post tracebacks (was Registry Key Value Help)

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 2:58 PM, Rustom Mody wrote: > Why not write up a few lines on "How to read and post python tracebacks" > and post it on the wiki? You mean "copy and paste the whole output"? I'm not sure what more needs to be said about posting them. Reading them is a bit more complicated,

How to read and post tracebacks (was Registry Key Value Help)

2014-01-02 Thread Rustom Mody
On Fri, Jan 3, 2014 at 8:35 AM, Chris Angelico wrote: > On Fri, Jan 3, 2014 at 11:12 AM, J. McGaha wrote: >> When I run the this code I get an error that says the ‘int’ can’t be called. >> > > Python errors include full backtraces that show exactly what's going > on. They are extremely helpful, s

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 2:33 PM, Steven D'Aprano wrote: > Personally, I find it hard to care about assignment as an expression. I find > the obvious C-inspired syntax terrible, as it is too easy to mistakenly use > == instead of = or visa versa: Python has similar problems, though. It's inherent t

Re: About some problem

2014-01-02 Thread Larry Hudson
On 01/02/2014 08:31 AM, raj kumar wrote: Hello, I am beginner to python and i am writing following code from pytesser import * and i am getting an error as follow Traceback (most recent call last): File "", line 1, in File "C:\Python33\lib\site-packages\pytesser.py", line 61 print

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 2:33 PM, Steven D'Aprano wrote: > However, I don't think we should treat this as specific to if statements: > > for i, obj in enumerate(alist + blist + clist as items): > items[i] = process(obj) > > > Is that really better than this? > > items = alist + blist

Re: Ifs and assignments

2014-01-02 Thread Steven D'Aprano
Dennis Lee Bieber wrote: > On Thu, 02 Jan 2014 17:20:54 +, John Allsup > declaimed the following: >>In many languages, such as C, one can use assignments in conditionals >>and expressions. The most common, and useful case turns up when you > > Really? You can't do it in FORTRAN, BASIC, COB

Re: Registry Key Value Help

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 11:12 AM, J. McGaha wrote: > When I run the this code I get an error that says the ‘int’ can’t be called. > Python errors include full backtraces that show exactly what's going on. They are extremely helpful, so when you post questions like this, you should copy and paste t

Registry Key Value Help

2014-01-02 Thread J. McGaha
Good evening, I am a complete noob at Python. I am attempting to create a key and update its value. The code below is what I have come up with after reading everything I can get my hands on. When I run the this code I get an error that says the 'int' can't be called. I appreciate your h

Re: need to print seconds from the epoch including the millisecond

2014-01-02 Thread Dave Angel
On Thu, 2 Jan 2014 16:23:22 + (UTC), Grant Edwards wrote: AFAIK, that's irrelevent. time.time() returns a float. On all the CPython implementations I know of, that is a 64-bit IEEE format, which provides 16 decimal digits of precision regardless of the granularity of the system time va

Re: Ifs and assignments

2014-01-02 Thread Mark Lawrence
On 03/01/2014 00:57, Gary Herron wrote: On 01/02/2014 01:44 PM, John Allsup wrote: The point of my original post was that, whilst C's if( x = 2 ) { do something } and if( x == 2 ) { do something } are easy to confuse, and a source of bugs, having a construct like follows: if x == 2: do

Re: About some problem

2014-01-02 Thread Mark Lawrence
On 02/01/2014 23:49, Steven D'Aprano wrote: Mark Lawrence wrote: raise "Not Valid DB Type" is perfectly valid in Python 2. Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5, string exceptions display a warning but continue to work, and in Python 2.6 they generate a compi

Re: Ifs and assignments

2014-01-02 Thread Gary Herron
On 01/02/2014 01:44 PM, John Allsup wrote: The point of my original post was that, whilst C's if( x = 2 ) { do something } and if( x == 2 ) { do something } are easy to confuse, and a source of bugs, having a construct like follows: if x == 2: do something # what happens at present if

Re: Setuptools - cannot install

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 9:26 AM, wrote: > File "C:\Python\lib\mimetypes.py", line 255, in read_windows_registry > with _winreg.OpenKey(hkcr, subkeyname) as subkey: > TypeError: OpenKey() argument 2 must be str without null characters or None, > not str Interestingly, I pulled up that file

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 10:36 AM, Roy Smith wrote: > The most common place I wish for an atomic "test and assign" is with > regexes, as in your examples. This would be so much nicer than what we > have to do now: > > if re.match(string) as m: > print m.group(0) Here's a crazy idea. Su

Re: Ifs and assignments

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 11:06 AM, Chris Angelico wrote: > Pass any object through truth() and it'll either stay the same (if > it's true) or become this object (if it's false). You can then carry > on with other method calls, and they'll all happily return false. > > result = ( > truth(re1.matc

Re: Blog "about python 3"

2014-01-02 Thread Antoine Pitrou
Hi, Robin Becker reportlab.com> writes: > > For fairly sensible reasons we changed the internal default to use unicode > rather than bytes. After doing all that and making the tests compatible etc etc > I have a version which runs in both and passes all its tests. However, for > whatever rea

Re: On a scrollbar for tkinter

2014-01-02 Thread Rick Johnson
I know you're using Python3.x, so there may be new functionality in Tkinter that i am not aware of yet. I still have oodles of Python2.x dependencies and really don't see a need to make the jump yet -- so keep that in mind when taking my advice below. In the old days of Tkinter, if you wanted

Re: About some problem

2014-01-02 Thread Steven D'Aprano
Mark Lawrence wrote: > raise "Not Valid DB Type" > > is perfectly valid in Python 2. Actually, no it isn't. It's only valid up to Python 2.4. In Python 2.5, string exceptions display a warning but continue to work, and in Python 2.6 they generate a compile-time SyntaxError. You know how the wo

Re: Ifs and assignments

2014-01-02 Thread Roy Smith
In article , John Allsup wrote: > if testFunc() as x: > do something with x +1 The most common place I wish for an atomic "test and assign" is with regexes, as in your examples. This would be so much nicer than what we have to do now: if re.match(string) as m: print m.g

Re: Ifs and assignments

2014-01-02 Thread John Allsup
The point of my original post was that, whilst C's if( x = 2 ) { do something } and if( x == 2 ) { do something } are easy to confuse, and a source of bugs, having a construct like follows: if x == 2: do something # what happens at present if testFunc() as x: do something with

Re: Score one for unit testing.

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 9:53 AM, Roy Smith wrote: > We've got a test that's been running fine ever since it was written a > month or so ago. Now, it's failing intermittently on our CI (continuous > integration) box, so I took a look. I recommend you solve these problems the way these folks did:

Score one for unit testing.

2014-01-02 Thread Roy Smith
We've got a test that's been running fine ever since it was written a month or so ago. Now, it's failing intermittently on our CI (continuous integration) box, so I took a look. It turns out it's a stupid test because it depends on pre-existing data in the database. But, the win is that while

Re: On a scrollbar for tkinter

2014-01-02 Thread eneskristo
@Teddy Yes, indeed I have, but so far I have only found material for scrolling in other stuff, not the main frame. If you can give me a link... -- https://mail.python.org/mailman/listinfo/python-list

Setuptools - cannot install

2014-01-02 Thread tim . hamza
setuptools 2.0.2, win7 x64, python 3.3.3 (64bit), tried as user (who is admin, and as admin) This started happening several versions ago. Could not track down a setuptools support list. Any ideas? C:\Users\tim\Desktop\setuptools-2.0.2>python setup.py install Traceback (most recent call last):

Re: Ifs and assignments

2014-01-02 Thread Tim Chase
On 2014-01-02 17:20, John Allsup wrote: > m = r1.search(w) > if m: > handleMatch1(m) > else: > m = r2.search(w) > if m: > handleMatch2(m) > else: > print("No match") > > if not running unnecessary matches, yet capturing groups in the > event of a

Re: On a scrollbar for tkinter

2014-01-02 Thread Terry Reedy
On 1/2/2014 2:52 PM, eneskri...@gmail.com wrote: I'm new to tkinter, but I have to use it for a program for a competition. So, I make a RadioButton program using a while loop. So far so good, fully working. BUT it didn't show the full content, even after maximising the window. So, my question

On a scrollbar for tkinter

2014-01-02 Thread eneskristo
Hello people! I'm new to tkinter, but I have to use it for a program for a competition. So, I make a RadioButton program using a while loop. So far so good, fully working. BUT it didn't show the full content, even after maximising the window. So, my question is, how do I make a scroll bar(On x a

Re: Ifs and assignments

2014-01-02 Thread Gary Herron
On 01/02/2014 09:20 AM, John Allsup wrote: Hi, This is my debut on this list. In many languages, such as C, one can use assignments in conditionals and expressions. The most common, and useful case turns up when you have if/else if/else if/else constructs. Consider the following non-working

Re: About some problem

2014-01-02 Thread Mark Lawrence
On 02/01/2014 17:46, Rustom Mody wrote: Oh ok I get what you are saying: python3 will not recognize a python2 package and install it seemingly correctly but actually wrongly No, it will install it quite correctly. What it won't know is that some of the code is valid in Python 2 but invalid

Re: Blog "about python 3"

2014-01-02 Thread Terry Reedy
On 1/2/2014 12:36 PM, Robin Becker wrote: I just spent a large amount of effort porting reportlab to a version which works with both python2.7 and python3.3. I have a large number of functions etc which handle the conversions that differ between the two pythons. I am imagine that this was not

Re: Ifs and assignments

2014-01-02 Thread Ethan Furman
On 01/02/2014 09:20 AM, John Allsup wrote: In many languages, such as C, one can use assignments in conditionals and expressions. The most common, and useful case turns up when you have if/else if/else if/else constructs. Consider the following non-working pseudoPython. import re r1 = re.comp

Re: Blog "about python 3"

2014-01-02 Thread David Hutto
Just because it's 3.3 doesn't matter...the main interest is in compatibility. Secondly, you used just one piece of code, which could be a fluke, try others, and check the PEP. You need to realize that evebn the older versions are benig worked on, and they have to be refined. So if you have a proble

Re: About some problem

2014-01-02 Thread David Hutto
Looks like you have a a list of 2.7 dependencies in the path args. The first you seem to have 3.3 args, and the second a longer list of 2.7 argsI would assume the second is the full list...correct? On Thu, Jan 2, 2014 at 1:07 PM, David Hutto wrote: > I think, but haven't tried, and this

Re: About some problem

2014-01-02 Thread David Hutto
and as I usually do, keep with the older stable version in order to keep up with other packages compatibiity. On Thu, Jan 2, 2014 at 1:07 PM, David Hutto wrote: > I think, but haven't tried, and this would be 2-3 from __future__ import > > > On Thu, Jan 2, 2014 at 12:46 PM, Rustom Mody wrote:

Re: About some problem

2014-01-02 Thread David Hutto
I think, but haven't tried, and this would be 2-3 from __future__ import On Thu, Jan 2, 2014 at 12:46 PM, Rustom Mody wrote: > On Thu, Jan 2, 2014 at 11:06 PM, Ned Batchelder > wrote: > > On 1/2/14 12:05 PM, Rustom Mody wrote: > > > >> > >> i'm not sure about this but isnt it normally the cas

Re: About some problem

2014-01-02 Thread Rustom Mody
On Thu, Jan 2, 2014 at 11:06 PM, Ned Batchelder wrote: > On 1/2/14 12:05 PM, Rustom Mody wrote: > >> >> i'm not sure about this but isnt it normally the case that different >> version modules dont get mixed up like that? >> IOW if pytesser was a properly packaged 2.7 module would python 3 be >> ab

Re: Blog "about python 3"

2014-01-02 Thread Robin Becker
On 31/12/2013 15:41, Roy Smith wrote: I'm using 2.7 in production. I realize that at some point we'll need to upgrade to 3.x. We'll keep putting that off as long as the "effort + dependencies + risk" metric exceeds the "perceived added value" metric. We too are using python 2.4 - 2.7 in produc

Re: About some problem

2014-01-02 Thread Ned Batchelder
On 1/2/14 12:05 PM, Rustom Mody wrote: i'm not sure about this but isnt it normally the case that different version modules dont get mixed up like that? IOW if pytesser was a properly packaged 2.7 module would python 3 be able to get at it ?? If you use a Python 3 installer it can succeed at

Argparse class method based instantiation

2014-01-02 Thread Joseph L. Casale
I have an Python3 argparse implementation that is invoked as a method from an imported class within a users script __main__. When argparse is setup in __main__ instead, all the help switches produce help then exit. When a help switch is passed based on the above implementation, they are ignored

Ifs and assignments

2014-01-02 Thread John Allsup
Hi, This is my debut on this list. In many languages, such as C, one can use assignments in conditionals and expressions. The most common, and useful case turns up when you have if/else if/else if/else constructs. Consider the following non-working pseudoPython. import re r1 = re.compile(

looking for a quote on age and technology

2014-01-02 Thread Rustom Mody
On Thu, Jan 2, 2014 at 11:22 AM, Ben Finney wrote: > I think you're referring to an article by the late, great Douglas Adams, > “How to Stop Worrying and Learn to Love the Internet”: Thanks Ben -- Yes thats the one I was looking for! -- https://mail.python.org/mailman/listinfo/python-list

Re: About some problem

2014-01-02 Thread Mark Lawrence
On 02/01/2014 16:53, Joel Goldstick wrote: On Thu, Jan 2, 2014 at 11:31 AM, raj kumar mailto:rajkumar84...@gmail.com>> wrote: Hello, I am beginner to python and i am writing following code from pytesser import * and i am getting an error as follow Traceback (most recent cal

Re: About some problem

2014-01-02 Thread Rustom Mody
On Thu, Jan 2, 2014 at 10:23 PM, Joel Goldstick wrote: > > > > On Thu, Jan 2, 2014 at 11:31 AM, raj kumar wrote: >> >> Hello, I am beginner to python and i am writing following code >> >> from pytesser import * >> >> and i am getting an error as follow >> >> Traceback (most recent call last): >>

Re: Python 2.x and 3.x usage survey

2014-01-02 Thread Grant Edwards
On 2013-12-31, Steven D'Aprano wrote: > Mark Lawrence wrote: > >> On 30/12/2013 21:56, Dan Stromberg wrote: >>> I keep hearing naysayers, nay saying about Python 3.x. >>> >>> Here's a 9 question, multiple choice survey I put together about >>> Python 2.x use vs Python 3.x use. >>> >>> I'd be very

Re: About some problem

2014-01-02 Thread Joel Goldstick
On Thu, Jan 2, 2014 at 11:31 AM, raj kumar wrote: > Hello, I am beginner to python and i am writing following code > > from pytesser import * > > and i am getting an error as follow > > Traceback (most recent call last): > File "", line 1, in > File "C:\Python33\lib\site-packages\pytesser.py

About some problem

2014-01-02 Thread raj kumar
Hello, I am beginner to python and i am writing following code from pytesser import * and i am getting an error as follow Traceback (most recent call last): File "", line 1, in File "C:\Python33\lib\site-packages\pytesser.py", line 61 print text ^ SyntaxError: invalid synta

Re: So, what's the real story on Python 2 vs Python 3?

2014-01-02 Thread Grant Edwards
On 2013-12-27, Andrew Berg wrote: > On 2013.12.26 23:04, Travis McGee wrote: >> The Python.org site says that the future is Python 3, yet whenever I try >> something new in Python, such as Tkinter which I am learning now, >> everything seems to default to Python 2. By this I mean that, whenever

Re: So, what's the real story on Python 2 vs Python 3?

2014-01-02 Thread Grant Edwards
On 2013-12-27, Travis McGee wrote: > The Python.org site says that the future is Python 3, yet whenever I > try something new in Python, such as Tkinter which I am learning now, > everything seems to default to Python 2. By this I mean that, > whenever I find that I need to install another packag

Re: need to print seconds from the epoch including the millisecond

2014-01-02 Thread Grant Edwards
On 2013-12-26, Steven D'Aprano wrote: > matt.doolittl...@gmail.com wrote: > >> On Thursday, December 26, 2013 2:22:10 PM UTC-5, Dan Stromberg wrote: >>> On Thu, Dec 26, 2013 at 10:32 AM, wrote: >>> >>> > i am using 2.7. I need to print the time in seconds from the epoch >>> > with millisecond

python finance

2014-01-02 Thread d ss
dailystockselect.com needs a couple of talented python people for the development and implementation of new trading strategies. it may be also some pythonic design change for the displayed figures now the web app consists of 1 of the 8 conceived strategies. contact us at the email on the website f

editing video using python

2014-01-02 Thread Alok Singh Mahor
Hello everyone, I want to join 2 or 3 video and want to add effect of fading in and out. I also want to add text strip on the video. I am not able to decide what to adopt for doing this task. I have option of MLT ( http://www.mltframework.org/bin/view/MLT/WebHome ) but I guess its too complex and