steps to solve bugs

2012-03-10 Thread ejjy
Hi, I am currently learning python and I would like to solve some easy bugs for my own practice. I am confused over following the steps explained in the Python website, though I have the appropriate software necessities. Kindly some one please tell me in a more practical and easy way. Thanks. Reg

Re: PyUSB available for current versions of Windows?

2012-03-10 Thread Dietmar Schwertberger
Am 09.03.2012 18:18, schrieb John Nagle: I want to enumerate the available USB devices. All I really need is the serial number of the USB devices available to PySerial. (When you plug in a USB device on Windows, it's assigned the next available COM port number. On a reboot, the numbers are reassi

Invalid syntax error

2012-03-10 Thread sl33k
I'm trying project euler problem 3 and I've hit the wall with this error. What could be the problem here? l=[] >>> num=600851475143 >>> i=1 >>> while i<=num: ... if num%i==0: ... l.append(i) ... i+=1 ... print max(l) File "", line 5 print max(l) ^ SyntaxError: invali

Re: Invalid syntax error

2012-03-10 Thread Amit Sethi
Its an indentation error -- A-M-I-T S|S -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid syntax error

2012-03-10 Thread Andrew Berg
On 3/10/2012 6:34 AM, sl33k wrote: > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > > l=[] num=600851475143 i=1 while i<=num: > ... if num%i==0: > ... l.append(i) > ... i+=1 > ... print max(l) > File "

Re: Invalid syntax error

2012-03-10 Thread Vlastimil Brom
2012/3/10 sl33k : > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > >  l=[] num=600851475143 i=1 while i<=num: > ...     if num%i==0: > ...         l.append(i) > ...     i+=1 > ... print max(l) >  File "", line 5 >    prin

Re: Invalid syntax error

2012-03-10 Thread Ahsan
Just checked my version. Its showing 2.6.5. >>> sys.version '2.6.5 (r265:79063, Apr 16 2010, 13:09:56) \n[GCC 4.4.3]' -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid syntax error

2012-03-10 Thread liuerfire Wang
在 2012年3月10日星期六UTC+8下午8时34分35秒,sl33k写道: > I'm trying project euler problem 3 and I've hit the wall with this > error. What could be the problem here? > > l=[] > >>> num=600851475143 > >>> i=1 > >>> while i<=num: > ... if num%i==0: > ... l.append(i) > ... i+=1 > ... print max(l) >

[no subject]

2012-03-10 Thread Sam Sam
How to change the color of source browser in DrPython? -- http://mail.python.org/mailman/listinfo/python-list

Re: Invalid syntax error

2012-03-10 Thread Günther Dietrich
In article <46758542-1bd6-43fe-8e80-bcf14b7d8...@pi6g2000pbc.googlegroups.com>, sl33k wrote: >I'm trying project euler problem 3 and I've hit the wall with this >error. What could be the problem here? > > l=[] num=600851475143 i=1 while i<=num: >... if num%i==0: >...

nmea

2012-03-10 Thread Johannes Wagner
can any1 help me on how to get python to read nmea data? -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't get around HTTP/401 response using SUDS [SOLVED]

2012-03-10 Thread Adam Tauno Williams
On Fri, 2012-03-09 at 00:03 +0100, Rafael Durán Castañeda wrote: > El 08/03/12 16:44, Adam Tauno Williams escribió: > > SUDS version 0.4 pn x86_64 Python 2.7 > > I'm having a bear of a time getting HTTP Basic Authentication to work > > for a SOAP request via suds. Also using an HTTP proxy server.

Re: nmea

2012-03-10 Thread Roy Smith
In article , "Johannes Wagner" wrote: > can any1 help me on how to get python to read nmea data? I assume you're talking about National Marine Electronics Association, i.e. the protocol GPSs use to talk to plotters and the like? A quick google search for "nmea python" found a bunch of good h

How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byte code, they will no

How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byte code, they will no

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Bl0ckeduser
Gelonida N wrote: Hi, I want to know whether two .pyc files are identical. With identical I mean whether they contain the same byte code. Unfortunately it seems, that .pyc files contain also something like the time stamp of the related source file. So though two pyc files contain the same byt

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Peter Otten
Gelonida N wrote: > I want to know whether two .pyc files are identical. > > With identical I mean whether they contain the same byte code. > > Unfortunately it seems, that .pyc files contain also something like the > time stamp of the related source file. > > So though two pyc files contain th

Re: Invalid syntax error

2012-03-10 Thread Ian Kelly
On Sat, Mar 10, 2012 at 6:17 AM, Günther Dietrich wrote: > In article > <46758542-1bd6-43fe-8e80-bcf14b7d8...@pi6g2000pbc.googlegroups.com>, >  sl33k wrote: > >>I'm trying project euler problem 3 and I've hit the wall with this >>error. What could be the problem here? >> >> l=[] > num=6008514

Re: stackoverflow question

2012-03-10 Thread Ethan Furman
Terry Reedy wrote: Thanks for the review, Terry! On 3/9/2012 5:10 PM, Ethan Furman wrote: http://stackoverflow.com/q/9638921/208880 If anyone here is willing to take a look at it and let me know if I did not write it well, I would appreciate the feedback Here's the question text: --

Re: newb __init__ inheritance

2012-03-10 Thread Colin J. Williams
On 08/03/2012 10:25 AM, hyperboogie wrote: Hello everyone. This is my first post in this group. I started learning python a week ago from the "dive into python" e- book and thus far all was clear. However today while reading chapter 5 about objects and object orientation I ran into something tha

Re: stackoverflow question

2012-03-10 Thread Terry Reedy
On 3/10/2012 11:56 AM, Ethan Furman wrote: I'm writing a metaclass to do some cool stuff, and part of its processing is to check that certain attributes exist when the class is created. Some of these are mutable, and would normally be set in `__init__`, but since `__init__` isn't run until the

Re: steps to solve bugs

2012-03-10 Thread Miki Tebeka
Greetings, > I am confused over following the steps > explained in the Python website, Are you talking about http://docs.python.org/devguide/? > Kindly some one please tell me in a more > practical and easy way. Can you tell in more details what are the problems you face? This will help us help y

How to re-implement the crypt.crypt function?

2012-03-10 Thread Cosmia Luna
I'm not searching for a full solution and only want to know how to use hashlib to create a equivalent string like crypt.crypt('123456', '$6$ds41p/9VMA.BHH0U') returns the string below. '$6$ds41p/9VMA.BHH0U$yv25s7jLxTRKLDNjIvT0Qc2jbcqdFRi5.PftO3cveTvjK49JhwCarIowOfrrNPD/PpYT3n6oNDIbjAONh8RXt1'

Re: stackoverflow question

2012-03-10 Thread Owen Jacobson
On 2012-03-09 22:10:18 +, Ethan Furman said: Hey all! I posted a question/answer on SO earlier, but there seems to be some confusion around either the question or the answer (judging from the comments). http://stackoverflow.com/q/9638921/208880 If anyone here is willing to take a look

Re: How to re-implement the crypt.crypt function?

2012-03-10 Thread Christian Heimes
Am 10.03.2012 20:33, schrieb Cosmia Luna: > I'm not searching for a full solution and only want to know how to use > hashlib to create a equivalent string like If you chance your mind and choose to use a full solution, then I highly recommend passlib [1]. It has an implementation of SHA-512 cryp

Re: How to re-implement the crypt.crypt function?

2012-03-10 Thread Roy Smith
In article <28304124.1374.1331408016748.JavaMail.geo-discussion-forums@yncd8>, Cosmia Luna wrote: > I'm not searching for a full solution and only want to know how to use > hashlib to create a equivalent string like > > crypt.crypt('123456', '$6$ds41p/9VMA.BHH0U') returns the string below.

Re: How to re-implement the crypt.crypt function?

2012-03-10 Thread Christian Heimes
Am 10.03.2012 21:15, schrieb Roy Smith: > By today's standards, the algorithm isn't considered very strong. The > only place I'm aware that uses it is unix password files, and even there > many (most?) systems have replaced it with something stronger such as > SHA1. Maybe Apache .htaccess file

Re: How to re-implement the crypt.crypt function?

2012-03-10 Thread Roy Smith
In article , Christian Heimes wrote: > Am 10.03.2012 21:15, schrieb Roy Smith: > > By today's standards, the algorithm isn't considered very strong. The > > only place I'm aware that uses it is unix password files, and even there > > many (most?) systems have replaced it with something strong

Re: How to re-implement the crypt.crypt function?

2012-03-10 Thread Christian Heimes
Am 10.03.2012 21:41, schrieb Roy Smith: > But is that what crypt.crypt() does? I though it implemented the > old-style triple-DES. Python's crypt module is an interface to the OS' crypt() function. On some systems the crypt() function supports additional algorithms. You can read it up in the not

Re: newb __init__ inheritance

2012-03-10 Thread Colin J. Williams
On 10/03/2012 12:58 PM, Colin J. Williams wrote: On 08/03/2012 10:25 AM, hyperboogie wrote: Hello everyone. [snip] main() I'm not sure that the class initialization is required. Good luck, Colin W. When I wrote earlier, I wondered about the need for initialization. With Version 2, both __

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Steven D'Aprano
On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > Hi, > > I want to know whether two .pyc files are identical. > > With identical I mean whether they contain the same byte code. Define "identical" and "the same". If I compile these two files: # file ham.py x = 23 def func(): a = 23

Re: stackoverflow question

2012-03-10 Thread Ethan Furman
Owen Jacobson wrote: On 2012-03-09 22:10:18 +, Ethan Furman said: Hey all! I posted a question/answer on SO earlier, but there seems to be some confusion around either the question or the answer (judging from the comments). http://stackoverflow.com/q/9638921/208880 If anyone here is w

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Chris Angelico
On Sun, Mar 11, 2012 at 9:52 AM, Steven D'Aprano wrote: > On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > Define "identical" and "the same". > > If I compile these two files: > > > # file ham.py > x = 23 > def func(): >    a = 23 >    return a + 19 > > > > # file = spam.py > def func(): >

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-10 Thread Hrvoje Niksic
Stefan Behnel writes: >> which is the standard way of extending Python with high-performance >> (and/or system-specific) C code. > > Well, it's *one* way. Certainly not the easiest way, neither the most > portable and you'll have a hard time making it the fastest. I didn't say it was easy, but

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-10 Thread Terry Reedy
On 3/10/2012 8:03 PM, Hrvoje Niksic wrote: Stefan Behnel writes: which is the standard way of extending Python with high-performance (and/or system-specific) C code. Well, it's *one* way. Certainly not the easiest way, neither the most portable and you'll have a hard time making it the fast

[RFC] PEP 3143: supplementary group list concerns

2012-03-10 Thread Jan Pokorný
Hello, in the light of a recent spot in Python Paste [1], I've come across the python-daemon [2] implementation and found it also lacks support for supplementary groups. First, I just wanted to post a patch to the author, but realized the broader context of PEP 3143 that would probably deserve r

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Gelonida N
Hi Steven, On 03/10/2012 11:52 PM, Steven D'Aprano wrote: > > On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: > > >> >> Hi, >> >> >> >> I want to know whether two .pyc files are identical. >> >> >> >> With identical I mean whether they contain the same byte code. > > > > Define "identical" a

Re: stackoverflow question

2012-03-10 Thread Owen Jacobson
On 2012-03-10 22:21:55 +, Ethan Furman said: Owen Jacobson wrote: On 2012-03-09 22:10:18 +, Ethan Furman said: Hey all! I posted a question/answer on SO earlier, but there seems to be some confusion around either the question or the answer (judging from the comments). http://stac

Re: "Decoding unicode is not supported" in unusual situation

2012-03-10 Thread John Nagle
On 3/9/2012 4:57 PM, Steven D'Aprano wrote: On Fri, 09 Mar 2012 10:11:58 -0800, John Nagle wrote: This demonstrates a gross confusion about both Unicode and Python. John, I honestly don't mean to be rude here, but if you actually believe that (rather than merely expressing yourself poorly), then

Re: How to know that two pyc files contain the same code

2012-03-10 Thread Steven D'Aprano
On Sun, 11 Mar 2012 12:15:11 +1100, Chris Angelico wrote: > On Sun, Mar 11, 2012 at 9:52 AM, Steven D'Aprano > wrote: >> On Sat, 10 Mar 2012 15:48:48 +0100, Gelonida N wrote: Define >> "identical" and "the same". >> >> If I compile these two files: >> >> >> # file ham.py >> x = 23 >> def func():

Re: Porting the 2-3 heap data-structure library from C to Python

2012-03-10 Thread Stefan Behnel
Hrvoje Niksic, 11.03.2012 02:03: > Stefan Behnel writes: >>> which is the standard way of extending Python with high-performance >>> (and/or system-specific) C code. >> >> Well, it's *one* way. Certainly not the easiest way, neither the most >> portable and you'll have a hard time making it the fa