Re: Multi-line commands with 'python -c'

2014-05-29 Thread Rustom Mody
On Friday, May 30, 2014 12:15:46 PM UTC+5:30, Rustom Mody wrote: > Heres a (pr) approx > > $ python -c 'import os, pprint; pprint.pprint ([ r for r, d, f in > os.walk(".") if len(d+f) != 1])' Without pprint: (pooor) python -c 'import os; print "\n".join([ r for r, d, f in os.walk(".") if l

Re: Multi-line commands with 'python -c'

2014-05-29 Thread Rustom Mody
On Friday, May 30, 2014 11:34:36 AM UTC+5:30, Rustom Mody wrote: > On Friday, May 30, 2014 6:22:24 AM UTC+5:30, Chris Angelico wrote: > > Since lines are so critical to Python syntax, I'm a little surprised > > there's no majorly obvious solution to this... or maybe I'm just > > blind. > > Problem

Re: How to run script from interpreter?

2014-05-29 Thread Steven D'Aprano
On Fri, 30 May 2014 12:04:27 +1000, Chris Angelico wrote: > On Fri, May 30, 2014 at 11:49 AM, Steven D'Aprano > wrote: >> On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote: >> >>> On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano >>> wrote: (By the way, ; won't work for a Python shel

Re: Multi-line commands with 'python -c'

2014-05-29 Thread Rustom Mody
On Friday, May 30, 2014 6:22:24 AM UTC+5:30, Chris Angelico wrote: > Since lines are so critical to Python syntax, I'm a little surprised > there's no majorly obvious solution to this... or maybe I'm just > blind. > Problem: Translate this into a shell one-liner: > import os > for root, dirs, fil

Script suddenly stops

2014-05-29 Thread Chris
Dear All, I'm trying to read ten 200 MB textfiles into a MySQL MyISAM database (Linux, ext4). The script output is suddenly stopping, while the Python process is still running (or should I say sleeping?). It's not in top, but in ps visible. Why is it stopping? Is there a way to make it continue,

Re: PythonCE successfully inst'ed, but scripts don't work. Please help.

2014-05-29 Thread Abdullah Indorewala
Hi, I know you posted this 15 years ago but I recently stumbled across your post here : https://mail.python.org/pipermail/python-list/1999-May/018340.html And I am in the same situation (kind of). I can’t get Python to install on my MobilePro 770 running Windows CE 3.0. Are you still availabl

Re: Multi-line commands with 'python -c'

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 12:34 PM, Zachary Ware wrote: > You can always cheat: > > $ python -c 'exec("import os\nfor root, dirs, files in os.walk(\".\"):\n if > len(dirs + files) == 1: print(root)")' > > Doesn't do much for being long and fiddly, though. Not really, no! Heh. I wrote that in compet

Re: Proposal of an API to deal with fingerprints on Python

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 7:21 AM, Pedro Izecksohn wrote: > Today I wrote the following API. It was not implemented on C yet. Do you > have any comment? Could you help me to implement it? > > http://www.izecksohn.com/pedro/python/fingerprint/fingerprint.001.py If that's a proof-of-concept for ju

Multi-line commands with 'python -c'

2014-05-29 Thread Zachary Ware
On Thursday, May 29, 2014, Chris Angelico > wrote: > Since lines are so critical to Python syntax, I'm a little surprised > there's no majorly obvious solution to this... or maybe I'm just > blind. > > Problem: Translate this into a shell one-liner: > > import os > for root, dirs, files in os.walk

Proposal of an API to deal with fingerprints on Python

2014-05-29 Thread Pedro Izecksohn
  Today I wrote the following API. It was not implemented on C yet. Do you have any comment? Could you help me to implement it? http://www.izecksohn.com/pedro/python/fingerprint/fingerprint.001.py -- https://mail.python.org/mailman/listinfo/python-list

Re: How to run script from interpreter?

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 11:49 AM, Steven D'Aprano wrote: > On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote: > >> On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano >> wrote: >>> (By the way, ; won't work for a Python shell, because ;spam already is >>> valid Python syntax: it's an empty s

Re: How to run script from interpreter?

