Re: How to add the current dir to sys.path when calling a python file?

2013-03-17 Thread Steven D'Aprano
On Sun, 17 Mar 2013 22:56:07 -0500, Peng Yu wrote: > Hi, > > man python says "If a script argument is given, the directory > containing the script is inserted in the path in front of $PYTHONPATH. > The search path can be manipulated from within a Python program as the > variable sys.path." I

decode php base64

2013-03-17 Thread Peter juliano
Not long ago, my friend resignation of the company. He left a few app's in php, some of those files are hashed with base64 code, he told me that those files handle http request on the server and some security rules. Because i'm migrating all these applications on django. I do not really care about

Re: Message passing syntax for objects

2013-03-17 Thread Mark Janssen
On Sun, Mar 17, 2013 at 9:26 PM, Mark Janssen wrote: > Continuing on this thread, there would be a new bunch of behaviors to > be defined. Since "everything is an object", there can now be a > standard way to define the *next* common abstraction of "every object > interacts with other objects".

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Terry Reedy
On 3/17/2013 8:58 PM, Yves S. Garret wrote: N00b question. But here is the code: http://bin.cakephp.org/view/709201806 Short code like this should be included in your message. tricky = sorted([w for w in set(text2) if 'cie' in w or 'cei' in w]) for word in tricky: print word, for word in

Re: Message passing syntax for objects

2013-03-17 Thread Mark Janssen
Continuing on this thread, there would be a new bunch of behaviors to be defined. Since "everything is an object", there can now be a standard way to define the *next* common abstraction of "every object interacts with other objects". And going with my suggestion of defining >> and << operators,

Re: pynguin-0.13 python turtle graphics application now uses python 3

2013-03-17 Thread rusi
On Mar 18, 3:28 am, Lee Harr wrote: > If you are a fan of turtle.py please give pynguin a try and let me > know what you think! Not a 'fan' per se -- just a teacher who has occasionally tried turtle to introduce programming. (which was not completely smooth; Ive forgotten all the hiccups) http:

Re: pprint defaultdict one record per line

2013-03-17 Thread Terry Reedy
On 3/17/2013 1:45 PM, Peng Yu wrote: pprint can not print defaultdict one record per line Known issue, no progress for 2+ years. Patch not updated for default branch (3.4). Not clear what best way forward is. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

How to add the current dir to sys.path when calling a python file?

2013-03-17 Thread Peng Yu
Hi, man python says "If a script argument is given, the directory containing the script is inserted in the path in front of $PYTHONPATH. The search path can be manipulated from within a Python program as the variable sys.path." Instead I want to have the current directory inserted to the fron

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Roy Smith
In article <51467f6f$0$6599$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > there are at least three ways to > post to this group: > > 1) Email to python-list@python.org > > 2) Post to the news group comp.lang.python on Usenet > > 3) Email to comp.lang.pyt...@googlegroups.com

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Steven D'Aprano
On Sun, 17 Mar 2013 19:14:49 -0700, Yves S. Garret wrote: > I don't get why it's posting what I said twice... Because you are emailing to the list, and CCing the list. In your email, you have: To: comp.lang.pyt...@googlegroups.com Cc: python-list@python.org Unfortunately, they are the same th

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Roy Smith
In article , "Yves S. Garret" wrote: > I don't get why it's posting what I said twice... Because you're posting using the Google Groups web interface, right? Google Groups is just plain busted and double-posts everything (at least to this group). Not your fault, but something to be aware of

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Roy Smith
In article <7f3b4dde-fbd7-44ca-96bc-31a6b2894...@googlegroups.com>, "Yves S. Garret" wrote: > I'm trying to better understand what's going on behind the scenes and I > appreciate your thorough input. What I don't understand is, how would you > avoid creating L1? Leave out the square brackets i

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
I don't get why it's posting what I said twice... -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
On Sunday, March 17, 2013 9:28:56 PM UTC-4, Roy Smith wrote: > In article <485a3093...@googlegroups.com>, > > "Yves S. Garret" wrote: > > > > > N00b question. But here is the code: > > > > > > http://bin.cakephp.org/view/709201806 > > > > > > In the first example, the first for-loop is

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
On Sunday, March 17, 2013 9:18:12 PM UTC-4, Gary Herron wrote: > On 03/17/2013 05:58 PM, Yves S. Garret wrote: > > > N00b question. But here is the code: > > > > > > http://bin.cakephp.org/view/709201806 > > > > > > In the first example, the first for-loop is run and then the list is > > ass

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Roy Smith
In article <485a3093-8c07-4d1a-b49e-af32f84f8...@googlegroups.com>, "Yves S. Garret" wrote: > N00b question. But here is the code: > > http://bin.cakephp.org/view/709201806 > > In the first example, the first for-loop is run and then the list is assigned > to the tricky variable. But, what

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Gary Herron
On 03/17/2013 05:58 PM, Yves S. Garret wrote: N00b question. But here is the code: http://bin.cakephp.org/view/709201806 In the first example, the first for-loop is run and then the list is assigned to the tricky variable. But, what happens in the second example? Does the loop after "in" ge

