Re: multithreading

2012-04-08 Thread Kiuhnm
On 4/8/2012 7:04, Bryan wrote: Kiuhnm wrote: My question is this: can I use 'threading' without interfering with the program which will import my module? Yes. The things to avoid are described at the bottom of: http://docs.python.org/library/threading.html On platforms without threads, 'impor

f python?

2012-04-08 Thread Xah Lee
hi guys, sorry am feeling a bit prolifit lately. today's show, is: 〈Fuck Python〉 http://xahlee.org/comp/fuck_python.html Fuck Python By Xah Lee, 2012-04-08 fuck Python. just fucking spend 2 hours and still going. here's the short story. so recently i swi

Re: f python?

2012-04-08 Thread Steven D'Aprano
On Sun, 08 Apr 2012 04:11:20 -0700, Xah Lee wrote: [...] I have read Xah Lee's post so that you don't have to. Shorter Xah Lee: "I don't know Python very well, and rather than admit I made some pretty lousy design choices in my code, I blame Python. And then I cross-post about it,

Re: f python?

2012-04-08 Thread Chris Angelico
Congratulations. You just tried to treat Python as though it were a hammer and your task as though it were a nail. And you bashed your thumb while doing it. You also hurt yourself on Windows and blamed it on Python. I'm afraid I'm fresh out of sympathy, won't get a new shipment till tomorrow. Chri

Re: f python?

2012-04-08 Thread Xah Lee
On Apr 8, 4:34 am, Steven D'Aprano wrote: > On Sun, 08 Apr 2012 04:11:20 -0700, Xah Lee wrote: > > [...] > > I have read Xah Lee's post so that you don't have to. > > Shorter Xah Lee: > >     "I don't know Python very well, and rather than admit I made >      some pretty lousy design choices in my

Re: f python?

2012-04-08 Thread HoneyMonster
On Sun, 08 Apr 2012 11:34:56 +, Steven D'Aprano wrote: > I have read Xah Lee's post so that you don't have to. Well, I certainly shall not be reading - or even seeing - any more of his drivel. -- http://mail.python.org/mailman/listinfo/python-list

Re: f python?

2012-04-08 Thread Martin P. Hellwig
On 08/04/2012 12:11, Xah Lee wrote: Hi Xah, You clearly didn't want help on this subject, as you really now how to do it anyway. But having read your posts over the years, I'd like to give you an observation on your persona, free of charge! :-) You are actually a talented writer, some may fi

Re: f python?

2012-04-08 Thread Steven D'Aprano
On Sun, 08 Apr 2012 11:34:56 +, Steven D'Aprano wrote: > When the only tool you know how to use is a hammer, everything looks > like a nail. Instead of using regexes ("now you have two problems"), use > the right tool: to count path components, split the path, then count the > number of path c

Re: Python Gotcha's?

2012-04-08 Thread Roy Smith
In article , John Nagle wrote: > 1. Nobody is really in charge of third party packages. In the > Perl world, there's a central repository, CPAN, and quality > control. Python's "pypi" is just a collection of links. Many > major packages are maintained by one person, and if they lose > intere

Re: f python?

2012-04-08 Thread D'Arcy Cain
On 04/08/12 09:11, HoneyMonster wrote: Well, I certainly shall not be reading - or even seeing - any more of his drivel. Yes you will. There is always someone willing to include his entire messages for a one line reply. It's always September somewhere. -- D'Arcy J.M. Cain | Democra

Re: f python?

2012-04-08 Thread David Canzi
Xah Lee wrote: >hi guys, > >sorry am feeling a bit prolifit lately. > >today's show, is: 'Fuck Python' >http://xahlee.org/comp/fuck_python.html > > >Fuck Python > By Xah Lee, 2012-04-08 > >fuck Python. > >just fucking spend 2 hours and still going. > >here's th

Re: f python?

2012-04-08 Thread Kaz Kylheku
["Followup-To:" header set to comp.lang.lisp.] On 2012-04-08, David Canzi wrote: > Xah Lee wrote: >>hi guys, >> >>sorry am feeling a bit prolifit lately. >> >>today's show, is: 'Fuck Python' >>http://xahlee.org/comp/fuck_python.html >> >> >>Fuck Python >> By X

Re: f python?

2012-04-08 Thread Peter J. Holzer
On 2012-04-08 17:03, David Canzi wrote: > If you added up the cost of all the extra work that people have > done as a result of Microsoft's decision to use '\' as the file > name separator, it would probably be enough money to launch the > Burj Khalifa into geosynchronous orbit. So we have anothe

Re: f python?