2014-05-29 Thread Steven D'Aprano
On Fri, 30 May 2014 10:46:34 +1000, Chris Angelico wrote: > On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano > wrote: >> (By the way, ; won't work for a Python shell, because ;spam already is >> valid Python syntax: it's an empty statement followed by the statement >> spam, separated by a semico

Re: pyflakes best practices?

2014-05-29 Thread Roy Smith
In article , Mark Lawrence wrote: > On 30/05/2014 01:13, Roy Smith wrote: > > We've recently started using pyflakes. The results seem to be similar > > to most tools of this genre. It found a few real problems. It > > generated a lot of noise about things which weren't really wrong, but > > w

Multi-line commands with 'python -c'

2014-05-29 Thread Chris Angelico
Since lines are so critical to Python syntax, I'm a little surprised there's no majorly obvious solution to this... or maybe I'm just blind. Problem: Translate this into a shell one-liner: import os for root, dirs, files in os.walk("."): if len(dirs + files) == 1: print(root) Solution 1: Syn

Re: pyflakes best practices?

2014-05-29 Thread Mark Lawrence
On 30/05/2014 01:13, Roy Smith wrote: We've recently started using pyflakes. The results seem to be similar to most tools of this genre. It found a few real problems. It generated a lot of noise about things which weren't really wrong, but were easy to fix (mostly, unused imports), and a few p

Re: How to run script from interpreter?

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 10:33 AM, Steven D'Aprano wrote: > (By the way, ; won't work for a Python shell, because ;spam already is > valid Python syntax: it's an empty statement followed by the statement > spam, separated by a semicolon.) That's not really a problem, though. It's not going to stop

Re: How to run script from interpreter?

2014-05-29 Thread Steven D'Aprano
On Thu, 29 May 2014 15:26:37 -0500, Mark H Harris wrote: > I think the IDLE REPL should have a system shell mode. What say you? I don't use IDLE, so I don't really care what you do to it. But speaking generally, -1 on that. IDLE is primarily aimed at beginners, and beginners have enough trouble

Re: Forking PyPI package

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 7:54 AM, Ian Kelly wrote: > On Thu, May 29, 2014 at 1:40 AM, Chris Angelico wrote: >> If you absolutely can't get in touch with him, the only option is to >> go back to the original protocol and manually reimplement it, >> completely ignoring this code. It's sad but true;

pyflakes best practices?

2014-05-29 Thread Roy Smith
We've recently started using pyflakes. The results seem to be similar to most tools of this genre. It found a few real problems. It generated a lot of noise about things which weren't really wrong, but were easy to fix (mostly, unused imports), and a few plain old false positives which have

Re: Binary data exchange

2014-05-29 Thread Mark Lawrence
On 30/05/2014 00:25, rasikasriniva...@gmail.com wrote: Of course Cut and paste issue. Anyhow, i will look at the struct module. cheers, srini Please let us know how you get on, please don't top post, and please either use the mailing list https://mail.python.org/mailman/listinfo/python-

Re: Binary data exchange

2014-05-29 Thread rasikasriniva...@gmail.com
Of course Cut and paste issue. Anyhow, i will look at the struct module. cheers, srini On Thursday, May 29, 2014 7:09:21 PM UTC-4, MRAB wrote: > On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote: > > > friends > > > > > > I have a pair of simple python programs as follows: > > > > >

Re: Binary data exchange

2014-05-29 Thread Ian Kelly
On Thu, May 29, 2014 at 5:09 PM, MRAB wrote: > On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote: >> the received data for the messages 9 thru 13 are not as expected. >> >> I wonder if anyone can see what I am doing wrong? >> >> Appreciate any hints. thanks, srini >> > I don't understand why y

Re: Binary data exchange

2014-05-29 Thread MRAB
On 2014-05-29 23:08, rasikasriniva...@gmail.com wrote: friends I have a pair of simple python programs as follows: #!/usr/bin/python # broadcast.py import socket from ctypes import * import random class PurgeData(Structure): _fields_ = [("press",c_int), ("ticks",c_int), ("volume",c_float)

Re: IDE for python

2014-05-29 Thread Travis Griggs
> On May 28, 2014, at 3:43, Sameer Rathoud wrote: > > Hello everyone, > > I am new to python. > > I am currently using python 3.3 > > With python I got IDLE, but I am not very comfortable with this. > > Please suggest, if we have any free ide for python development. > -- > https://mail.pyt

Re: Binary data exchange

2014-05-29 Thread rasikasriniva...@gmail.com
BTW - My environment is: H:\>python Enthought Canopy Python 2.7.6 | 64-bit | (default, Apr 11 2014, 20:31:44) [MSC v .1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> -- https://mail.python.org/mailman/listinfo/python-list

Binary data exchange

2014-05-29 Thread rasikasriniva...@gmail.com
friends I have a pair of simple python programs as follows: #!/usr/bin/python # broadcast.py import socket from ctypes import * import random class PurgeData(Structure): _fields_ = [("press",c_int), ("ticks",c_int), ("volume",c_float)] myPort = 10756 sock=socket.socket(socket.AF_INET,s

Re: Forking PyPI package

2014-05-29 Thread Ian Kelly
On Thu, May 29, 2014 at 1:40 AM, Chris Angelico wrote: > If you absolutely can't get in touch with him, the only option is to > go back to the original protocol and manually reimplement it, > completely ignoring this code. It's sad but true; some code dies > because of a trivial thing like "Oops,

Re: IDE for python

2014-05-29 Thread Ben Finney
Terry Reedy writes: > I am curious how many of the editors people have been recommending > have all of the following Idle features, that I use constantly. You can satisfy such wonderings with a search for the answers to such questions, which is how I got these answers. > 1. Run [Python] code in

Re: IDE for python

2014-05-29 Thread Terry Reedy
On 5/29/2014 12:51 PM, Chris Angelico wrote: On Fri, May 30, 2014 at 2:39 AM, Terry Reedy wrote: I am curious how many of the editors people have been recommending have all of the following Idle features, that I use constantly. Regarding SciTE: 1. Run code in the editor with a single keypre

Re: IDE for python

2014-05-29 Thread Mark Lawrence
On 29/05/2014 21:11, Mark H Harris wrote: The OP is looking for an "IDE-like" interactive environment, because he is "uncomfortable" with IDLE. IDLE is THE choice, however ---precisely because IDLE is clean, elegant, and most importantly "simple". It is simple to understand, and it is even simpl

Re: How to run script from interpreter?

2014-05-29 Thread Mark H Harris
On 5/28/14 10:22 PM, Steven D'Aprano wrote: If you want to use python as a shell-glue you can try using system. >>> from os import system >>> def ([parms]) >>> blah blah >>> rc = system(" os.system is cool for quick and dirty calls to an external command. But for serious work

Re: IDE for python

2014-05-29 Thread Mark H Harris
On 5/29/14 11:44 AM, Paul Rudin wrote: Terry Reedy writes: I am curious how many of the editors people have been recommending have all of the following Idle features, that I use constantly. 1. Run code in the editor with a single keypress. 2. Display output and traceback in a window that lets

Re: daemon thread cleanup approach

2014-05-29 Thread Carl Banks
On Thursday, May 29, 2014 1:15:35 AM UTC-7, Chris Angelico wrote: > On Thu, May 29, 2014 at 11:20 AM, Carl Banks wrote: > > > Most threads have cleanup work to do (such as deleting temporary > > directories and killing spawned processes). > > > > > > For better or worse, one of the requirement

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-29 Thread ps16thypresenceisfullnessofjoy
That's interesting, now I learned something else too. As I said before, though, I want users to be able to enter paths in the XML file exactly the way they would be entered in a Windows shortcut. (Actually, my program currently only has one Windows user, for whom I develop it [I don't even use i

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
Steven D'Aprano : > You're talking as if this were only theoretical. It is not. The state > of the art in compiler techniques has advanced a lot since the old > days of the Pascal P-Machine. Parakeet, for example[2], compiles > numeric functions to optimized machine code on the fly using > decorat

Re: Fortran

2014-05-29 Thread Steven D'Aprano
On Thu, 29 May 2014 17:50:00 +0300, Marko Rauhamaa wrote: > alb...@spenarnc.xs4all.nl (Albert van der Horst): > >> I always thought that the real point of JIT was that it can take >> advantage of type information that is not available until runtime. If >> it can infer that something is an integer

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-29 Thread Peter Pearson
On 29 May 2014 14:06:47 GMT, Albert van der Horst wrote: > In article , > Mark H Harris wrote: >>On 5/11/14 1:59 PM, Chris Angelico wrote: > julia> prec=524288 > 524288 > julia> with_bigfloat_precision(prec) do > println(atan(BigFloat(1)/5)*16 - atan(BigFloat(1)/239)

Re: IDE for python

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 2:39 AM, Terry Reedy wrote: > I am curious how many of the editors people have been recommending have all > of the following Idle features, that I use constantly. Regarding SciTE: > 1. Run code in the editor with a single keypress. Yes, although for most of what I like t

Re: IDE for python

2014-05-29 Thread Paul Rudin
Terry Reedy writes: > On 5/29/2014 5:41 AM, Wolfgang Maier wrote: >> On 28.05.2014 12:43, Sameer Rathoud wrote: >>> Hello everyone, >>> >>> I am new to python. >>> >>> I am currently using python 3.3 >>> >>> With python I got IDLE, but I am not very comfortable with this. > > What bothers you the

Re: IDE for python

2014-05-29 Thread Terry Reedy
On 5/29/2014 5:41 AM, Wolfgang Maier wrote: On 28.05.2014 12:43, Sameer Rathoud wrote: Hello everyone, I am new to python. I am currently using python 3.3 With python I got IDLE, but I am not very comfortable with this. What bothers you the most. Seems like not too many other people on th

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 30, 2014 at 12:50 AM, Marko Rauhamaa wrote: >> Python code, too, is compiled into interpreted bytecode. Again, you >> could compile it into machine code ahead of execution or perform the >> compilation on the fly with JIT techniques. However, Python is so >> ridicul

Re: Fortran

2014-05-29 Thread Chris Angelico
On Fri, May 30, 2014 at 12:50 AM, Marko Rauhamaa wrote: > Python code, too, is compiled into interpreted bytecode. Again, you > could compile it into machine code ahead of execution or perform the > compilation on the fly with JIT techniques. However, Python is so > ridiculously dynamic that such

Re: Fortran

2014-05-29 Thread Marko Rauhamaa
alb...@spenarnc.xs4all.nl (Albert van der Horst): > I always thought that the real point of JIT was that it can take > advantage of type information that is not available until runtime. If > it can infer that something is an integer, just before entering a loop > to be executed millions of times,

Re: Fortran

2014-05-29 Thread Albert van der Horst
In article <8761l9pi3n@elektro.pacujo.net>, Marko Rauhamaa wrote: > >Producing an effective JIT for Python seems like a formidable challenge >but not impossible in principle. After all, the developer *could* >provide that static typing information in, like, 99.9% of the code. That >would be

Re: Fortran (Was: The "does Python have variables?" debate)

2014-05-29 Thread Albert van der Horst
In article , Mark H Harris wrote: >On 5/11/14 1:59 PM, Chris Angelico wrote: julia> prec=524288 524288 >>> julia> with_bigfloat_precision(prec) do println(atan(BigFloat(1)/5)*16 - atan(BigFloat(1)/239)*4) end >> >> Would it be quicker (and no less accurate

Re: Python alternative to Google Groups

2014-05-29 Thread Steven Clift
Ah, I wasn't referring to Google Groups newsgroup/usenet connection, but if one wanted to host open source based online groups themselves that are similar to the web experience with Google Groups overall. While folks who just want a mailing list are well served by Mailman, Sympa, and others ... fo

Re: Command prompt not shown when running Python script with subprocess on Windows

2014-05-29 Thread Tim Golden
On 28/05/2014 21:46, ps16thypresenceisfullnessof...@gmail.com wrote: > > Thank you for your replies. I tried what you suggested in your second > post and it worked. > > That was actually a mistake in the app_list.xml file. As you said: > > %ProgramFiles%\LibreOffice > 4\program\swriter.exe "C:\U

Re: Python alternative to Google Groups

2014-05-29 Thread Tim Golden
On 29/05/2014 11:57, Mark Lawrence wrote: > On 29/05/2014 06:06, Tim Golden wrote: >> On a more serious note, it does look interesting and it would be great >> to have a credible alternative to promote for people who tend towards >> GG. Needs to someone to do the setup / config / management though.

Re: Python 3 is killing Python

2014-05-29 Thread Larry Martell
On Wed, May 28, 2014 at 10:49 PM, Steven D'Aprano wrote: > On Wed, 28 May 2014 14:58:05 -0500, Larry Martell wrote: > > > On Wed, May 28, 2014 at 2:49 PM, Paul Rubin > > wrote: > > > >> Larry Martell writes: > >> > Somthing I came across in my travels through the ether: > >> > [1]https://medium

Re: Python alternative to Google Groups

2014-05-29 Thread Mark Lawrence
On 29/05/2014 06:06, Tim Golden wrote: On 28/05/2014 22:54, Steven Clift wrote: If you are looking for an open source alternative between Google Groups and Mailman, I wanted to share: http://groupserver.org It has recent release and new design. Aargh. I hate it when someone does that: p

Re: IDE for python

2014-05-29 Thread Wolfgang Maier
On 28.05.2014 12:43, Sameer Rathoud wrote: Hello everyone, I am new to python. I am currently using python 3.3 With python I got IDLE, but I am not very comfortable with this. Please suggest, if we have any free ide for python development. Seems like not too many other people on this list

Re: Forking PyPI package

2014-05-29 Thread Wiktor
On Thu, 29 May 2014 02:31:56 +0200, Wiktor wrote: > So, what should I do? Thanks guys, you're right. I'll contact the Lion. ;-) Yes, I forgot to mention that pwdhash.py was published under BSD licence. Without knowing that I wouldn't even consider forking it. -- Best regards, Wikto

Re: IDE for python

2014-05-29 Thread Duncan Booth
Duncan Booth wrote: > Sameer Rathoud wrote: > >> On Wednesday, May 28, 2014 5:16:41 PM UTC+5:30, Greg Schroeder wrote: >>> > > Please suggest, if we have any free ide for python development. >>> >>> >>> >>> Anything that writes text is fine. >>> >>> I recommend the standard text editor for

Re: daemon thread cleanup approach

2014-05-29 Thread Chris Angelico
On Thu, May 29, 2014 at 11:20 AM, Carl Banks wrote: > Most threads have cleanup work to do (such as deleting temporary directories > and killing spawned processes). > > For better or worse, one of the requirements is that the library can't cause > the program to hang no matter what... This ma y

Re: IDE for python

2014-05-29 Thread Duncan Booth
Sameer Rathoud wrote: > On Wednesday, May 28, 2014 5:16:41 PM UTC+5:30, Greg Schroeder wrote: >> > > Please suggest, if we have any free ide for python development. >> >> >> >> Anything that writes text is fine. >> >> I recommend the standard text editor for your OS (Notepad if you use >> >>

Re: Forking PyPI package

2014-05-29 Thread Chris Angelico
On Thu, May 29, 2014 at 5:56 PM, Duncan Booth wrote: > Chris Angelico wrote: > >> If you absolutely can't get in touch with him, the only option is to >> go back to the original protocol and manually reimplement it, >> completely ignoring this code. It's sad but true; some code dies >> because of

Re: IDE for python

2014-05-29 Thread Chris Angelico
On Thu, May 29, 2014 at 9:12 AM, Rhodri James wrote: > On Wed, 28 May 2014 14:04:55 +0100, Steven D'Aprano > wrote: > >> My IDE is to have three GUI windows open: >> >> * A web browser for searching the Internet. Any browser will do, but I >> prefer Firefox. >> >> * A tabbed editor. I prefer kate

Re: Forking PyPI package

2014-05-29 Thread Duncan Booth
Chris Angelico wrote: > If you absolutely can't get in touch with him, the only option is to > go back to the original protocol and manually reimplement it, > completely ignoring this code. It's sad but true; some code dies > because of a trivial thing like "Oops, I forgot to actually say that >

Re: Forking PyPI package

2014-05-29 Thread Chris Angelico
On Thu, May 29, 2014 at 10:31 AM, Wiktor wrote: > I see few scenarios: > > 1) I'm trying to contact with original script's author, and send him my > propositions of changes in code. (Oh, one more thing: my code isn't > backward compatible, and I don't know Py2 that much to include all those > try/

Re: Python 3 is killing Python

2014-05-29 Thread Terry Reedy
On 5/29/2014 12:03 AM, Steven D'Aprano wrote: On Wed, 28 May 2014 20:41:53 -0400, Terry Reedy wrote: Claim: Another great strength of Python 2 was that programs written in it would almost always run on the next version of Python without much alteration. True. True, but only because of the we