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

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

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 ian.g.ke...@gmail.com wrote: On Fri, Dec 30, 2011 at 11:43 AM, dmitrey dmitre...@gmail.com 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,

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':

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

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 --

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 --

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 steve+comp.lang.pyt...@pearwood.info 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

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 lie.1...@gmail.com 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

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 dmitre...@gmail.com wrote: On Dec 30, 11:48 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Dec 30, 2011 at 11:43 AM, dmitrey dmitre...@gmail.com wrote: Thank you. And what should I do to get function by itself instead of its string name, e.g. I

Re: Python education survey

2011-12-31 Thread Roy Smith
In article jdnd4v$6mg$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: On 2011-12-28, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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? -- CPython

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 dgeorge2...@gmail.com şöyle yazmış: Hello everyone, I just have a quick

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 dgeorge2...@gmail.com şöyle yazmış: Thanks for your response. I know the following code is not going to be

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 formatter % (1, 2, 3,

Re: .format vs. %

2011-12-31 Thread Benjamin Kaplan
On Dec 31, 2011 1:46 PM, davidfx dgeorge2...@gmail.com 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?

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,

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, which

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

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

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

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

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,

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 alex.ka...@web.de wrote: On 31.12.2011 20:24, Mag

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

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 ja...@feedmagnet.com 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.

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

Re: mutually exclusive arguments to a constructor

2011-12-31 Thread Adam Funk
On 2011-12-30, Günther Dietrich wrote: Adam Funk a24...@ducksburg.com 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

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

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

[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

Re: PySide / PyQt autocompletion in IDEs

2011-12-31 Thread Fabio Zadrozny
On Thu, Dec 29, 2011 at 6:22 PM, Merwin merwin@gmail.com 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

Re: Best Way To Bound Function Execution Time

2011-12-31 Thread Paul Rubin
Tim Daneliuk tun...@tundraware.com 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 alex.ka...@web.de 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 replying

Re: Python education survey

2011-12-31 Thread Alexander Kapps
On 01.01.2012 03:36, Grant Edwards wrote: On 2011-12-31, Alexander Kappsalex.ka...@web.de 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?

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 Chasepython.l...@tim.thechases.com 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

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 at

Re: Python education survey

2011-12-31 Thread Chris Angelico
On Sun, Jan 1, 2012 at 4:12 PM, Dominic Binks dbi...@codeaurora.org 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

[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev
New submission from Sergey Dorofeev fido...@users.sourceforge.net: Python 3.2.2 (default, Nov 16 2011, 10:58:44) [C] on sunos5 Type help, copyright, credits or license for more information. import ast ast.literal_eval('10') 10 ast.literal_eval('0x10') 16 ast.literal_eval('010') Traceback

[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Sergey Dorofeev
Sergey Dorofeev fido...@users.sourceforge.net added the comment: python 3 feature - should use 0o10 need to rebuild data file :( -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue13677] correct docstring for builtin compile

2011-12-31 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13677 ___ ___ Python-bugs-list

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +eric.araujo versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13663 ___

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: Agreed with Martin. I would be nice to get a statement on the status of pootle.python.org (social aspects like updating and publishing the translations + organization of teams), but Georg seems busy. (This would probably be more at home on a

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: I've never really had a hand in pootle.python.org; it was set up by Martin and Robert Lehmann, and Sandro Tosi also wanted to lend a hand... -- nosy: +lehmannro, sandro.tosi ___ Python tracker

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Sandro Tosi
Sandro Tosi sandro.t...@gmail.com added the comment: Yeah, I really would like to help with pootle, but it seems we don't have a current status of the thing + a roadmap to where we want to go. From the top of my head, I think we need at least: - the current setup of the machine/service -

[issue13609] Add os.get_terminal_size() function

2011-12-31 Thread Zbyszek Szmek
Zbyszek Szmek zbys...@in.waw.pl added the comment: Thanks for the review! New version is attached. The code is actually slightly shorter, but there are more docs. Doc/library/os.rst| 52 +++ Doc/whatsnew/3.3.rst |5 + Lib/os.py | 43

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: naoki: what is your actual complaint about the installation being outdated? Are you referring to the message catalog (documentation version), or the software? As for the message catalog, I don't think it should be updated too often (only

[issue13688] ast.literal_eval fails on octal numbers

2011-12-31 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- resolution: rejected - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13688 ___ ___

[issue13689] fix CGI Web Applications with Python link in howto/urllib2

2011-12-31 Thread Sandro Tosi
New submission from Sandro Tosi sandro.t...@gmail.com: Hi, as discussed on irc, howto/urllib2 refers to CGI Web Applications with Python, Part One on http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html which is no more accessible. Given part two of that document is on

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: On Sat, Dec 31, 2011 at 11:31 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: naoki: what is your actual complaint about the installation being outdated? Are you referring to the

[issue13690] Add DEBUG flag to documentation of re.compile

2011-12-31 Thread Filip Gruszczyński
New submission from Filip Gruszczyński grusz...@gmail.com: This is a useful flag and it would be good, if it was in documentation. -- messages: 150423 nosy: gruszczy priority: normal severity: normal status: open title: Add DEBUG flag to documentation of re.compile

[issue13690] Add DEBUG flag to documentation of re.compile

2011-12-31 Thread Filip Gruszczyński
Changes by Filip Gruszczyński grusz...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file24118/13690.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13690 ___

[issue13676] sqlite3: Zero byte truncates string contents

2011-12-31 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13676 ___ ___ Python-bugs-list mailing list

[issue13659] Add a help() viewer for IDLE's Shell.

2011-12-31 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: I would like that to be a help() option, such as help(module, -b) or more verbosely, help(module, browser=True). This would be useful for the regular interactive interpreter as well. -- ___ Python

[issue13641] decoding functions in the base64 module could accept unicode strings

2011-12-31 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- keywords: +patch nosy: +berkerpeksag Added file: http://bugs.python.org/file24119/issue13641_v1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13641

[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers
Jonathan Rogers jonathanrrog...@gmail.com added the comment: I don't think reindent.py should change any bytes inside string literals since it can't know anything about what those strings mean or how they'll be used by the program at run time. Unfortunately, it starts out by unconditionally

[issue12930] reindent.py inserts spaces in multiline literals

2011-12-31 Thread Jonathan Rogers
Jonathan Rogers jonathanrrog...@gmail.com added the comment: Rather than expanding tab characters inside string literals, it's safer to replace them with '\t'. -- Added file: http://bugs.python.org/file24120/save_strings.patch ___ Python tracker