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.

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 programmi

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. >> >>

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: 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 p

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 St

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
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 py

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 withi

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. > I

Re: ftp recursively

2008-03-19 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 tak

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 >>

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. http

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 p

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 [] >>> >>

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: 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 g

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 in

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 Pyt

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: 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: Missing PyObject definition

2008-03-17 Thread Jeff Schwab
James Whetstone wrote: > I'm trying to access a PyObject directly from C++ for the purpose of calling > method on a Python object that is an intance of a derived C++ class. My > problem is that the compiler is complaining about not PyObject not being > defined. Has anyone run into the problem?

Re: python-list Metaquestion

2008-03-17 Thread Jeff Schwab
Tom Stambaugh wrote: > I continue to receive emails, addressed to [EMAIL PROTECTED], > with subject: "Re: Your message to Python-list awaits moderator approval", > which read: > >> Your mail to 'Python-list' with the subject >> >>(no subject) >> >> Is being held until the list moderator can

Re: String To List

2008-03-17 Thread Jeff Schwab
Girish wrote: > I have a string a = "['xyz', 'abc']".. I would like to convert it to a > list with elements 'xyz' and 'abc'. Is there any simple solution for > this?? Do you want: (1) Specifically to vivify lists formatted as in your example? If so, why? (2) To save and restore arbitrary python

Re: Types, Cython, program readability

2008-03-16 Thread Jeff Schwab
Ben Finney wrote: > sturlamolden <[EMAIL PROTECTED]> writes: > >> If you don't know how to install a C compiler like Microsoft Visual >> Studio, you should not be programming computers anyway. > > Utter elitist nonsense. > > Programming should be made easier, and I see Python as a very good > la

Re: Joseph Weizenbaum

2008-03-15 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Tim Roberts <[EMAIL PROTECTED]> wrote: >> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>> Roel Schroeven wrote: >>>> [EMAIL PROTECTED] schreef: >>>>> On Mar 14, 1:47 pm, "Reedick, And

Re: Joseph Weizenbaum

2008-03-14 Thread Jeff Schwab
Roel Schroeven wrote: > [EMAIL PROTECTED] schreef: >> On Mar 14, 1:47 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: Subject: RIP: Joseph Weizenbaum Creator of Eliza: http://www-tech.mit.edu/V128/N12/weizenbaum.html -- >>> How do you feel about creator of Eliza? >> >> What is

Re: Need Script For read multiple files(.txt) from a folder

2008-03-14 Thread Jeff Schwab
Chris wrote: > On Mar 14, 8:36 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Thu, 13 Mar 2008 21:28:18 -0700 (PDT), jai_python >> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: >> >>> hi frenz I Need a Python Script For read multiple files(.txt) from a >>> folder and wri

Re: Is there Python equivalent to Perl BEGIN{} block?

2008-03-13 Thread Jeff Schwab
Paddy wrote: > On Mar 13, 7:03 pm, Jonathan Gardner <[EMAIL PROTECTED]> > wrote: >> On Mar 12, 6:37 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > > <> >> And leave out the magical -p and -n. If you want to iterate through a >> file, "for line in sys.stdin:". > > Or better still: > > import fil

Re: How to port Python code into C++ code automatically?

2008-03-12 Thread Jeff Schwab
Bo wrote: > I want to port a Python project (about 10,000 line python code) to C+ > +. Is there any automatically tool to do this kind of things? e.g., That's not trivial. Python is very heavily oriented toward run-time processing, whereas C++ favors compile-time processing. > e.g., SWIG(http:/

Re: Is there Python equivalent to Perl BEGIN{} block?

2008-03-12 Thread Jeff Schwab
Alex wrote: > The subject says pretty much all, i would very appreciate an answer. I > tried to search the various forums and groups, but didn't find any > specific answer... I'd like an answer to this, too. In Perl, I mostly used it for one-liners, when a variable needed to be initialized to s

Re: Distributed App - C++ with Python for Portability?

2008-03-11 Thread Jeff Schwab
Roopan wrote: > I assume the C++/Python binding is fairly painless. http://www.boost.org/libs/python/doc/tutorial/doc/html/index.html A. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding coding style

2008-03-07 Thread Jeff Schwab
K Viltersten wrote: > I've been recommended reading of: > http://www.python.org/dev/peps/pep-0008/ > and in there i saw two things that i need to get elaborated. > > > 1. When writing English, Strunk and White apply. > > Where can i download it? Am i actually > expected to read the whole book?

