Re: questions about named pipe objects...

2008-03-17 Thread Jeff Schwab
waltbrad wrote: I'm proceeding slowly though the Lutz book Programming Python. I'm in the section on named pipes. The script he uses has two functions: one for the child the other for the parent. You start the parent then the child: python pipefifo.py #starts the parent file

Re: Interesting math problem

2008-03-17 Thread Jeff Schwab
BJörn Lindqvist wrote: Here is an interesting math problem: You have a number X 0 and another number Y 0. The goal is to divide X into a list with length Y. Each item in the list is an integer. The sum of all integers is X. Each integer is either A or A + 1, those should be evenly

Re: About reading Python code

2008-03-17 Thread Jeff Schwab
sturlamolden wrote: On 17 Mar, 04:54, WaterWalk [EMAIL PROTECTED] wrote: So I'm curious how to read code effectively. I agree that python code is clear, but when it becomes long, reading it can still be a hard work. First, I recommend that you write readable code! Don't use Python as if

Re: Interesting math problem

2008-03-17 Thread Jeff Schwab
Arnaud Delobelle wrote: On Mar 17, 10:24 pm, BJörn Lindqvist [EMAIL PROTECTED] wrote: Here is an interesting math problem: You have a number X 0 and another number Y 0. The goal is to divide X into a list with length Y. Each item in the list is an integer. The sum of all integers is X.

Re: Any fancy grep utility replacements out there?

2008-03-17 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: So I need to recursively grep a bunch of gzipped files. This can't be easily done with grep, rgrep or zgrep. (I'm sure given the right pipeline including using the find command it could be donebut seems like a hassle). So I figured I'd find a fancy next

Re: First Program Bug (Newbie)

2008-03-17 Thread Jeff Schwab
Benjamin Serrato wrote: P.S. What is the chance I'll get spam for using my real email address? Fendi Chef Bag in Zucca Print - Black Trim Replica AAA, Fake HandBags Cheap Chef Bag in Zucca Print - Black Trim Bags Link : http://www.cnreplicas.com/Fendi_1439.html Chef Bag in Zucca Print - Black

Re: Interesting math problem

2008-03-18 Thread Jeff Schwab
Marc Christiansen wrote: sturlamolden [EMAIL PROTECTED] wrote: On 18 Mar, 00:58, Jeff Schwab [EMAIL PROTECTED] wrote: def make_slope(distance, parts): if parts == 0: return [] q, r = divmod(distance, parts) if r and parts % r: q += 1 return [q

Re: PyCon Feedback and Volunteers (Re: Pycon disappointment)

2008-03-18 Thread Jeff Schwab
Mike Driscoll wrote: On Mar 18, 1:41 pm, fumanchu [EMAIL PROTECTED] wrote: On Mar 17, 6:25 pm, dundeemt [EMAIL PROTECTED] wrote: I agree - the balance wasn't as good. We can all agree that HowTos and Intros are a necessary part of the conference talks track, but as Robert pointed out some

ftp recursively

2008-03-18 Thread Jeff Schwab
I need to move a directory tree (~9GB) from one machine to another on the same LAN. What's the best (briefest and most portable) way to do this in Python? I see that urllib has some support for getting files by FTP, but that it has some trouble distinguishing files from directories.

Re: ftp recursively

2008-03-18 Thread Jeff Schwab
Gabriel Genellina wrote: En Tue, 18 Mar 2008 18:25:28 -0300, Jeff Schwab [EMAIL PROTECTED] escribió: I need to move a directory tree (~9GB) from one machine to another on the same LAN. What's the best (briefest and most portable) way to do this in Python? See Tools/scripts/ftpmirror.py

Re: ftp recursively

2008-03-20 Thread Jeff Schwab
Paul Rubin wrote: Jeff Schwab [EMAIL PROTECTED] writes: ftping it as a flat file, and untarring it on the other side. Of course, the motivation wasn't just to get the files from point A to point B using Unix (which I already know how to do), but to take advantage of an opportunity to learn

Re: Change user on UNIX

2008-03-20 Thread Jeff Schwab
Jonathan Gardner wrote: On Mar 20, 4:51 am, Giampaolo Rodola' [EMAIL PROTECTED] wrote: Is there any way to su or login as a different user within a python script? I mainly need to temporarily impersonate another user to execute a command and then come back to the original user. In the unix

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Grant Edwards wrote: On 2008-03-20, jmDesktop [EMAIL PROTECTED] wrote: Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the command prompt and type pythong myprog.py, it works. Can the program be run from within the

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
jmDesktop wrote: On Mar 20, 11:21 am, Grant Edwards [EMAIL PROTECTED] wrote: On 2008-03-20, jmDesktop [EMAIL PROTECTED] wrote: Hi, I'm trying to learn Python. I using Aquamac an emac implementation with mac os x. I have a program. If I go to the command prompt and type pythong myprog.py,

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Paulo da Costa wrote: People who say Emacs often mean GNU Emacs. That's funny; to me, Emacs usually means XEmacs. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I run a python program from within emacs?

2008-03-20 Thread Jeff Schwab
Grant Edwards wrote: On 2008-03-20, Jeff Schwab [EMAIL PROTECTED] wrote: http://www.google.com/search?q=emacs+python Gee. Thanks. I believe Grant was suggesting that Emacs often serves a similar purpose on Unix to what Visual Studio does on Windows, which seemed to be what you were

Re: List question

2008-03-22 Thread Jeff Schwab
Zentrader wrote: On Mar 22, 10:07 am, Arnaud Delobelle [EMAIL PROTECTED] wrote: On Mar 22, 4:38 pm, Zentrader [EMAIL PROTECTED] wrote: if ('one', 'two') are in f: ... are gives me an error in Python 2.5 with a from future import * statement included. What version and platform are you

Re: Do any of you recommend Python as a first programming language?

2008-03-22 Thread Jeff Schwab
jmDesktop wrote: For students 9th - 12th grade, with at least Algebra I. Do you think Python is a good first programming language for someone with zero programming experience? Using Linux and Python for first exposure to programming languages and principles. Linux and Python are a nearly

Re: Do any of you recommend Python as a first programming language?

2008-03-22 Thread Jeff Schwab
Larry Bates wrote: jmDesktop wrote: For students 9th - 12th grade, with at least Algebra I. Do you think Python is a good first programming language for someone with zero programming experience? Using Linux and Python for first exposure to programming languages and principles. Thank you.

Re: Do any of you recommend Python as a first programming language?

2008-03-22 Thread Jeff Schwab
Arnaud Delobelle wrote: Anyway, here the conclusion that I draw: learn lambda-calculus and Turing machines. The rest is syntactic sugar. How is the lambda-calculus fundamentally different from Turing machine-based implementations? I've been learning a fair amount about functional

Re: Does anyone else use this little idiom?

2008-02-02 Thread Jeff Schwab
How [EMAIL PROTECTED] wrote: Ruby has a neat little convenience when writing loops where you don't care about the loop index: you just do n.times do { ... some code ... } where n is an integer representing how many times you want to execute some code. In Python, the direct translation of

Re: DOS or not? [was Re: How to tell Script to use pythonw.exe ?]

2013-07-03 Thread Jeff Schwab
On 2013-07-03 13:19:26 +, Steven D'Aprano said: On Wed, 03 Jul 2013 14:00:49 +0100, Tim Golden wrote: Goodness, I doubt if you'll find anyone who can seriously make a case that the Windows command prompt is all it might be. I'm not a Powershell user myself but people speak highly of it.

<    1   2   3