Re: Lock Windows Screen GUI using python

2014-06-02 Thread Jaydeep Patil
On Tuesday, 3 June 2014 10:39:31 UTC+5:30, Ian wrote: > On Mon, Jun 2, 2014 at 10:28 PM, Jaydeep Patil > wrote: > > > Dear all, > > > Can we Lock Windows Screen GUI till program runs & unlock screen GUI when > > program finishes? > > > > If you mean can you programmatically bring up the Wi

Re: Benefits of asyncio

2014-06-02 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> - Thread programming assumes each thread is waiting for precisely >> one external stimulus in any given state -- in practice, each >> state must be prepared to handle quite a few possible stimuli. > > Eh? Threads typically have their own e

Re: Python 3 is killing Python

2014-06-02 Thread Rustom Mody
On Tuesday, June 3, 2014 11:42:30 AM UTC+5:30, jmf wrote: > after thinking no Yes [Also called Oui] -- https://mail.python.org/mailman/listinfo/python-list

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Rustom Mody
On Tuesday, June 3, 2014 10:36:37 AM UTC+5:30, Deb Wyatt wrote: > That was just the first question. What does immutable really mean > if you can add items to a list? and concatenate strings? I don't > understand enough to even ask a comprehensible question, I guess. It is with some pleasure that

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Terry Reedy
On 6/3/2014 1:16 AM, Gregory Ewing wrote: Terry Reedy wrote: The issue Armin ran into is this. He write a library module that makes sure the streams are binary. Seems to me he made a mistake right there. A library should *not* be making global changes like that. It can obtain binary streams fr

Re: ImportError: No module named _gdb

2014-06-02 Thread dieter
Marcelo Sardelich writes: > Didier thanks for your prompt reply. > I installed a pre-built version of Python. > As you said, probably something is missing. > > I tried to google packages related to gdb, but ain't had no luck. The missing part is related to the gdb-Python integration. Look around

Re: Introdution