Re: OT[1]: Re: SV: Polymorphism using constructors

2008-03-05 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Wed, 05 Mar 2008 08:26:04 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Which is which? Aren't those both part of the space vehicle? Btw, do >> you work for government or industry?

OT[1]: Re: SV: Polymorphism using constructors

2008-03-05 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Tue, 4 Mar 2008 20:06:38 -0500, Tommy Grav <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > >> SV = "Svar" is the Norwegian word for Reply. >> > Ah, good... In my working life, "SV" => "Space Vehicle", often used > to differentiate between th

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
Tommy Grav wrote: > > On Mar 4, 2008, at 4:53 PM, Jeff Schwab wrote: > >> What does "SV" in the subject mean? > > SV = "Svar" is the Norwegian word for Reply. Thanks. Serves me right for not speaking Norwegian. -- http://mail.python.org/mailman/listinfo/python-list

Re: SV: Polymorphism using constructors

2008-03-04 Thread Jeff Schwab
What does "SV" in the subject mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > is there a better way of creating d?? a = [[0] * 3 for dummy in xrange(3)] >> Each element of a refers to a distinct array. >> >>> Why not simply [[0]*3]*3 ? >> All three elements of the result refer to the same array. > > ... whereas you reassign all three elem

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> Better yet, how hard would it be to define an otherwise int-like type >> that did not define a non-flooring division operator? Are there any >> real use cases for such a type? > > User defined types

Re: First post from a Python newbiw

2008-03-02 Thread Jeff Schwab
Christoph Zwerschke wrote: > Marc 'BlackJack' Rintsch schrieb: >> On Sun, 02 Mar 2008 14:15:09 +, Steve Turner wrote: >> >>> Apart from doing something like >>> a=[0,0,0] >>> b=[0,0,0] >>> c=[0,0,0] >>> d=[a,b,c] >>> >>> is there a better way of creating d?? >> >> a = [[0] * 3 for dummy in xran

Re: Book Recomendations

2008-03-02 Thread Jeff Schwab
> Ira Solomon wrote: >> I am an experienced programmer (40 years) . . . >> I'm interested in learning Python > js wrote: >> I wonder why nobody mension Python Cookbook yet . . . >> and Python Standard Library Because cookbooks are not supposed to be language introductions. They are collec

Re: How about adding rational fraction to Python?

2008-03-02 Thread Jeff Schwab
Paul Rubin wrote: > I can live with int/int=float but > find it sloppy and would be happier if int/int always threw an error > (convert explicitly if you want a particular type result). Better yet, how hard would it be to define an otherwise int-like type that did not define a non-flooring divisi

Re: Book Recomendations

2008-03-01 Thread Jeff Schwab
Ira Solomon wrote: > I am an experienced programmer (40 years). I've done Algol (if you've > heard of that you must be old too), PL/1, VB,VBA, a little C, and a > few other odd languages (e.g. Taskmate). > I'm interested in learning Python and have downloaded a slew of books. > Too many. > I'd lik

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Benoit wrote: > Forgive my language concerning C++ as its turned the thread into > something I did not intend. I merely wished to point out that Python > was easier for me to learn than C++. To Schwab, its likely that Mark > Lutz is simply a better instructor than my professor. Sorry for hijackin

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Thu, 28 Feb 2008 10:34:45 -0800, Jeff Schwab wrote: > >>> Hey a flame bait. I'll bite. >> Excuse me? Somebody posts about an introductory course on C++ covering >> "dynamic arrays using pointers" and lite

Re: Pythons & Ladders

2008-02-28 Thread Jeff Schwab
Marc 'BlackJack' Rintsch wrote: > On Wed, 27 Feb 2008 19:18:27 -0800, Jeff Schwab wrote: > >> Benoit wrote: >>> I've been teaching myself the python language over the past few months >>> using Mark Lutz' Learning Python, 3ed. Python is also the

Re: Pythons & Ladders

2008-02-27 Thread Jeff Schwab
Benoit wrote: > I've been teaching myself the python language over the past few months > using Mark Lutz' Learning Python, 3ed. Python is also the first > programming language I've ever taken up. I find the language easy to > learn and rather productive in relation to the introductory course on C

Re: Article of interest: Python pros/cons for the enterprise

