Re: dict_to_xml

2011-12-31 Thread Vojtěch Rylko
Hello, there is one simple example which I made for my needs - https://github.com/vojtarylko/dict2xml Regards, Vojtěch Dne 31.12.2011 6:48, Emeka napsal(a): Hello All, I have a dictionary object I would like to convert to xml. Could some assist with the link to libs to use? Or good exa

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Niklas Rosencrantz
Thank you for the reply. I had the same error message before and it was resolved when I removed a casting of a header value from unicode to str. Now in this case I can't see where that happens or what causes the error. The full trace I'm experiencing now is File "/media/Lexar/montao/google/ap

Re: How to get function string name from i-th stack position?

2011-12-31 Thread dmitrey
On Dec 30, 11:48 pm, Ian Kelly wrote: > On Fri, Dec 30, 2011 at 11:43 AM, dmitrey wrote: > > Thank you. And what should I do to get function by itself instead of > > its string name, e.g. I want to know does this function is my_func or > > any other? For example, I would like to check is this fun

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Niklas Rosencrantz
I can log the headers and it seems that they are strings: INFO 2011-12-31 08:43:03,286 paypal.py:143] headers: {'X-PAYPAL-REQUEST-DATA-FORMAT': 'JSON', 'X-PAYPAL-SECURITY-PASSWORD': '1324348659', 'X-PAYPAL-RESPONSE-DATA-FORMAT': 'JSON', 'X-PAYPAL-SECURITY-SIGNATURE': 'Al6H7Bq3kp4bKFht2fR-p

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Serhiy Storchaka
31.12.11 08:40, Steven D'Aprano написав(ла): 'JSON' is already a string. Calling str() on it is a waste of time. from __future__ import unicode_literals -- http://mail.python.org/mailman/listinfo/python-list

Re: Which library for audio playback ?

2011-12-31 Thread Jérôme
Fri, 30 Dec 2011 17:17:51 -0800 K Richard Pixley a écrit: > I made a similar survey of available libraries recently. I'm interested > in MIDI also, though, primarily on mac. > > There doesn't seem to be any definitive audio library for linux, > although several, (jack, oss, alsa), exist. (My

Re: How to get function string name from i-th stack position?

2011-12-31 Thread Lie Ryan
On 12/31/2011 08:48 AM, Ian Kelly wrote: But they are two distinct function objects, and there is no way programmatically to determine that they are the same function except by comparing the bytecode (which won't work generally because of the halting problem). Actually, it is often possible to

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Steven D'Aprano
On Sat, 31 Dec 2011 12:04:13 +0200, Serhiy Storchaka wrote: > 31.12.11 08:40, Steven D'Aprano написав(ла): >> 'JSON' is already a string. Calling str() on it is a waste of time. > > from __future__ import unicode_literals Fair point. Your correction is noted. -- Steven -- http://mail.python.

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Niklas Rosencrantz
I'm still no further to reaching a solution and my efforts of logging the headers didn't produce anything. I'm certain that it's upgrading from ptyhon 2.5 to python 2.7 that causes this since the GAE SDK uses WSGI instead of CGI now. Any idea about my problem? Thank you -- http://mail.python.o

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Steven D'Aprano
On Sat, 31 Dec 2011 05:31:14 -0800, Niklas Rosencrantz wrote: > I'm still no further to reaching a solution and my efforts of logging > the headers didn't produce anything. I'm certain that it's upgrading > from ptyhon 2.5 to python 2.7 that causes this since the GAE SDK uses > WSGI instead of CGI

funny minny year@@@@@@@@@@@@@@@@@@@@

2011-12-31 Thread n v
http://123maza.com/48/silver424/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python education survey

2011-12-31 Thread Grant Edwards
On 2011-12-28, Steven D'Aprano wrote: > On Tue, 27 Dec 2011 18:42:05 -0800, Rick Johnson wrote: > >> I don't care what ANY dictionary says. Much less a "world" >> dictionary. I don't validate or invalidate a word based on some phony >> baloney group of pseudo intellectuals who decided one to day t

Re: How to get function string name from i-th stack position?

2011-12-31 Thread Ian Kelly
On Sat, Dec 31, 2011 at 4:41 AM, Lie Ryan wrote: > On 12/31/2011 08:48 AM, Ian Kelly wrote: >> >> >> But they are two distinct function objects, and there is no way >> programmatically to determine that they are the same function except >> by comparing the bytecode (which won't work generally beca

Re: How to get function string name from i-th stack position?

2011-12-31 Thread Ian Kelly
On Sat, Dec 31, 2011 at 1:44 AM, dmitrey wrote: > On Dec 30, 11:48 pm, Ian Kelly wrote: >> On Fri, Dec 30, 2011 at 11:43 AM, dmitrey wrote: >> > Thank you. And what should I do to get function by itself instead of >> > its string name, e.g. I want to know does this function is my_func or >> > an

Re: Python education survey

2011-12-31 Thread Roy Smith
In article , Grant Edwards wrote: > On 2011-12-28, Steven D'Aprano wrote: > > On Tue, 27 Dec 2011 18:42:05 -0800, Rick Johnson wrote: > > > >> I don't care what ANY dictionary says. Much less a "world" > >> dictionary. I don't validate or invalidate a word based on some phony > >> baloney group

Re: .format vs. %

2011-12-31 Thread Andrew Berg
On 12/31/2011 12:19 PM, davidfx wrote: > Should we always be using .format() for formatting strings or %? In new code, yes. %-style formatting will eventually go away, but probably not for a long time. > If I wanted to put .format into a variable, how would I do that. What do you mean? -- CPytho

Re: .format vs. %

2011-12-31 Thread Yaşar Arabacı
What exactly do you mean by putting .format into a variable? You mean like this: "{name} is very {adj} {gender}".format(name="sandy",adj="diligent",gender="female") Sat, 31 Dec 2011 20:19:34 +0200 tarihinde davidfx şöyle yazmış: Hello everyone, I just have a quick question about .form

Re: .format vs. %

2011-12-31 Thread davidfx
Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this concept? -- http://mail.python.org/mailman/listinfo/python-list

Re: .format vs. %

2011-12-31 Thread Yaşar Arabacı
You mean like this? === a = "I like {name}" a.format(name="myself") 'I like myself' Sat, 31 Dec 2011 20:44:08 +0200 tarihinde davidfx şöyle yazmış: Thanks for your response. I know the following code is not going to be correct but I w

Re: .format vs. %

2011-12-31 Thread Evan Driscoll
How 'bout just: >>> s = "{0} {1} {2} {3}" >>> s.format(1, 2, 3, 4) '1 2 3 4' Evan On 12/31/2011 13:44, davidfx wrote: > Thanks for your response. I know the following code is not going to be > correct but I want to show you what I was thinking. > > formatter = "%r %r %r %r" > > print formatte

Re: .format vs. %

2011-12-31 Thread Benjamin Kaplan
On Dec 31, 2011 1:46 PM, "davidfx" wrote: > > Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. > > formatter = "%r %r %r %r" > > print formatter % (1, 2, 3, 4) > > What is the .format version of this concept? > format is a

Re: Python education survey

2011-12-31 Thread Alexander Kapps
On 31.12.2011 19:23, Roy Smith wrote: Why do I waste my time reading your pretentious self-important nonsense? http://xkcd.com/386/ ;) Why ROFLMAO when double-plus funny works just as well? xkcd/386 has been the excuse for replying to RR for ages and I still don't understand why he gets

Python powering giant screen in Times Square

2011-12-31 Thread Jason Ford
Verizon has a giant HD screen in Times Square today showing a live feed of social media activity – and it's built entirely in Python. Our app, FeedMagnet, aggregates and curates social content and is powering the screen. It has a Django front-end and pure Python backend to talk to Facebook, Twitte

Re: .format vs. %

2011-12-31 Thread Alexander Kapps
On 31.12.2011 19:44, davidfx wrote: Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this concept? formatter = "{0} {1} {2} {3}

Re: .format vs. %

2011-12-31 Thread Tim Chase
On 12/31/11 12:57, Benjamin Kaplan wrote: format is a method of the string class. You store the string the same way you would any other. formatter = "Hello, {}" print(formatter.format("world")) Just to note that this syntax doesn't quite work in some earlier versions (tested below in 2.6, whi

python curses wrapper

2011-12-31 Thread Mag Gam
Hello, I have been struggling reseting the terminal when I try to do KeyboardInterrupt exception therefore I read the documentation for curses.wrapper and it seems to take care of it for me, http://docs.python.org/library/curses.html#curses.wrapper. Can someone please provide a Hello World exampl

Re: python curses wrapper

2011-12-31 Thread Alexander Kapps
On 31.12.2011 20:24, Mag Gam wrote: Hello, I have been struggling reseting the terminal when I try to do KeyboardInterrupt exception therefore I read the documentation for curses.wrapper and it seems to take care of it for me, http://docs.python.org/library/curses.html#curses.wrapper. Can someo

Re: .format vs. %

2011-12-31 Thread Lie Ryan
On 01/01/2012 05:44 AM, davidfx wrote: Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this concept? I don't think the (%r)epr

Re: .format vs. %

2011-12-31 Thread Robert Kern
On 12/31/11 7:34 PM, Lie Ryan wrote: On 01/01/2012 05:44 AM, davidfx wrote: Thanks for your response. I know the following code is not going to be correct but I want to show you what I was thinking. formatter = "%r %r %r %r" print formatter % (1, 2, 3, 4) What is the .format version of this c

Re: python curses wrapper

2011-12-31 Thread Alexander Kapps
On 31.12.2011 20:34, Alexander Kapps wrote: On 31.12.2011 20:24, Mag Gam wrote: Hello, I have been struggling reseting the terminal when I try to do KeyboardInterrupt exception therefore I read the documentation for curses.wrapper and it seems to take care of it for me, http://docs.python.org/l

Re: python curses wrapper

2011-12-31 Thread Mag Gam
thanks for your prompt reply. Why would I have to use atexeit? According to the documentation, curses.wrapper should handle what cleanup() should be doing. Neverthless, good to know it exists :p On Sat, Dec 31, 2011 at 2:34 PM, Alexander Kapps wrote: > On 31.12.2011 20:24, Mag Gam wrote: >> >>

Best Way To Bound Function Execution Time

2011-12-31 Thread Tim Daneliuk
I am writing some paramiko-based ssh routines. One of them logs into a remote server and then does a sudo command. The problem is that if the user provides the incorrect sudo password, the call hangs the other end is waiting for the correct password to be entered. Is there some standard Pythoni

Re: Python powering giant screen in Times Square

2011-12-31 Thread Eric Snow
On Sat, Dec 31, 2011 at 12:05 PM, Jason Ford wrote: > Verizon has a giant HD screen in Times Square today showing a live > feed of social media activity – and it's built entirely in Python. > > Our app, FeedMagnet, aggregates and curates social content and is > powering the screen. It has a Django

Re: mutually exclusive arguments to a constructor

2011-12-31 Thread Adam Funk
On 2011-12-30, Roy Smith wrote: > "But!", some C++/Java type bondage addicts might cry, "there's nothing > to prevent somebody from creating a DirectionIndicatingThingie directly, > bypassing the factory functions. There's no way to make the constructor > private!". To which the free-willed p

Re: mutually exclusive arguments to a constructor

2011-12-31 Thread Adam Funk
On 2011-12-30, Günther Dietrich wrote: > Adam Funk wrote: > >>Suppose I'm creating a class that represents a bearing or azimuth, >>created either from a string of traditional bearing notation >>("N24d30mE") or from a number indicating the angle in degrees as >>usually measured in trigonometry (65

Re: .format vs. %

2011-12-31 Thread Terry Reedy
On 12/31/2011 2:24 PM, Tim Chase wrote: On 12/31/11 12:57, Benjamin Kaplan wrote: format is a method of the string class. You store the string the same way you would any other. formatter = "Hello, {}" print(formatter.format("world")) Just to note that this syntax doesn't quite work in some ea

Re: Python powering giant screen in Times Square

2011-12-31 Thread Terry Reedy
On 12/31/2011 2:05 PM, Jason Ford wrote: Verizon has a giant HD screen in Times Square today showing a live feed of social media activity – and it's built entirely in Python. Our app, FeedMagnet, aggregates and curates social content and is powering the screen. It has a Django front-end and pure

[Windows 7, Python 2.6] Can't write to a directory made w/ os.makedirs

2011-12-31 Thread OlyDLG
Hi! I'm working on a script utilizing os.makedirs to make directories to which I'm then trying to write files created by exe's spawned w/ subprocess.call; I'm developing in Stani's Python Editor, debugging using Winpdb. I've gotten to the point where subprocess.Popen._execute_child is raising a W

Re: PySide / PyQt autocompletion in IDEs

2011-12-31 Thread Fabio Zadrozny
On Thu, Dec 29, 2011 at 6:22 PM, Merwin wrote: > Hi, > > I would like to work with PyQt / PySide, but there is a small problem : > methods arguments are not completed by IDE's autocompletion. > > When, typing "PySide.", I correctly get the module's attributes, but when I > want to see what argumen

Re: Best Way To Bound Function Execution Time

2011-12-31 Thread Paul Rubin
Tim Daneliuk writes: > Is there some standard Pythonic way to bound how long a function > call can run, after which time it is forcefully terminated? Basically, run it in a separate process and use os.kill to kill it. -- http://mail.python.org/mailman/listinfo/python-list

Re: InvalidResponseError: headers must be str

2011-12-31 Thread Niklas Rosencrantz
Thanks for the replies here. I will have patience but this bug is blocking my integration efforts. I tried logging the TCP packets with tcpdump and nothing special appeared. Niklas -- http://mail.python.org/mailman/listinfo/python-list

Re: Python education survey

2011-12-31 Thread Grant Edwards
On 2011-12-31, Alexander Kapps wrote: > On 31.12.2011 19:23, Roy Smith wrote: > Why do I waste my time reading your pretentious self-important nonsense? >>> >>> http://xkcd.com/386/ >>> >>> ;) >> >> Why ROFLMAO when double-plus funny works just as well? > > xkcd/386 has been the excuse for re

Re: Python education survey

2011-12-31 Thread Alexander Kapps
On 01.01.2012 03:36, Grant Edwards wrote: On 2011-12-31, Alexander Kapps wrote: On 31.12.2011 19:23, Roy Smith wrote: Why do I waste my time reading your pretentious self-important nonsense? http://xkcd.com/386/ ;) Why ROFLMAO when double-plus funny works just as well? xkcd/386 has bee

Re: Python education survey

2011-12-31 Thread Dominic Binks
On 12/27/2011 6:42 PM, Rick Johnson wrote: On Dec 27, 8:21 pm, Tim Chase wrote: I'm glad you're open to learning more about English as "used to" is perfectly acceptable according to the World English Dictionary[1] [...] May you be found better for learning and come to give others the benefit o

Re: Python education survey

2011-12-31 Thread Andrew Berg
On 12/31/2011 1:06 PM, Alexander Kapps wrote: > xkcd/386 has been the excuse for replying to RR for ages and I still > don't understand why he gets that much advertence. Charity? Sympathy > for the lone and broken? > > FWIW, it undermines all my attempts to block him. Sigh. Do what I do: laugh a

Re: Python education survey

2011-12-31 Thread Chris Angelico
On Sun, Jan 1, 2012 at 4:12 PM, Dominic Binks wrote: > While I agree 'right' can be annoying it's usage as in 'you are correct' can > be traced back to 1588, I think we're going to have to allow for it's usage > in 2011 (very nearly 2012 for me and definitely 2012 for anyone east of New > York Cit