2014-06-02 Thread Chris
Hi, On 06/03/2014 12:01 AM, Hisham Mughal wrote: > plz tell me about books for python > i am beginner of this lang.. the most important commands are in A Byte of Python [1]. This eBook isn't sufficient for programming, but it's a nice introduction. I bought Learning Python from Mark Lutz. It's n

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Cameron Simpson
On 02Jun2014 21:06, Deb Wyatt wrote: Deb Wyatt writes: [no text] Deb, can you expand a bit – and write the question in the body of your message? It's not clear what you want explained. [...] that's strange that you see no text. The body of my email was as follows: """a_string = "This is a

Re: Obfuscated Python hack

2014-06-02 Thread Gregory Ewing
Tim Chase wrote: Stripping off the exec() call makes it pretty transparent that you're attempting (successfully on some platforms) to set the value of "4" to "5". But you have to do that in *another* Python session, because the first one is broken in interesing ways, e.g. >>> (lambda *fs: redu

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Deb Wyatt
> > Please adjust your mailer to send plain text only. It is all you need > anyway, > and renders more reliably for other people. > > Thank you, > Cameron Simpson I am so sorry, I did not realize it was a problem. Hopefully it will behave now. Deb in WA, USA ___

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Ben Finney
Deb Wyatt writes: > > -Original Message- > > From: b...@benfinney.id.au > > Deb, can you expand a bit – and write the question in the body of > > your message? It's not clear what you want explained. > that's strange that you see no text. A likely cause is that your message included no

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread prashanth B.G
Hi Deb, Immutability means that once "This is a string" is created in memory , the string cannot be changed. When we assign a_string with "A different string" this "A different string" is in a new memory location again (a new object) . "This is a string" and "A different string" are two

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Gregory Ewing
Terry Reedy wrote: The issue Armin ran into is this. He write a library module that makes sure the streams are binary. Seems to me he made a mistake right there. A library should *not* be making global changes like that. It can obtain binary streams from stdin and stdout for its own use, but it

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Gary Herron
On 06/02/2014 09:39 PM, Deb Wyatt wrote: a_string = "This is a string" a_string is pointing to the above string now I change the value of a_string a_string = "This string is different" I understand that now a_string is pointing to a different string than it was before, in a different location.

Re: Lock Windows Screen GUI using python

2014-06-02 Thread Ian Kelly
On Mon, Jun 2, 2014 at 10:28 PM, Jaydeep Patil wrote: > Dear all, > Can we Lock Windows Screen GUI till program runs & unlock screen GUI when > program finishes? If you mean can you programmatically bring up the Windows lock screen, then you can do this: import ctypes ctypes.windll.user32.LockW

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Deb Wyatt
> -Original Message- > From: b...@benfinney.id.au > Sent: Tue, 03 Jun 2014 14:54:01 +1000 > To: python-list@python.org > Subject: Re: can someone explain the concept of "strings (or whatever) > being immutable" > > Deb Wyatt writes: > >> [no text] > > Deb, can you expand a bit – and w

Re: Benefits of asyncio

2014-06-02 Thread Aseem Bansal
I haven't worked with asynchronous tasks or concurrent programming so far. Used VB2010 and have used some jQuery in a recent project but nothing low level. As per the explanation it seems that programming using asyncio would require identifying blocks of code which are not dependent on the IO. W

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Ben Finney
Deb Wyatt writes: > [no text] Deb, can you expand a bit – and write the question in the body of your message? It's not clear what you want explained. -- \ “I hope if dogs ever take over the world, and they chose a | `\king, they don't just go by size, because I bet there are so

Re: can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Ian Kelly
On Jun 2, 2014 10:41 PM, "Deb Wyatt" wrote: > > a_string = "This is a string" > a_string is pointing to the above string > > now I change the value of a_string > a_string = "This string is different" > I understand that now a_string is pointing to a different string than it was before, in a differ

can someone explain the concept of "strings (or whatever) being immutable"

2014-06-02 Thread Deb Wyatt
a_string = "This is a string"a_string is pointing to the above stringnow I change the value of a_stringa_string = "This string is different"I understand that now a_string is pointing to a different string than it was before, in a different location.my question is what happens to the original st

Lock Windows Screen GUI using python

2014-06-02 Thread Jaydeep Patil
Dear all, Can we Lock Windows Screen GUI till program runs & unlock screen GUI when program finishes? Regards Jaydeep Paril -- https://mail.python.org/mailman/listinfo/python-list

Re: Choosing good names for things is difficult (was: Strange Behavior)

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 12:06 PM, Rustom Mody wrote: > Add to that the restriction to limited character sets such as ASCII > – a restriction that has only historical relevance Wrong. The name has to fit inside the human's brain; if it's not ASCII, that's not a problem. ChrisA -- https://mail.pyt

RE: Introdution

2014-06-02 Thread Deb Wyatt
> -Original Message- > From: tagh...@gmail.com > Sent: Mon, 2 Jun 2014 15:01:17 -0700 (PDT) > To: python-list@python.org > Subject: Introdution > > HI! plz tell me about books for python > i am beginner of this lang.. > hello! I, too, am fairly new to Python. I have discovered a lot

Re: Choosing good names for things is difficult (was: Strange Behavior)

2014-06-02 Thread Rustom Mody
On Tuesday, June 3, 2014 6:27:25 AM UTC+5:30, Ben Finney wrote: > Steven D'Aprano writes: > > On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote: > > > I invoked the wrong bug.py :/ , works fine now (this happens to me > > > when im a bit tired sometimes...). > > Clarity in naming is an excellen

Re: Benefits of asyncio

2014-06-02 Thread Terry Reedy
To all the great responders. If anyone thinks the async intro is inadequate and has a paragraph to contribute, open a tracker issue. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Business model

2014-06-02 Thread ngangsia akumbo
> No need to apologise. It's an interesting question, and reading the > > answers given last time will be useful. After you have read those dozen > > or so answers, please come back with any further questions. Here's the > > link again: > > > > http://code.activestate.com/lists/python-lis

Re: Business model

2014-06-02 Thread ngangsia akumbo
> No need to apologise. It's an interesting question, and reading the > > answers given last time will be useful. After you have read those dozen > > or so answers, please come back with any further questions. Here's the > > link again: > > > > http://code.activestate.com/lists/python-lis

Choosing good names for things is difficult (was: Strange Behavior)

2014-06-02 Thread Ben Finney
Steven D'Aprano writes: > On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote: > > > I invoked the wrong bug.py :/ , works fine now (this happens to me > > when im a bit tired sometimes...). > > Clarity in naming is an excellent thing […] Programs should be named > by what they do […] or when tha

Re: Strange Behavior

2014-06-02 Thread Igor Korot
On Mon, Jun 2, 2014 at 5:30 PM, Chris Angelico wrote: > On Tue, Jun 3, 2014 at 10:22 AM, Steven D'Aprano > wrote: >> On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote: >> >>> I invoked the wrong bug.py :/ , works fine now (this happens to me when >>> im a bit tired sometimes...). >> >> Clarity

Re: Strange Behavior

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 10:22 AM, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote: > >> I invoked the wrong bug.py :/ , works fine now (this happens to me when >> im a bit tired sometimes...). > > Clarity in naming is an excellent thing. If you have two files called > "

Re: Strange Behavior

2014-06-02 Thread Steven D'Aprano
On Mon, 02 Jun 2014 20:05:29 +0200, robertw89 wrote: > I invoked the wrong bug.py :/ , works fine now (this happens to me when > im a bit tired sometimes...). Clarity in naming is an excellent thing. If you have two files called "bug.py", that's two too many. Imagine having fifty files called "

Issues with tkinter

2014-06-02 Thread BNelson
Am having difficulty with importing tkinter following cross-compiling Python from source. My build environment: GCC 4.7 uClibc 0.9.33 buildroot Python 3.4 Tcl/Tk 8.6 target platform=ARM The symptoms are as follows: >>> import _tkinter ... # trying /usr/lib/python3.4/lib-dynload/_tkinter.cpytho

Re: Introdution

2014-06-02 Thread Mark Lawrence
On 03/06/2014 00:04, Emile van Sebille wrote: On 6/2/2014 3:56 PM, Mark Lawrence wrote: On 02/06/2014 23:01, Hisham Mughal wrote: HI! plz tell me about books for python i am beginner of this lang.. Regards, Hisham Either http://www.diveintopython.net/ or http://www.diveintopython3.net/ depe

Re: Introdution

2014-06-02 Thread Emile van Sebille
On 6/2/2014 3:56 PM, Mark Lawrence wrote: On 02/06/2014 23:01, Hisham Mughal wrote: HI! plz tell me about books for python i am beginner of this lang.. Regards, Hisham Either http://www.diveintopython.net/ or http://www.diveintopython3.net/ depending on whether you're using Python 2 or 3.

Re: Introdution

2014-06-02 Thread Mark Lawrence
On 02/06/2014 23:01, Hisham Mughal wrote: HI! plz tell me about books for python i am beginner of this lang.. Regards, Hisham Either http://www.diveintopython.net/ or http://www.diveintopython3.net/ depending on whether you're using Python 2 or 3. -- My fellow Pythonistas, ask not what our

Introdution

2014-06-02 Thread Hisham Mughal
HI! plz tell me about books for python i am beginner of this lang.. Regards, Hisham -- https://mail.python.org/mailman/listinfo/python-list

Re: Benefits of asyncio

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 6:45 AM, Paul Rubin wrote: >> - Thread-safe programming is easy to explain but devilishly >> difficult to get right. > > I keep hearing that but not encountering it. Yes there are classic > hazards from sharing mutable state between threads. However, it's > gener

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Terry Reedy
On 6/2/2014 7:10 AM, Robin Becker wrote: there seems to be an implicit assumption in python land that encoded strings are the norm. I don't know why you say that. To have a stream of bytes interpreted as characters, open in text mode and give the encoding. Otherwise, open in binary mode and

Re: Benefits of asyncio

2014-06-02 Thread Burak Arslan
On 06/02/14 20:40, Aseem Bansal wrote: > I read in these groups that asyncio is a great addition to Python 3. I have > looked around and saw the related PEP which is quite big BTW but couldn't > find a simple explanation for why this is such a great addition. Any simple > example where it can b

Re: Benefits of asyncio

2014-06-02 Thread Paul Rubin
Marko Rauhamaa writes: > - Thread programming assumes each thread is waiting for precisely > one external stimulus in any given state -- in practice, each > state must be prepared to handle quite a few possible stimuli. Eh? Threads typically have their own event loop dispatching

Re: Benefits of asyncio

2014-06-02 Thread Marko Rauhamaa
Terry Reedy : > I do not understand this. asyncio should switch between tasks faster > than the OS switches between threads, thus reducing waiting time. I don't know if thread switching is slower than task switching. However, there are two main reasons to prefer asyncio over threads: * Scalabil

Re: Benefits of asyncio

2014-06-02 Thread Roy Smith
In article , Terry Reedy wrote: > asyncio lets you write platform independent code while it makes good use > of the asynchronous i/o available on each particular system. Async-i/o > is one area where Windows has made advances over posix. But the models > are different, and if one uses Windows

Re: Benefits of asyncio

2014-06-02 Thread Terry Reedy
On 6/2/2014 1:40 PM, Aseem Bansal wrote: The following supplement Ian's answer. I read in these groups that asyncio is a great addition to Python 3. I have looked around and saw the related PEP which is quite big BTW but couldn't find a simple explanation for why this is such a great addition.

Re: Benefits of asyncio

2014-06-02 Thread Ian Kelly
On Mon, Jun 2, 2014 at 11:40 AM, Aseem Bansal wrote: > I read in these groups that asyncio is a great addition to Python 3. I have > looked around and saw the related PEP which is quite big BTW but couldn't > find a simple explanation for why this is such a great addition. Any simple > example

Re: Python 3 is killing Python

2014-06-02 Thread Mark Lawrence
On 02/06/2014 18:53, Ian Kelly wrote: On Mon, Jun 2, 2014 at 10:15 AM, Steven D'Aprano wrote: On Mon, 02 Jun 2014 09:01:01 -0600, Ian Kelly wrote: On Jun 1, 2014 12:11 PM, wrote: At least Py2 does not crash when using non ascii (eg sticking with cp1252). I just noticed this last week, Thu

Re: Strange Behavior

2014-06-02 Thread robertw89
I invoked the wrong bug.py :/ , works fine now (this happens to me when im a bit tired sometimes...). Im unsure about the "real" bugreport, will investigate if I find some time and motivation. -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange Behavior

2014-06-02 Thread Peter Otten
robert...@googlemail.com wrote: > Hello folks, > > I am not sure if it is only on my system the case that the code in > http://pastebin.com/WETvqMJN misbehaves in the stated way. > Can anybody reproduce it? > > I thought it could be that the tabs/spaces do influence it, but it doesn't > care. >

Re: Python 3 is killing Python

2014-06-02 Thread Ian Kelly
On Mon, Jun 2, 2014 at 10:15 AM, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 09:01:01 -0600, Ian Kelly wrote: > >> On Jun 1, 2014 12:11 PM, wrote: >> >>> At least Py2 does not crash when using non ascii (eg sticking with >>> cp1252). >>> >>> I just noticed this last week, Thursday, when presenti

Re: Strange Behavior

2014-06-02 Thread Mark Lawrence
On 02/06/2014 17:35, robert...@googlemail.com wrote: Hello folks, I am not sure if it is only on my system the case that the code in http://pastebin.com/WETvqMJN misbehaves in the stated way. Can anybody reproduce it? I thought it could be that the tabs/spaces do influence it, but it doesn't ca

Benefits of asyncio

2014-06-02 Thread Aseem Bansal
I read in these groups that asyncio is a great addition to Python 3. I have looked around and saw the related PEP which is quite big BTW but couldn't find a simple explanation for why this is such a great addition. Any simple example where it can be used? It can be used to have a queue of task

Strange Behavior

2014-06-02 Thread robertw89
Hello folks, I am not sure if it is only on my system the case that the code in http://pastebin.com/WETvqMJN misbehaves in the stated way. Can anybody reproduce it? I thought it could be that the tabs/spaces do influence it, but it doesn't care. Thank you very much for your time. Robert -- htt

Re: ImportError: No module named _gdb

2014-06-02 Thread Marcelo Sardelich
Didier thanks for your prompt reply. I installed a pre-built version of Python. As you said, probably something is missing. I tried to google packages related to gdb, but ain't had no luck. Do you have any idea if it is a compiler directive? I mean I can compile Python from source. Not a proble

Re: How to read a directory path from a txt file

2014-06-02 Thread Samuel Kamau
On Monday, June 2, 2014 12:24:59 PM UTC-4, Denis McMahon wrote: > On Mon, 02 Jun 2014 08:13:23 -0700, Samuel Kamau wrote: > > > > > I have permission issues with my web server. > > > > Hacks to fix permissions problems are dangerous. There is probably a > > better way to fix this issue. >

Re: Python 3 is killing Python

2014-06-02 Thread Johannes Bauer
On 02.06.2014 18:21, Roy Smith wrote: > Are we talking Tolkien trolls, Pratchett trolls, Rowling trolls, D&D > trolls, WoW trolls, or what? Details matter. Monkey Island trolls, obviously. Cheers, Johannes -- >> Wo hattest Du das Beben nochmal GENAU vorhergesagt? > Zumindest nicht öffentlich

Re: Python 3 is killing Python

2014-06-02 Thread Steven D'Aprano
On Mon, 02 Jun 2014 12:21:45 -0400, Roy Smith wrote: >> There's a corollary to Poe's Law that says that a sufficiently advanced >> troll is indistinguishable from a crank. Whichever JMF is, please don't >> feed him attention. > > Are we talking Tolkien trolls, Pratchett trolls, Rowling trolls, D&

Re: Is MVC Design Pattern good enough?

2014-06-02 Thread Marko Rauhamaa
Wolfgang Keller : > The most intuitive approach to database applications would be: > > http://en.wikipedia.org/wiki/Naked_objects > http://www.nakedobjects.org/ > > [...] > > Unfortunately, there's no Python framework (yet?) that implements this > design. It could be a blessing in disguise. Too o

Re: Python 3 is killing Python

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 2:21 AM, Roy Smith wrote: > Are we talking Tolkien trolls, Pratchett trolls, Rowling trolls, D&D > trolls, WoW trolls, or what? Details matter. Don't forget Frozen trolls, they're love experts! ChrisA (Why aren't you running?) -- https://mail.python.org/mailman/listinfo/

Re: Python 3 is killing Python

2014-06-02 Thread Roy Smith
In article <538ca310$0$29978$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 09:01:01 -0600, Ian Kelly wrote: > > > On Jun 1, 2014 12:11 PM, wrote: > > > >> At least Py2 does not crash when using non ascii (eg sticking with > >> cp1252). > >> > >> I just noti

Re: How to read a directory path from a txt file

2014-06-02 Thread Denis McMahon
On Mon, 02 Jun 2014 08:13:23 -0700, Samuel Kamau wrote: > I have permission issues with my web server. Hacks to fix permissions problems are dangerous. There is probably a better way to fix this issue. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/pyth

Re: Python 3 is killing Python

2014-06-02 Thread Steven D'Aprano
On Mon, 02 Jun 2014 09:01:01 -0600, Ian Kelly wrote: > On Jun 1, 2014 12:11 PM, wrote: > >> At least Py2 does not crash when using non ascii (eg sticking with >> cp1252). >> >> I just noticed this last week, Thursday, when presenting the absurdity >> of the Flexible String Representation. > > S

Re: Is MVC Design Pattern good enough?

2014-06-02 Thread Wolfgang Keller
> I had developed many database business applications using MVC design > pattern with different programming languages like PHP, Java EE, > VB.NET, C#, VB 6.0, VBA, etc. All of them defined the Model layer as > the data management of the application domain and business logic > implementation. I read

Re: Obfuscated Python hack

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 1:47 AM, Ian Kelly wrote: > On Mon, Jun 2, 2014 at 9:38 AM, Steven D'Aprano > wrote: >> On Mon, 02 Jun 2014 23:23:53 +1000, Chris Angelico wrote: >> >>> On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase >>> wrote: Stripping off the exec() call makes it pretty transparent tha

Re: Obfuscated Python hack

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 1:38 AM, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 23:23:53 +1000, Chris Angelico wrote: > >> On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase >> wrote: >>> Stripping off the exec() call makes it pretty transparent that you're >>> attempting (successfully on some platforms) to

Re: Obfuscated Python hack

2014-06-02 Thread Ian Kelly
On Mon, Jun 2, 2014 at 9:38 AM, Steven D'Aprano wrote: > On Mon, 02 Jun 2014 23:23:53 +1000, Chris Angelico wrote: > >> On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase >> wrote: >>> Stripping off the exec() call makes it pretty transparent that you're >>> attempting (successfully on some platforms) to

Re: Obfuscated Python hack

2014-06-02 Thread Steven D'Aprano
On Mon, 02 Jun 2014 23:23:53 +1000, Chris Angelico wrote: > On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase > wrote: >> Stripping off the exec() call makes it pretty transparent that you're >> attempting (successfully on some platforms) to set the value of "4" to >> "5". But a cute hack. > > And not

Re: How to read a directory path from a txt file

2014-06-02 Thread Samuel Kamau
On Monday, June 2, 2014 10:18:25 AM UTC-4, Samuel Kamau wrote: > I have created a txt file with various paths to directories. The paths look > like this > > /home/wachkama/Desktop/api/genshi > > /home/wachkama/Desktop/www/portal/schedule > > /home/wachkama/Desktop/show/help.genshi > > > > Ho

Re: Python 3 is killing Python

2014-06-02 Thread Ian Kelly
On Jun 1, 2014 12:11 PM, wrote: > At least Py2 does not crash when using non ascii > (eg sticking with cp1252). > > I just noticed this last week, Thursday, when presenting > the absurdity of the Flexible String Representation. So have you reported this alleged crash bug to the bug tracker? If n

Re: How to read a directory path from a txt file

2014-06-02 Thread Mark Lawrence
On 02/06/2014 15:18, Samuel Kamau wrote: I have created a txt file with various paths to directories. The paths look like this /home/wachkama/Desktop/api/genshi /home/wachkama/Desktop/www/portal/schedule /home/wachkama/Desktop/show/help.genshi How do i read this paths in python ? https://doc

Re: How to read a directory path from a txt file

2014-06-02 Thread Rustom Mody
On Monday, June 2, 2014 7:48:25 PM UTC+5:30, Samuel Kamau wrote: > I have created a txt file with various paths to directories. The paths look > like this > > /home/wachkama/Desktop/api/genshi > > /home/wachkama/Desktop/www/portal/schedule > > /home/wachkama/Desktop/show/help.genshi > > > >

Re: How to read a directory path from a txt file

2014-06-02 Thread Chris Angelico
On Tue, Jun 3, 2014 at 12:18 AM, Samuel Kamau wrote: > I have created a txt file with various paths to directories. The paths look > like this > /home/wachkama/Desktop/api/genshi > /home/wachkama/Desktop/www/portal/schedule > /home/wachkama/Desktop/show/help.genshi > > How do i read this paths in

How to read a directory path from a txt file

2014-06-02 Thread Samuel Kamau
I have created a txt file with various paths to directories. The paths look like this /home/wachkama/Desktop/api/genshi /home/wachkama/Desktop/www/portal/schedule /home/wachkama/Desktop/show/help.genshi How do i read this paths in python ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Obfuscated Python hack

2014-06-02 Thread Chris Angelico
On Mon, Jun 2, 2014 at 10:27 PM, Tim Chase wrote: > Stripping off the exec() call makes it pretty transparent that you're > attempting (successfully on some platforms) to set the value of "4" > to "5". But a cute hack. And not on Windows inside IDLE, where attempting to use 4 results in a =

Re: Obfuscated Python hack

2014-06-02 Thread Tim Chase
On 2014-06-02 12:11, Steven D'Aprano wrote: > Kids, don't try this at home! > > In Python 2.7, run this: > > exec((lambda *fs: reduce(lambda f, g: lambda x: f(g(x)), > fs))(*([lambda s: > s[1::2]+s[-2::-2]]*54))('motcye;cye._n8fo_drs(d4+)vle=5 ua.8) > (isedamr.ticspt spt rpi')) > > > Then run

Obfuscated Python hack

2014-06-02 Thread Steven D'Aprano
Kids, don't try this at home! In Python 2.7, run this: exec((lambda *fs: reduce(lambda f, g: lambda x: f(g(x)), fs))(*([lambda s: s[1::2]+s[-2::-2]]*54))('motcye;cye._n8fo_drs(d4+)vle=5 ua.8) (isedamr.ticspt spt rpi')) Then run these: 10 - 6 == 10 - 5 4 + 1 == 7 - 1 2*2 == 10//2 A shiny

Re: IDE for python

2014-06-02 Thread Mark Lawrence
On 02/06/2014 11:43, Tim Golden wrote: On 02/06/2014 10:15, Chris Angelico wrote: On Mon, Jun 2, 2014 at 7:02 PM, Mark Lawrence wrote: What is the Latin for "resident unicode expert go home"? Google Translate says: Eusebius, et revertatur in domum perito resident. ChrisA Try: Perite d

Re: Python GUI?

2014-06-02 Thread vidarwilliam
> I don't like it when you can D&D to position things. I don't understand why > someone wouldn't want to write the positioning code, and have fun with the > debugging. That's the best part about writing a program, in my opinion. I'm > against D&D with programming, and I'm not sure why. I don't

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Robin Becker
I probably should have mentioned it, but in my case it's not even Python (Java). It's exactly the same principal - an assumption was made that has become entrenched due to the fear of breakage. If they'd been forced to think about encodings up-front, it shouldn't have been an issue,

Re: IDE for python

2014-06-02 Thread Tim Golden
On 02/06/2014 10:15, Chris Angelico wrote: > On Mon, Jun 2, 2014 at 7:02 PM, Mark Lawrence wrote: >> >> What is the Latin for "resident unicode expert go home"? > > Google Translate says: > > Eusebius, et revertatur in domum perito resident. > > ChrisA > Try: Perite domestice unicodicis: vad

Re: IDE for python

2014-06-02 Thread Wolfgang Maier
Chris Angelico gmail.com> writes: > > On Mon, Jun 2, 2014 at 7:02 PM, Mark Lawrence yahoo.co.uk> wrote: > > > > What is the Latin for "resident unicode expert go home"? > > Google Translate says: > > Eusebius, et revertatur in domum perito resident. > > ChrisA > Oh, the joys of Google Tran

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Chris Angelico
On Mon, Jun 2, 2014 at 7:02 PM, Tim Delaney wrote: > In Java, it's much worse. At least with Python you can perform string-like > operations on bytes. In Java you have to convert it to characters before you > can really do anything with it, so people just use the default encoding all > the time -

Re: IDE for python

2014-06-02 Thread Chris Angelico
On Mon, Jun 2, 2014 at 7:02 PM, Mark Lawrence wrote: > > What is the Latin for "resident unicode expert go home"? Google Translate says: Eusebius, et revertatur in domum perito resident. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE for python

2014-06-02 Thread Mark Lawrence
On 02/06/2014 09:15, Tim Golden wrote: On 02/06/2014 08:28, Wolfgang Maier wrote: gmail.com> writes: Amen. Ite missa est. Oh, why all the lamenting about python's unicode support, when your latin is so superbe ! Elegant solution to all your problems :) After all, if you can't use Lati

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Tim Delaney
On 2 June 2014 17:45, Wolfgang Maier < wolfgang.ma...@biologie.uni-freiburg.de> wrote: > Tim Delaney gmail.com> writes: > > > For some purposes, there needs to be a way to treat an arbitrary stream > of > bytes as an arbitrary stream of 8-bit characters. iso-latin-1 is a > convenient way to do th

Re: IDE for python

2014-06-02 Thread Tim Golden
On 02/06/2014 08:28, Wolfgang Maier wrote: > gmail.com> writes: > >> >> Amen. >> Ite missa est. >> > > Oh, why all the lamenting about python's unicode support, when your latin is > so superbe ! Elegant solution to all your problems :) After all, if you can't use Latin-1 for Latin, what can yo

Re: Python 3.2 has some deadly infection

2014-06-02 Thread Wolfgang Maier
Tim Delaney gmail.com> writes: > > I also should have been more clear that *in the particular situation I was talking about* iso-latin-1 as default would be the right thing to do, not in the general case. Quite often we won't know the correct encoding until we've executed a command via ssh - iso

Re: IDE for python

2014-06-02 Thread Wolfgang Maier
gmail.com> writes: > > Amen. > Ite missa est. > Oh, why all the lamenting about python's unicode support, when your latin is so superbe ! Elegant solution to all your problems :) -- https://mail.python.org/mailman/listinfo/python-list