2012-04-08 Thread J�rgen Exner
"David Canzi" wrote: >Xah Lee wrote: Please check whom you are replying to. Do not feed the trolls, please. jue -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-08 Thread Miki Tebeka
> 8. Opening a URL can result in an unexpected prompt on > standard input if the URL has authentication. This can > stall servers. Can you give an example? I don't think anything in the standard library does that. -- http://mail.python.org/mailman/listinfo/python-list

Re: f python?

2012-04-08 Thread Terry Reedy
On 4/8/2012 7:11 AM, Xah Lee wrote: so recently i switched to a Windows version of python. Now, Windows version takes path using win backslash, instead of cygwin slash. Python passes strings to Windows functions as the user requests. In spite of the fact that command.com and cmd.exe (command

Question on Python 3 shell restarting

2012-04-08 Thread Franck Ditter
How may I get a fresh Python shell with Idle 3.2 ? I have to run the same modules several times with all variables cleared. Thanks, franck -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Gotcha's?

2012-04-08 Thread Chris Angelico
On Mon, Apr 9, 2012 at 3:55 AM, Miki Tebeka wrote: >> 8.  Opening a URL can result in an unexpected prompt on >> standard input if the URL has authentication.  This can >> stall servers. > Can you give an example? I don't think anything in the standard library does > that. I just threw together

Interrupting a blocking function frolm another thread.

2012-04-08 Thread superhac...@gmail.com
I am using the python module nfqueue-bindings which is a nfqueue packet intercepting module. It uses the following snippet of code to start the process: print "trying to run" try: q.try_run() except KeyboardInterrupt, e: print "interrupted" The q.try_run() method blocks. I would

Re: Python Gotcha's?

2012-04-08 Thread John Nagle
On 4/8/2012 10:55 AM, Miki Tebeka wrote: 8. Opening a URL can result in an unexpected prompt on standard input if the URL has authentication. This can stall servers. Can you give an example? I don't think anything in the standard library does that. It's in "urllib". See http://

Re: f python?

2012-04-08 Thread Kaz Kylheku
On 2012-04-08, Peter J. Holzer wrote: > On 2012-04-08 17:03, David Canzi wrote: >> If you added up the cost of all the extra work that people have >> done as a result of Microsoft's decision to use '\' as the file >> name separator, it would probably be enough money to launch the >> Burj Khalifa

Re: f python?

2012-04-08 Thread Chris Angelico
On Mon, Apr 9, 2012 at 5:14 AM, Kaz Kylheku wrote: > Not only can compilers compress storage by recognizing that string literals > are > the suffixes of other string literals, but a lot of string manipulation code > is > simplified, because you can treat a pointer to interior of any string as a

Re: GUIs - a modest proposal

2012-04-08 Thread lkcl
On Mar 2, 6:42 am, lkcl wrote: >  ah.  right.  you're either referring to pyjampiler (in the pyjs > world) or to > [...] >  the former actually got taken to an extreme by a group who embedded >  the pyjs 0.5 compiler into their application environment, i keep > forgetting >  what it's called.

Re: Python Gotcha's?

2012-04-08 Thread André Malo
* Grzegorz Staniak wrote: > On 06.04.2012, rusi wroted: > >> There should be one-- and preferably only one --obvious way to do it. > > Then again, practicality beats purity. Yes. If you ever grepped for, say, the usage of dictionary keys in a bigger application, you might agree, that having mu

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-04-08 Thread Lie Ryan
On 03/30/2012 06:25 AM, Steve Howell wrote: On Mar 29, 11:53 am, Devin Jeanpierre wrote: Well, what sort of language differences make for English vs Mandarin? Relational algebraic-style programming is useful, but definitely a large language barrier to people that don't know any SQL. I think th

Re: Multiprocessing & Logging

2012-04-08 Thread Thibaut
Le 08/04/2012 02:56, Vinay Sajip a écrit : Thibaut gmail.com> writes: This is exactly what I wanted, it seems perfect. However I still have a question, from what I understood, I have to configure logging AFTER creating the process, to avoid children process to inherits the logging config. Un

Re: Interrupting a blocking function frolm another thread.

2012-04-08 Thread Adam Skutt
On Apr 8, 2:45 pm, "superhac...@gmail.com" wrote: > I am using the python module nfqueue-bindings which is a nfqueue > packet intercepting module.  It uses the following snippet of code to > start the process: > > print "trying to run" > try: >      q.try_run() >      except KeyboardInterrupt, e:

Re: Interrupting a blocking function frolm another thread.

2012-04-08 Thread superhac007
On Sunday, April 8, 2012 3:55:41 PM UTC-5, Adam Skutt wrote: > On Apr 8, 2:45 pm, "superhac...@gmail.com" > wrote: > > I am using the python module nfqueue-bindings which is a nfqueue > > packet intercepting module.  It uses the following snippet of code to > > start the process: > > > > print "tr

Re: f python?

2012-04-08 Thread Ian Kelly
On Sun, Apr 8, 2012 at 11:32 AM, Peter J. Holzer wrote: > Poul-Henning Kamp nominated the C/Unix guys: > > http://queue.acm.org/detail.cfm?id=2010365 Besides what Kaz and Chris wrote, the suggestion that if they had chosen ptr+len format then we wouldn't have buffer overflows is erroneous. There

Re: f python?

2012-04-08 Thread BartC
"Kaz Kylheku" wrote in message news:20120408114313...@kylheku.com... Worse, the one byte Unix mistake being covered is, disappointingly, just a clueless rant against null-terminated strings. Null-terminated strings are infinitely better than the ridiculous encapsulation of length + data. For

Re: f python?

2012-04-08 Thread Nobody
On Sun, 08 Apr 2012 04:11:20 -0700, Xah Lee wrote: > Ok no problem. My sloppiness. After all, my implementation wasn't > portable. So, let's fix it. After a while, discovered there's the > os.sep. Ok, replace "/" to os.sep, done. Then, bang, all hell > went lose. Because, the backslash is used as

Re: f python?

2012-04-08 Thread David Robinow
On Sun, Apr 8, 2012 at 6:55 PM, Dennis Lee Bieber wrote: >        The main reason, as I recall, for the command line using \ for file > paths is that it inherited / as command OPTION prefix from CP/M; MS-DOS > being a 32-bit work-alike for CP/M in the first generation. I also thought it was becau

pygame.Rect question

2012-04-08 Thread Scott Siegler
Hello, I am new to Python and began using pygame to start some game programming. I was hoping someone could help me out with something that seems simple but is really confusing me. I am creating a rect and then using the attributes of the rect to set the size and location. I set rect.left to

Re: f python?

2012-04-08 Thread Dave Angel
On 04/08/2012 08:04 PM, David Robinow wrote: > On Sun, Apr 8, 2012 at 6:55 PM, Dennis Lee Bieber > wrote: >>The main reason, as I recall, for the command line using \ for file >> paths is that it inherited / as command OPTION prefix from CP/M; MS-DOS >> being a 32-bit work-alike for CP/M

Re: pygame.Rect question

2012-04-08 Thread Dave Angel
On 04/08/2012 07:58 PM, Scott Siegler wrote: > Hello, > > I am new to Python and began using pygame to start some game programming. I > was hoping someone could help me out with something that seems simple but is > really confusing me. > > I am creating a rect and then using the attributes of th

Re: multithreading

2012-04-08 Thread Bryan
Kiuhnm wrote: > I have a decorator which takes an optional argument that tells me > whether I should use locks. > Maybe I could import 'threading' only if needed. If the user wants to > use locks I'll assume that 'threading' is available on his/her system. Use of dummy_threading might be cleaner.

Re: Interrupting a blocking function frolm another thread.

2012-04-08 Thread Adam Skutt
On Apr 8, 5:52 pm, superhac...@gmail.com wrote: > On Sunday, April 8, 2012 3:55:41 PM UTC-5, Adam Skutt wrote: > > On Apr 8, 2:45 pm, "superhac...@gmail.com" > > wrote: > > > I am using the python module nfqueue-bindings which is a nfqueue > > > packet intercepting module.  It uses the following s

Re: Python Script Works Locally But Not Remotely with SSH

2012-04-08 Thread Jerry Hill
On Sat, Apr 7, 2012 at 5:41 PM, Dennis Lee Bieber wrote: >        The WinXP machine would need to have X-client translator (something > that redirects all the Windows native graphics into X protocol and ships > it to the specified server machine). > >        As I recall -- such are not cheap appli

Re: f python?

2012-04-08 Thread Xah Lee
Xah Lee wrote: « http://xahlee.org/comp/fuck_python.html » David Canzi wrote «When Microsoft created MS-DOS, they decided to use '\' as the separator in file names.  This was at a time when several previously existing interactive operating systems were using '/' as the file name separator an

Re: f python?

2012-04-08 Thread Chris Angelico
On Mon, Apr 9, 2012 at 3:45 PM, Xah Lee wrote: > because, slash is one of the useful char, far more so than backslash. > Users should be able to use that for file names. > Users should be able to use EVERY character for their file names. So here's a solution. Your path separator is the byte 0xFF,