2008-02-27 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Carl Banks <[EMAIL PROTECTED]> wrote: >> On Feb 24, 7:03 pm, [EMAIL PROTECTED] (Aahz) wrote: >>> In article <[EMAIL PROTECTED]>, >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> (3)

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Mark Dickinson wrote: > On Feb 26, 9:00 pm, Paul Rubin wrote: >> Certainly, I'd expect that if x and y are both integers and x is an >> exact multiple of y, then x/y will be computable and not overflow. >> But try computing 10**5000 / 10**4000 under future division (that

Re: Adobe CS3

2008-02-26 Thread Jeff Schwab
D'Arcy J.M. Cain wrote: > On Tue, 26 Feb 2008 12:58:53 -0800 > Tobiah <[EMAIL PROTECTED]> wrote: >>> A: Because it messes up the order in which people normally read text. >>> Q: Why is top-posting such a bad thing? >> But then again, when just adding a quip to a long thread in which >> the readers

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:42 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: ... >>>>> th1 th2 >>>>> set cmd >>>>> run cmd >>>>> get result >>>>> acknowledge >>>&g

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Grant Edwards wrote: > On 2008-02-26, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Grant Edwards wrote: >> >>> I guess it must depend on where you went to shool. >> Temple Israel. You? > > Good one. :) I make a lot of typo's on Usenet, so I'm

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Paul Rubin wrote: > "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> writes: >>> http://en.wikipedia.org/wiki/Natural_number >> Recheck the context. I was talking about the natural result, not >> natural numbers. > > The natural result of doing arithmetic with natural numbers is more > natural numbers.

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
J. Cliff Dyer wrote: > On Tue, 2008-02-26 at 13:51 -0500, D'Arcy J.M. Cain wrote: >> On Tue, 26 Feb 2008 13:39:38 -0500 >> "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: >> a = 2 * 2 >> b = 20 * 20 >> type(a) >>> >> type(b) >>> >> A long int is still integral which is

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:37 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 12:04 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> On Feb 26, 11:37 am, Jeff

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 12:04 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 11:37 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> [EMAIL PROTECTED] wrote: >>>>> On Feb 26, 10:59 am, Pre

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 11:37 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> On Feb 26, 10:59 am, Preston Landers <[EMAIL PROTECTED]> wrote: >>>> On Feb 26, 1:45 am, [EMAIL PROTECTED] wrote: >>>>>

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
Grant Edwards wrote: > I guess it must depend on where you went to shool. Temple Israel. You? -- http://mail.python.org/mailman/listinfo/python-list

Re: is there enough information?

2008-02-26 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 26, 10:59 am, Preston Landers <[EMAIL PROTECTED]> wrote: >> On Feb 26, 1:45 am, [EMAIL PROTECTED] wrote: >> >>> Two options occurred to me, which the first showed up in the earlier >>> extremely skeletal and cryptic post: >> Perhaps you would be more likely to get

Re: Reading a keypress

2008-02-26 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 17:48:21 -0800, Jeff Schwab <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: >> What about curses? >> >> http://docs.python.org/lib/module-curses.html >> http://adamv.com/dev/python/curses/ >

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Jeff Schwab
Jeff Schwab wrote: > Nicola Musatti wrote: >> On Feb 24, 5:25 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> writes: >>>>> there's actually a published book specifically about C++ pitfalls. >>>

Re: Article of interest: Python pros/cons for the enterprise

2008-02-26 Thread Jeff Schwab
Nicola Musatti wrote: > On Feb 24, 5:25 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: >> Jeff Schwab <[EMAIL PROTECTED]> writes: >>>> there's actually a published book specifically about C++ pitfalls. >>> Mercy, a whole book? >> http://sea

Re: How about adding rational fraction to Python?

2008-02-26 Thread Jeff Schwab
J. Cliff Dyer wrote: > On Tue, 2008-02-26 at 04:29 -0800, Lie wrote: >>> J Cliff Dyer: >>> I'm in the camp that believes that 3/4 does indeed yield the integer >> 0, >>> but should be spelled 3//4 when that is the intention. >> That's creepy for people that are new to programming and doesn't know >

Re: Reading a keypress

2008-02-25 Thread Jeff Schwab
Dennis Lee Bieber wrote: > On Mon, 25 Feb 2008 10:35:54 -0800 (PST), wyleu > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> I'm trying to read a single keypress on Linux but expect to have the >> programme running on Windows platform as well and find the mention in >> the