Re: [Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Andrew Berg
On 2013.03.17 19:58, Yves S. Garret wrote: > N00b question. But here is the code: > > http://bin.cakephp.org/view/709201806 > > In the first example, the first for-loop is run and then the list is assigned > to the tricky variable. But, what > happens in the second example? Does the loop aft

[Python 2.7.3] What's the difference between these two uses of "for"?

2013-03-17 Thread Yves S. Garret
N00b question. But here is the code: http://bin.cakephp.org/view/709201806 In the first example, the first for-loop is run and then the list is assigned to the tricky variable. But, what happens in the second example? Does the loop after "in" get run only once or multiple number of times? -

Re: Top 10 python features

2013-03-17 Thread Terry Reedy
On 3/17/2013 10:00 AM, Miki Tebeka wrote: I would like to know what are the top 10 most important features (on your opinion) in python. You're in luck :) Raymond Hettinger just gave "Python is Awesome" keynote at PyCon. You can view the slides at https://speakerdeck.com/pyconslides/pycon-keynote

Escaping a Python sandbox

2013-03-17 Thread Steven D'Aprano
An example of how to hack your way out of a Python sandbox: [quote] Now that we can build any function we want, what can we do? We can’t directly access the non restricted builtins: the functions we craft are still executed in the restricted environment. We can get a non sandboxed function to c

Re: pynguin-0.13 python turtle graphics application now uses python 3

2013-03-17 Thread Lee Harr
>> Pynguin is a python-based turtle graphics application. >>     It combines an editor, interactive interpreter, and >>     graphics display area. > > > What does pynguin have that the builtin python turtle does not? It is meant to be easier to get started with. You start the application and it

Re: How to make a Python script to audio read a text file on phone ?

2013-03-17 Thread dey . sumit . kr
On Sunday, March 17, 2013 7:34:18 PM UTC+5:30, Nic wrote: > I've installed Python on my Nokia E71 (Symbian S60 3rd FP1) and found a > script example which can read out text, see example below. > > I want to make the script to asks me for a text file instead and then reads > out the content. I g

Re: PyWart: NameError trackbacks are superfluous

2013-03-17 Thread Jason Swails
On Sat, Mar 16, 2013 at 2:27 PM, Rick Johnson wrote: > > [snip junk] > We don't need multiple layers of traces for NameErrors. Python does not > have *real* global variables; and thank Guido for that! All we need to know > is which module the error occurred in AND which line of that module > conta

Re: tuple of ids of integers or lists

2013-03-17 Thread Chris Angelico
On Mon, Mar 18, 2013 at 7:23 AM, wrote: > OK. Now I understand it. > > I was confused because when two list are created in two different lines, > Python gives them different ids, but when the two lists are created in the > same line (in a tuple) Python gives them the same id. It doesn't really

Re: tuple of ids of integers or lists

2013-03-17 Thread bartolome . sintes
OK. Now I understand it. I was confused because when two list are created in two different lines, Python gives them different ids, but when the two lists are created in the same line (in a tuple) Python gives them the same id. It doesn't really matter as these lists are just created and destro

Re: Help me with Event handlers please

2013-03-17 Thread mar...@python.net
On Sun, Mar 17, 2013, at 03:30 PM, Dreamer wrote: > Hi can anybody share some expertise on event handlers...i need to use em > to update user activity in my web appthanks in advance > Cheers You're proably going to need to be more specific about what help you need. Just a generic "give me a

Re: tuple of ids of integers or lists

2013-03-17 Thread Roy Smith
In article <8e66719c-5e90-4776-bba9-a11c29fba...@googlegroups.com>, bartolome.sin...@gmail.com wrote: > In Python 3.3 for Windows, every list gets a different id when it is created: > > >>> id([3]) > 46555784 > >>> id([3]) > 47920192 > >>> id([4]) > 46532048 > > But if I write a tuple asking fo

tuple of ids of integers or lists

2013-03-17 Thread bartolome . sintes
In Python 3.3 for Windows, every list gets a different id when it is created: >>> id([3]) 46555784 >>> id([3]) 47920192 >>> id([4]) 46532048 But if I write a tuple asking for the ids of two lists, each list seems to get the same id: >>> id([3]), id([4]) (43079000, 43079000) I was expecting a t

Help me with Event handlers please

2013-03-17 Thread Dreamer
Hi can anybody share some expertise on event handlers...i need to use em to update user activity in my web appthanks in advance Cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: pprint defaultdict one record per line

2013-03-17 Thread Mark Lawrence
On 17/03/2013 17:45, Peng Yu wrote: Hi, pprint can not print defaultdict one record per line. Is there some other convenient way in python to print one record per line? ~/linux/test/python/man/library/pprint/function/pprint$ ./main.py {'two': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14],

RE: Top 10 python features

2013-03-17 Thread Joseph Clark
I'm a Python newbie and already found a few things that I love about the language. Among them: - list/set comprehensions - dictionaries and sets - pickle/shelve // joseph w. clark , phd , visiting research associate \\ university of nebraska at omaha - college of IS&T ---

pprint defaultdict one record per line

2013-03-17 Thread Peng Yu
Hi, pprint can not print defaultdict one record per line. Is there some other convenient way in python to print one record per line? ~/linux/test/python/man/library/pprint/function/pprint$ ./main.py {'two': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 'one': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}

Re: Error about " module object has no attribute 'QStringList' "

2013-03-17 Thread ofenerci
Thank you Vincent and to All, It has worked like a charm. -- http://mail.python.org/mailman/listinfo/python-list

Re: Error about " module object has no attribute 'QStringList' "

2013-03-17 Thread Vincent Vande Vyvre
Le 17/03/13 17:53, Vincent Vande Vyvre a écrit : > Le 17/03/13 17:15, ofene...@hotmail.com a écrit : >> Dear List, >> >> I have been working on restructured text(rest) documents and found a nice >> application which makes viewing the rest documents easy. It is a web >> browser especially suited

Re: Error about " module object has no attribute 'QStringList' "

2013-03-17 Thread Vincent Vande Vyvre
Le 17/03/13 17:15, ofene...@hotmail.com a écrit : > sip.setapi("QString", 2) Remove the line: sip.setapi("QString", 2) and try it. -- Vincent V.V. Oqapy . Qarte . PaQager -- http://mail.python.org/mai

Re: Error about " module object has no attribute 'QStringList' "

2013-03-17 Thread Vincent Vande Vyvre
Le 17/03/13 17:15, ofene...@hotmail.com a écrit : > Dear List, > > I have been working on restructured text(rest) documents and found a nice > application which makes viewing the rest documents easy. It is a web browser > especially suited for Sphinx documents. > > . Forget the reference:

Error about " module object has no attribute 'QStringList' "

2013-03-17 Thread ofenerci
Dear List, I have been working on restructured text(rest) documents and found a nice application which makes viewing the rest documents easy. It is a web browser especially suited for Sphinx documents. When I run the code, I get error which says that : ->-

Re: What's the easiest Python datagrid GUI (preferably with easy database hooks as well)?

2013-03-17 Thread rusi
On Mar 17, 4:06 pm, Sibylle Koczian wrote: > Am 16.03.2013 21:30, schrieb Wolfgang Keller:>> Will look at Pypapi and > SQLkit. > > Did look: SQLkit needs Python 2. Pypapi, from the link you gave: "The > new release of PyPaPi is written in Java. You can find more info in the > official site." On t

Re: Top 10 python features

2013-03-17 Thread Chris Angelico
On Mon, Mar 18, 2013 at 1:09 AM, Peter Otten <__pete...@web.de> wrote: > Albert Vonpupp wrote: > >> I would like to know what are the top 10 most important features (on your >> opinion) in python. > > Amongst our weapons are > > - Generators > - Duck-Typing > - The Interactive Interpreter > > and a

How to make a Python script to audio read a text file on phone ?

2013-03-17 Thread Nic
I've installed Python on my Nokia E71 (Symbian S60 3rd FP1) and found a script example which can read out text, see example below. I want to make the script to asks me for a text file instead and then reads out the content. I guess it works with a .txt file, dont know if other formats work. Re

Re: Top 10 python features

2013-03-17 Thread Peter Otten
Albert Vonpupp wrote: > Hello pythonistas, > > I'm new to python and so far I'm really enjoying learning it. > > I would like to know what are the top 10 most important features (on your > opinion) in python. > > I have to prepare a presentation on that and this is a very good chance to > learn

Re: Top 10 python features

2013-03-17 Thread Miki Tebeka
> I would like to know what are the top 10 most important features (on your > opinion) in python. You're in luck :) Raymond Hettinger just gave "Python is Awesome" keynote at PyCon. You can view the slides at https://speakerdeck.com/pyconslides/pycon-keynote-python-is-awesome, video will follow

Top 10 python features

2013-03-17 Thread Albert Vonpupp
Hello pythonistas, I'm new to python and so far I'm really enjoying learning it. I would like to know what are the top 10 most important features (on your opinion) in python. I have to prepare a presentation on that and this is a very good chance to learn something new to me as well. Thanks a

Re: What's the easiest Python datagrid GUI (preferably with easy database hooks as well)?

2013-03-17 Thread Sibylle Koczian
Am 16.03.2013 21:30, schrieb Wolfgang Keller: Will look at Pypapi and SQLkit. Did look: SQLkit needs Python 2. Pypapi, from the link you gave: "The new release of PyPaPi is written in Java. You can find more info in the official site." On this official site - http://www.pypapi.org/ - I can't

Re: pynguin-0.13 python turtle graphics application now uses python 3

2013-03-17 Thread rusi
On Mar 17, 5:12 am, Lee Harr wrote: > Pynguin is a python-based turtle graphics application. >     It combines an editor, interactive interpreter, and >     graphics display area. What does pynguin have that the builting python turtle does not? http://docs.python.org/2/library/turtle.html -- ht