I am facing an issue while decoding json string using json.loads

2012-12-25 Thread sajuptpm
I am facing an issue while decoding json string using json.loads(jstring). Its working, if i do json.dumps(eval(jstring)) before json.loads(jstring). I could not figure out the issue. I want to avoide use of "eval" here. ## Failing without json.dumps(eval(jstring)) def

Re: Command Line Progress Bar

2012-12-25 Thread Mitya Sirenef
On 12/26/2012 01:17 AM, Kevin Anthony wrote: Hello, I'm writing a file processing script(Linux), and i would like to have a progress bar. But i would also like to be able to print messages. Is there a simple way of doing this without implementing something like ncurses? -- Thanks Kevin Ant

Command Line Progress Bar

2012-12-25 Thread Kevin Anthony
Hello, I'm writing a file processing script(Linux), and i would like to have a progress bar. But i would also like to be able to print messages. Is there a simple way of doing this without implementing something like ncurses? -- Thanks Kevin Anthony www.NoSideRacing.com Do you use Banshee? Dow

Re: EOFError why print(e) cannot print out any information ?

2012-12-25 Thread Andrew Berg
On 2012.12.25 23:26, iMath wrote: > why print(e) cannot print out any information ? If you want to manipulate tracebacks, use sys.exc_info() and the traceback module from the standard library. The logging module also comes with an exception() function and an exception() method for Logger objects th

EOFError why print(e) cannot print out any information ?

2012-12-25 Thread iMath
why print(e) cannot print out any information ? class user: def __init__(self, x,y,z): self.id = x self.name = y self.emailadd=z def dispuser(self): print('User ID: ', self.id) print('User Name : ', se

Re: Simple audio library

2012-12-25 Thread Xantipius
On Dec 26, 5:07 am, Abhas Bhattacharya wrote: > Which simple python audio library will you suggest for low level audio > creation (for eg I want to create tones of different intensities and > frequency continously and then record the whole sequence)? (Although a > minimal audio library is ok, i

Re: Password hash

2012-12-25 Thread Ramchandra Apte
On Monday, 24 December 2012 08:08:12 UTC+5:30, Robert Montgomery wrote: > I am writing a script that will send an email using an account I set up > > in gmail. It is an smtp server using tls on port 587, and I would like > > to use a password hash in the (python) script for login rather than >

Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread alex23
On 26 Dec, 09:42, Rick Johnson wrote: > Python classes CAN and DO have variables, just as Python modules > have variables; psst: they're called "global variables"! Actually, they're called "module attributes", but don't let the facts get in the way of your little rant. You never have before. --

Re: Finding the name of a function while defining it

2012-12-25 Thread Roy Smith
In article , Abhas Bhattacharya wrote: > While I am defining a function, how can I access the name (separately as > string as well as object) of the function without explicitly naming > it(hard-coding the name)? > For eg. I am writing like: > def abc(): > #how do i access the function abc

Simple audio library

2012-12-25 Thread Abhas Bhattacharya
Which simple python audio library will you suggest for low level audio creation (for eg I want to create tones of different intensities and frequency continously and then record the whole sequence)? (Although a minimal audio library is ok, it would be better if you can tell me about a full-fledg

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 4:56:44 PM UTC-6, Steven D'Aprano wrote: > Rick, what makes you think that this is logically inconsistent? > "Method" is the accepted name for functions attached to classes. They > report themselves as "methods": > [...] > There are two built-ins for creating differen

regarding compiling the Python 2.7 and 3.3 with mingw

2012-12-25 Thread ginzzer
Hi all, For some reason, I have to develop my software with mingw under windows. First of all, I need python installed in the msys but I try all my ways to install 2.6.x, 2.7.x, 3.2.x and 3.3.0, no one succeed. I search all issues and google the related information online, it seems that it do

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 3:08:21 PM UTC-6, Dennis Lee Bieber wrote: > Only that many of us don't believe Python has /variables/, the use > of instance/class as a modifier is thereby moot. What IS a variable Dennis? # #

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Steven D'Aprano
On Tue, 25 Dec 2012 12:16:16 -0800, Rick Johnson wrote: > On Tuesday, December 25, 2012 11:10:49 AM UTC-6, Dave Angel wrote: > >> We all make mistakes, like my referring to class methods when I meant >> instance methods. > > This mistake reminded of how people in this group (maybe not you in > p

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Rick Johnson
On Tuesday, December 25, 2012 11:10:49 AM UTC-6, Dave Angel wrote: > We all make mistakes, like my referring to class methods when I > meant instance methods. This mistake reminded of how people in this group (maybe not you in particular) happily accept the terms "instance method" and "class me

Re: Scrapy/XPath help

2012-12-25 Thread donarb
On Friday, December 21, 2012 1:58:47 PM UTC-8, Always Learning wrote: > The errors I get are > >>File > >>"C:\python27\lib\site-packages\scrapy-0.16.3-py2.7.egg\scrapy\selector\lxmlsel.py", > >> line 47, in select > > >>raise ValueError("Invalid XPath: %s" % xpath) > > >>exceptions.ValueError: I

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread prilisauer
By the way i haven't add the Title because it's a german only book named "Python 3: Das umfangreiche Handbuch, Published by Galileo Computing" and also, because I've registered to first check if the Autor has allready published a update. Too many information's could ocurre in an avalanche I se

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Dave Angel
On 12/25/2012 09:41 AM, prilisa...@googlemail.com wrote: > Hello Steven, > > to "learn python" I've bought a book, and it's not a "thin" one :-) it's more > a 788p. long documentation about python. > > BUT! I have to say: The autor started using the "self." argument at the > chapter classes.

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread prilisauer
Hello Steven, to "learn python" I've bought a book, and it's not a "thin" one :-) it's more a 788p. long documentation about python. BUT! I have to say: The autor started using the "self." argument at the chapter classes. So You've shown me the book descr. non "correct" way. Better using t

Re: [Help] [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread Steven D'Aprano
On Mon, 24 Dec 2012 00:19:18 -0500, Dave Angel wrote: > Nobody's going to be able to understand your code if you persist in > using self in unpythonic ways. It's used as the first argument of a > class method. Period. To be pedantic, "self" is the conventional argument for *instance* methods, n

Re: [Newbie] Require help migrating from Perl to Python 2.7 (namespaces)

2012-12-25 Thread prilisauer
Hey :-P I think I should rename the threads name into a new "Doc" project, I'm sure It won't take much time to fill a book with our knowledge. Thanks to Rick, you have Posted exactly what I wanted to ask. I know the that __variable = 'xyz' _variable = 'xyz' are used to make them private, but I