Re: object identity and hashing

2008-02-25 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On Feb 24, 9:28 pm, George Sakkis <[EMAIL PROTECTED]> wrote: >> >> [1]http://www.martinfowler.com/eaaCatalog/identityMap.html > > [1] illustrates a case in which 'a is a' returns False, and in the > other corner of the DeMorgan table, there is 'a is b' returns True for >

Re: object identity and hashing

2008-02-24 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > Can someone explain this? > a= {} Create an empty dict and bind it to the name a. a[(3,)]= 0 Set the key/value pair (3,):0 to the dict. (3,) in a Is (3,) one of the keys in the dict? > True Yes, it is. (3,) is (3,) Create two separate tuples

Re: Create multiple directories

2008-02-24 Thread Jeff Schwab
Paul Lemelle wrote: > I am somewhat new to Python and I am trying to create a program that > automatically creates directories from a range of numbers. I > researched the os.mkdir & os.makedirs methods, but they do not seem to > (I don't know) how to include an argumnet to step through my list. >

Re: Article of interest: Python pros/cons for the enterprise

2008-02-24 Thread Jeff Schwab
Larry Bugbee wrote: > And the migration to Python is due in large part because of an > additional factor of 3-4x in personal productivity (over Java). > Improvements in runtime performance wouldn't hurt, but for many > applications that's not an issue. (If optional data typing were You mean stat

Re: Article of interest: Python pros/cons for the enterprise

2008-02-24 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Matthew Woodcraft wrote: >>> I see. Then, unless you don't care about data loss passing silently, >>> this 'most traditional' way to open a file is unsuitable for files >>

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >>> there's actually a published book specifically about C++ pitfalls. >> Mercy, a whole book? > > http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?EAN=9780201179286 > >>> C

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> One great thing about C is that >> a programmer can realistically hope to know the entire language >> definition; maybe Guido would like the same to be true of Python. > > C is horrendously complicate

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> So to use the Perl example: If you want to sort a list using some >> arbitrary snippet of code as the comparison function, you can write: >> sort { code to compare $a and $b } @elements > > Yes, y

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Matthew Woodcraft wrote: >>> Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> The most traditional, easiest way to open a file in C++ is to use an >>>> fstream object, s

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > "Terry Reedy" <[EMAIL PROTECTED]> writes: >> | Yes, this seems to be the Python way: For each popular feature of some >> | other language, create a less flexible Python feature that achieves the >> | same effect in the most common cases (e.g. lambda to imitate function >> | lit

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Terry Reedy wrote: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > [snip discussion of 'with' statements] > > | Yes, this seems to be the Python way: For each popular feature of some > | other language, create a le

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Matthew Woodcraft wrote: > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the fstream >> goes out of scope. > > Out of interest, what

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Carl Banks wrote: > On Feb 23, 6:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Recently, I've had a few replies in tones that imply I'm on the brink of >> entering several kill-files, mostly because I express disagreement with >> a few closely held belief

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Arnaud Delobelle wrote: > On Feb 23, 3:44 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> actions = ( >> ('some_string', do_something), >> ('other_string', do_other_thing)) >> >> def find

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Paul Rubin wrote: > Jeff Schwab <[EMAIL PROTECTED]> writes: >> The most traditional, easiest way to open a file in C++ is to use an >> fstream object, so the file is guaranteed to be closed when the >> fstream goes out of scope. > > Python has this too, except i

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
Jeff Schwab wrote: > mrstephengross wrote: >> Hi all. In C, an assignment statement returns the value assigned. For >> instance: >> >> int x >> int y = (x = 3) >> >> In the above example, (x=3) returns 3, which is assigned to y. >> >&g

Re: Return value of an assignment statement?

2008-02-23 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: >> What you can't do (that I really miss) is have a tree of assign-and-test >> expressions: >> >> import re >> pat = re.compile('some pattern') >> >> if m = pat.match(some_string): >> do_something(m) >> else if m = pat.match(other

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Ryan Ginstrom wrote: >> On Behalf Of Jeff Schwab >> When I see this silliness again and again, it really breaks >> my heart > > If you allow your heart to be broken by others' opinions, you're setting > yourself up for a lot of disappointment IMHO. It'

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
George Sakkis wrote: > On Feb 22, 2:15 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >> Nicola Musatti wrote: >>> The real sad thing is that nobody is likely to convince Guido to turn >>> CPython into C++Python ;-) >> How difficult would that be? Could it

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Jeff Schwab
Bruno Desthuilliers wrote: > Jeff Schwab a écrit : >> Bruno Desthuilliers wrote: >>> Carl Banks a écrit : >>>> On Feb 20, 8:58 am, Tim Chase <[EMAIL PROTECTED]> wrote: >>>>>> You Used Python to Write WHAT? >>>>>> http

Re: Equivalent of system()?

2008-02-22 Thread Jeff Schwab
Max wrote: > Is there a Python equivalent of C++'s system()? More or less. You probably want subprocess.Popen: >>> import subprocess >>> subprocess.Popen("echo hello", shell=True) hello http://docs.python.org/lib/node533.html#CHILD_LINKS -- http://mail.python.org/mailman/listinfo/python-lis

Re: Return value of an assignment statement?

2008-02-22 Thread Jeff Schwab
George Sakkis wrote: > On Feb 22, 12:26 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > >>> On the other hand, "a = b" does always the same thing; unlike C++, '=' >>> is not an operator and therefore it cannot be overriden by the class >>> o

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Jeff Schwab
Carl Banks wrote: > On Feb 22, 12:23 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >>>> Carl Banks wrote: >>>>> On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PR

Re: Article of interest: Python pros/cons for the enterprise

2008-02-22 Thread Jeff Schwab
Nicola Musatti wrote: > The real sad thing is that nobody is likely to convince Guido to turn > CPython into C++Python ;-) How difficult would that be? Could it be done in stages? I would be willing to spend some time on that kind of project. Since I know almost nothing about Python internal

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Jeff Schwab <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> There's nothing like a variable "storing" anything in Python. All you >>> have are names to (references to) objects bi

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
George Sakkis wrote: > On Feb 21, 7:21 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Steve Holden wrote: >>> Jeff Schwab wrote: >>>> [EMAIL PROTECTED] wrote: >>> [...] >>>>> Now there's no reason to feel nervous about this. All you

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: > On Feb 21, 7:17 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> Carl Banks wrote: >>> On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: >>>> There are other downsides to garbage collection, as the fact that it >>>>

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: > mrstephengross wrote: >>> What you can't do (that I really miss) is have a tree of assign-and-test >>> expressions: >>> import re >>> pat = re.compile('some pattern') >>> if m = pat.match(some_string): >>> do_something(m) >> >> Yep, this is

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: > Jeff Schwab wrote: >> [EMAIL PROTECTED] wrote: > [...] >>> Now there's no reason to feel nervous about this. All you have to >>> remember is that Python never copy anything unless explicitely asked >>> for. >> >> It

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On 21 fév, 23:06, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> John Henry wrote: >>> On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]> wrote: >>>> On Feb 21, 1:43 pm, mrstephengross <[EMAIL PROTECTED]> wrote: >>>&

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Terry Reedy wrote: > "Jeff Schwab" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > | That's the same behavior I would expect in C, on the grounds that C > | What I found confusing at first was > | that the same variable will eith

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: > On Feb 21, 1:22 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: >> There are other downsides to garbage collection, as the fact that it >> makes it harder to implement the Resource Acquisition Is >> Initialization idiom, due to the lack of deterministic destruction. > > That's no

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: > On 21 fév, 23:19, John Henry <[EMAIL PROTECTED]> wrote: >> On Feb 21, 2:06 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: >> >> >> >>> John Henry wrote: >>>> On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]>

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: >> What you can't do (that I really miss) is have a tree of assign-and-test >> expressions: >> import re >> pat = re.compile('some pattern') >> if m = pat.match(some_string): >> do_something(m) > > Yep, this is exactly what I am (was) tryin

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
John Henry wrote: > On Feb 21, 1:48 pm, John Henry <[EMAIL PROTECTED]> wrote: >> On Feb 21, 1:43 pm, mrstephengross <[EMAIL PROTECTED]> wrote: >> >> >> >>> Hi all. In C, an assignment statement returns the value assigned. For >>> instance: >>> int x >>> int y = (x = 3) >>> In the above example,

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: > Hi all. In C, an assignment statement returns the value assigned. For > instance: > > int x > int y = (x = 3) > > In the above example, (x=3) returns 3, which is assigned to y. > > In python, as far as I can tell, assignment statements don't return > anything: > >

  1   2   3   >