os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Tony Meyer
On Windows, if I do os.rename(old, new) where old is a file that is in-use (e.g. python itself, or a dll that is loaded), I would expect that an error would be raised (e.g. as when os.remove is called with an in-use file). However, what happens is that a copy of the file is made, and the old file

Re: os.rename copies when old is in-use - is this deliberate?

2005-12-03 Thread Tony Meyer
[Tony Meyer] >> Is this the intended behaviour? > [Martin v. Löwis] > Sort-of. os.rename invokes the C library's rename, and does whatever > this does. It is expected that most platform's C libraries do what > the documentation says rename does, but platforms may vary

Re: Function to retrieve running script

2005-12-03 Thread Mike Meyer
"Harlin Seritt" <[EMAIL PROTECTED]> writes: > Is there a function that allows one to get the name of the same script > running returned as a string? The questions a little ambiguous, but one answer might be: import sys myname = sys.argv[0] http://www.mired.org/home/mwm/

Re: regexp non-greedy matching bug?

2005-12-03 Thread Mike Meyer
John Hazen <[EMAIL PROTECTED]> writes: > I want to match one or two instances of a pattern in a string. Then you should be using the split() method of the match object on the pattern in question. > According to the docs for the 're' module > ( http://python.org/doc/current/lib/re-syntax.html ) t

Re: Checking length of each argument - seems like I'm fighting Python

2005-12-03 Thread Mike Meyer
"Brendan" <[EMAIL PROTECTED]> writes: > There must be an easy way to do this: Not necessarily. > For classes that contain very simple data tables, I like to do > something like this: > > class Things(Object): > def __init__(self, x, y, z): > #assert that x, y, and z have the same leng

Re: regexp non-greedy matching bug?

2005-12-04 Thread Mike Meyer
John Hazen <[EMAIL PROTECTED]> writes: >> To do what you said you want to do, you want to use the split method: >> >> foo = re.compile('foo') >> if 2 <= len(foo.split(s)) <= 3: >>print "We had one or two 'foo's" > > Well, this would solve my dumbed down example, but each foo in the > original

Re: regexp non-greedy matching bug?

2005-12-04 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> ^ must match the beginning of the string (BTW, you can get the same >> behavior by leaving off the ^ and using search instead of match). > that's backwards, isn't it? using ^ with ma

Re: Detect character encoding

2005-12-04 Thread Mike Meyer
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Michal wrote: >> is there any way how to detect string encoding in Python? >> I need to proccess several files. Each of them could be encoded in >> different charset (iso-8859-2, cp1250, etc). I want to detect it, >> and encode it to utf-8 (with stri

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-04 Thread Mike Meyer
Benji York <[EMAIL PROTECTED]> writes: >> See, I can make up bizarre scenarios where spaces cause >> problems, too. > Only if you don't know how decent editors behave. :) But the same is also true of tabs causing problems :-). http://www.mired.org/home/mwm/ Independent

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread Tony Meyer
>> Among the treasures available in The Wiki is the current >> copy of "the Sorting min-howto": >> http://www.amk.ca/python/howto/sorting/sorting.html > > Why is this a "treasure" when it is way out of date? Note that the updated version of this is at: http://wiki.python.org/ moin

Re: Favorite flavor of Linux? (for python or anything else)

2005-12-04 Thread Mike Meyer
"Brett Hoerner" <[EMAIL PROTECTED]> writes: > I have to add another vote for Gentoo. I agree that you just "have > less problems" on Gentoo. Updates are from source, Gentoo is one of my favorite Linux distributions - because it's the the most like a BSD distribution, except not as mature. A lot

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread Tony Meyer
Among the treasures available in The Wiki is the current copy of "the Sorting min-howto": http://www.amk.ca/python/howto/sorting/sorting.html >>> >>> Why is this a "treasure" when it is way out of date? >> >> Note that the updated version of this is at: http://wiki.py

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-04 Thread Tony Meyer
>> It's "site:", but even if you just left that out and used >> 'wiki.python.org sorting "how to"', the first link is the one you're >> after. Laziness is no excuse. > > You miss my point. Having outdated documentaion distributed > with Python is the problem. Have some newer stuff out on some >

Re: Bitching about the documentation...

2005-12-04 Thread Tony Meyer
> But, the standard responce of "don't complain, fix it yourself" is > bogus too. There are plenty of people on this list willing to sing > python's > praises, for balance, there should be people willing to openly > point out > python's flaws. This makes no sense. If you want to complain abo

Re: Favorite flavor of Linux? (for python or anything else)

2005-12-05 Thread Mike Meyer
You know, without some context, it's hard to say what you're replying to. "malv" <[EMAIL PROTECTED]> writes: > Any popular distro would. No one is really superior from this angle. Assuming you mean would "come with nearly jeverything installed", I'd have to disagree. Distros that are popular with

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 2)

2005-12-05 Thread Tony Meyer
> Well, I was running Python-2.4.1 so I upgraded to 2.4.2 and guess > what? The docs still reference the old Howto. Perhaps you meant > to say "will be fixed in 2.5" rather than "has been fixed"? No, I meant has been fixed. A fixed version hasn't been released, but that doesn't make it any le

Re: Binary representation of floating point numbers

2005-12-06 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hi, > I'm using python to run some lab equipment using PyVisa. When I read a > list of values from the equipment, one of the fields is 32 bits of > flags, but the value is returned as a floating point number, either in > ASCII format, or pure binary. Value returned by

Re: Binary representation of floating point numbers

2005-12-06 Thread Mike Meyer
[EMAIL PROTECTED] writes: > In float mode, the instrument returns a sequence of bits that are > exactly the ieee754 number in the case of floats, or just the flags in > the case of flags. PyVisa, when set to float mode, will convert > everything to float, because it is unaware apriori that one of

Re: Bitching about the documentation...

2005-12-07 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: >> Er... no, I can't parse that. I suffered a Too Much Recursion error about >> the third Badger (I only have a limited runtime stack). I always loved the demonstration that English requires backtracking: "The old man the ship." h

Re: ElementTree - Why not part of the core?

2005-12-07 Thread Mike Meyer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > as I've said many times, if the Linux folks can build distributions that con- > sists of thousands of individually maintained pieces, the Python distributors > should be able to handle a few dozen components. Yes, but "distributers" is not necessarily

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
"ex_ottoyuhr" <[EMAIL PROTECTED]> writes: > I'm trying to create a function that can take arguments, say, foo and > bar, and modify the original copies of foo and bar as well as its local > versions -- the equivalent of C++ funct(&foo, &bar). C++'s '&' causes an argument to be passed by reference.

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> > I'm trying to create a function that can take arguments, say, foo and >> > bar, and modify the original copies of foo and bar as well as its local >>

Re: Another newbie question

2005-12-07 Thread Mike Meyer
"solaris_1234" <[EMAIL PROTECTED]> writes: > 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems > awkward. Is there another way (cleaner, more intuitive) to get the > same thing done? Yes. Reaching through objects to do things is usually a bad idea. Some languages don't allow you

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> > Mike Meyer wrote: >> >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> >> > I'm trying to create a function that can take arguments, say, foo and >>

Re: efficient 'tail' implementation

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I have a file which is very large eg over 200Mb , and i am going to use > python to code a "tail" > command to get the last few lines of the file. What is a good algorithm > for this type of task in python for very big files? > Initially, i thought of reading everything

Re: Mutability of function arguments?

2005-12-07 Thread Mike Meyer
[EMAIL PROTECTED] writes: >> Except "trick" is a poor word choice. Nobody is playing a trick on >> them - they just don't understand what is going on. > oops, never thought about the negative meaning of it, it is just meant > as "not behave as expected", what would be the word you use then ? Surp

Re: Mutability of function arguments?

2005-12-08 Thread Mike Meyer
Kent Johnson <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> "ex_ottoyuhr" <[EMAIL PROTECTED]> writes: >> >>>I'm trying to create a function that can take arguments, say, foo and >>>bar, and modify the original copies of foo and

Re: Dynamically add Class to Modules

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > So: Does anyone know how dynamically generate a class, and add it to a > "module" that is already in memory? How about adding a step: generate your class to a file import the file as a module. bind a name in "module" to the class in the imported module.

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: >> "solaris_1234" <[EMAIL PROTECTED]> writes: >>> 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >>> awkward. Is

Re: Documentation suggestions

2005-12-08 Thread Mike Meyer
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > Too bad there > isn't something like what Ruby does with the "Try Ruby In Your Browser" > thing, which is a very effective marketing tool (although obviously I > chose Python). > > http://tryruby.hobix.com/ I've seen things like this for other lang

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: Yes. Reaching through objects to do things is usually a bad idea. >>>I don't necessarily disagree, but I don't understand why you say this. Why >>>it is bad? >> The traditional OOP sp

Re: Another newbie question

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> My standard object interface is modeled after Meyer's presentation in >> OOSC: an objects state is manipulated with methods and examined with >> attributes; manipulating attrib

Re: pyparsing and LaTeX?

2005-12-09 Thread Mike Meyer
"Tim Arnold" <[EMAIL PROTECTED]> writes: > For now I'm working on a tag translator to convert from one LaTeX tagset to > another, which is a pretty simple task compared to writing a full parser > like pyLaTeX > http://pylatex.sourceforge.net/ You might check out the LyX project. They use python

Re: Another newbie question

2005-12-09 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> for an object, and methods are the knobs/dials/etc. This also ties in >> with the compiler having facilities to check class invariants. If you >> allow assignments to attributes in oth

Re: Documentation suggestions

2005-12-09 Thread Mike Meyer
Trent Mick <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote] >> Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather >> Trent> than running an actually Ruby interactive session ("bastion'ed" >> Trent> or not). >> I don't think so. I tried typing some stuff at the

Re: Proposal: Inline Import

2005-12-09 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Here's a heretical idea. Not really. > I'd like a way to import modules at the point where I need the > functionality, rather than remember to import ahead of time. This > might eliminate a step in my coding process. Currently, my process is > I chan

Re: Documentation suggestions

2005-12-09 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> I'm working on puttingn this up for Python. I'm planning on using AJAX >> to pass the input string to eval on the server. I.e. - you'll be >> limited to express

Re: Validating an email address

2005-12-09 Thread Mike Meyer
Tom Anderson <[EMAIL PROTECTED]> writes: > On Sat, 10 Dec 2005, Ben Finney wrote: >> Please, don't attempt to "validate" the local-part. It's not up to >> you to decide what the receiving MTA will accept as a local-part, > Absolutely not - it's up to the IETF, and their decision is recorded > in RF

Re: Proposal: Inline Import

2005-12-09 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Xavier Morel wrote: >> Shane Hathaway wrote: >>>Thoughts? >> >>> import re; name_expr = re.compile('[a-zA-Z]+') >> >>> name_expr >> <_sre.SRE_Pattern object at 0x00F9D338> >> >>> >> the import statement can be called anywhere in the code, why would >>

Re: Proposal: Inline Import

2005-12-09 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Shane Hathaway <[EMAIL PROTECTED]> writes: >>>That syntax is verbose and avoided by most coders because of the speed >>>penalty. >> What speed penalty? "import re" is a cheap

Re: Another newbie question

2005-12-09 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> > What classes' invariants do you have to check in those cases? E.g., >> > consider zim.foo.bar.baz() -- you do have to check the invariants of >> > bar, foo AND zim, rig

Re: Another newbie question

2005-12-09 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 08 Dec 2005 20:46:33 -0500, Mike Meyer wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>> Paul Rubin wrote: >>>> Steven D'Aprano <[EMAIL PROTECTED]> writes: >>>>

Re: Proposal: Inline Import

2005-12-10 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Let me fully elaborate the heresy I'm suggesting: I am talking about > inline imports on every other line of code. The obvious > implementation would drop performance by a double digit percentage. No, it wouldn't. The semantics of import pretty much re

Re: Another newbie question

2005-12-10 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: >> In particular, >> you can get most of your meaningless methods out of a properly >> designed Coordinate API. For example, add/sub_x/y_ord can all be >> handled with move(delta_x = 0, delta_y = 0). > > Here is my example again: > > [quote] > Then, somew

Re: Another newbie question

2005-12-10 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >... >> >> it. Nothing you do with zim.foo or zim.foo.bar can change the state of >> >> zim. The only invariants you need to check are bar's, which you do at >> >

Re: The Industry choice

2004-12-31 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > For a not-too-different variety of safety, I like Eiffel. Again, > Eiffel compilers are available nearly, but not entirely, everywhere. Eiffel compilers tend to generate C code, and hence work on anything with a C compiler. The question then becomes ho

Re: Python equivalent of script(1)

2005-01-01 Thread Mike Meyer
[EMAIL PROTECTED] writes: > In my case I wouldn't like to use it as a proof of anything, but I want > to get a script accessing a library system in my school -- it means > many attempts to play with urllib. I would prefer to do it in an > interactive session, but then I would love to have a record

Re: Looping using iterators with fractional values

2005-01-01 Thread Mike Meyer
"drife" <[EMAIL PROTECTED]> writes: > Hello, > > Making the transition from Perl to Python, and have a > question about constructing a loop that uses an iterator > of type float. How does one do this in Python? > > In Perl this construct quite easy: > > for (my $i=0.25; $i<=2.25; $i+=0.25) { > pri

Re: The Industry choice

2005-01-02 Thread Mike Meyer
Bulba! <[EMAIL PROTECTED]> writes: > This "free software" (not so much OSS) notion "but you can > hire programmers to fix it" doesn't really happen in practice, > at least not frequently: because this company/guy remains > ALONE with this technology, the costs are unacceptable. Yes, but fixing p

Re: Developing Commercial Applications in Python

2005-01-03 Thread Mike Meyer
"It's me" <[EMAIL PROTECTED]> writes: > Well, now that they are API based, they can easily add any script language > they so wish through SWIG (www.swig.org). > > Maybe not LISP. SNOBOL would be the right thing to do. (*NOT*) SWIG generates wrappers for GUILE, which is Scheme, which looks enou

Re: Continuations Based Web Framework - Seaside.

2005-01-03 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > It's the *ideas* that are important, though, rather than the > implementation, and my initial hope was to publicise the weakness of > statelessness on the web as applications become more complex. This needed publicity? Isn't it obvious to anyone who has

Re: input record sepArator (equivalent of "$|" of perl)

2005-01-03 Thread Mike Meyer
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes: > [1] through the French "mètre" of course; great job, those > revolutionaries did with the metric system. As Asimov put it, "how many > inches to the mile?" Trivia question: Name the second most powerfull country on earth not using the me

Re: Restore a unified diff

2005-01-05 Thread Mike Meyer
Tim Peters <[EMAIL PROTECTED]> writes: > [Nick Allen] >> Unfortunately, restore does not do the same for unified_diff. I do >> not see any similar function that is intended for unified_diff. Does >> anyone know how to "restore" from a unified diff generated delta? > > That's in general impossibl

Re: is python more popular than coldfusion?

2005-01-05 Thread Mike Meyer
[EMAIL PROTECTED] writes: >>is python more popular than coldfusion? > For your specific purpose of learning a language to get a job, I > suggest visiting the site http://mshiltonj.com/sm/categories/languages/ > , where it appears that Python is mentioned about as often as Fortran > or Ada in job l

Re: smtp question

2005-01-05 Thread Mike Meyer
"Philippe C. Martin" <[EMAIL PROTECTED]> writes: > Hi, > > I am testing the smtp module and have the following question: > > in the code below (taken from net sample) prior to adding the "Subject:" > field, the email client found the "From" and the "To". Without the > "Subject:" field on I get thi

RE: Please Contribute Python Documentation!

2005-01-09 Thread Tony Meyer
> I'm changing the subject so that hopefully people who have > long ago tuned out the "Python evolution: Unease" subject > will read this note. Worked for me :) Two other pages that are probably of use to people interested in this are:

RE: Please Contribute Python Documentation!

2005-01-09 Thread Tony Meyer
> It *is* in the docs now -- see the top of > http://www.python.org/doc/2.4/doc/doc.html Oops. I ought to have checked rather than going by memory (I suppose the last time I looked 2.3 would have been current). Thanks for correcting me! =Tony.Meyer -- http://mail.python.org/mailman/listinfo/p

RE: site.here on python 2.4

2005-01-13 Thread Tony Meyer
> can we assume that, on all platforms, the old site.here is > the same as: > > >>> os.path.join(sys.prefix, 'lib', 'python%s' % sys.version[:3]) > '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3' > > or is it better to use, as you suggest, > > >>> import os > >>> os.

RE: Which is faster?

2005-01-26 Thread Tony Meyer
> Any idea which of the following is faster? > > 'a/b/c/'[:-1] > > or > > 'a/b/c/'.rstrip('/') > > Thanks in advance. > > P.S. I could time it but I thought of trying my luck here > first, in case someone knows already, and of course the reason. Timing it is almost no work, though: >>> impo

RE: gmail access with python!

2005-01-30 Thread Tony Meyer
> i want to write a python program which will grab all my gmail > msgs and store them on my hard drive. [...] > my question is: does anyone have a working script which can > grab msgs from a gmail inbox ? Possibly not of use, but if you're not using POP3 access to your gmail account for anything

RE: getting data from a port in use

2005-01-31 Thread Tony Meyer
> I am trying to use Python to get the data received at a > specific port (in use) on my computer. I already tried below > code which seems to hang at the statement accepting > connections. Seems to hang, or does hang? Using print statements will tell you whether that's where it's getting stuck

RE: getting data from a port in use

2005-02-01 Thread Tony Meyer
>>> I am trying to use Python to get the data received at a >>> specific port (in use) on my computer. I already tried below >>> code which seems to hang at the statement accepting >>> connections. > > Yes. It hangs at accept. I always end up doing end task > because it never passes the "accept"

RE: Where are list methods documented?

2005-02-03 Thread Tony Meyer
> You're not the only one with a hard time finding the list > documentation. It's even crazier for string docs. > > If you want to see how to strip strings in Python you have to go to > the library docs, then click "sequence types" (betcha don't think of > strings as sequences), then scroll to the

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Tue, 14 Jun 2005 16:40:42 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > > >Um, you didn't do the translation right. > > Whoops. > > So you know assembler, no other possibility as it's such > a c

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
Andrew Dalke <[EMAIL PROTECTED]> writes: > Andrea Griffini wrote: > > Wow... I always get surprises from physics. For example I > > thought that no one could drop confutability requirement > > for a theory in an experimental science... > > Some physicists (often mathematical physicists) propose >

Re: What is different with Python ?

2005-06-20 Thread Mike Meyer
"Claudio Grondi" <[EMAIL PROTECTED]> writes: > > What has it all to do with Python? To be not fully off-topic, I > suggest here, that it is much easier to discuss programming > related matters (especially in case of Python :-) or mathematics > than any other subjects related to nature, because pr

Re: extreme newbie

2005-06-21 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > Under Unix it's not all that hard to accidentally create files > like that. Sometimes you have to resort to blasting them away > by i-node number, or by moving the files you want to keep and > then nuking the directory. A standard practice on our early U

Re: extreme newbie

2005-06-21 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 18 Jun 2005 15:00:02 +0200, Renato Ramonda wrote: > Hiding the source code does not make software more secure. Any bugs and > security holes will be there whether the software is distributed in source > code, object code, or something in betwee

Re: A tool for Python - request for some advice

2005-06-22 Thread Mike Meyer
"TPJ" <[EMAIL PROTECTED]> writes: > I've written this script in bash, because I thought it would be better > to have a script which would run in environment without Python (it all > was about installing Python anyway!). I used bash, dialog, wget... And > now someone suggested, that I shuld use Pyt

Re: Getting/Saving email attachments w/ poplib and email modules

2005-06-22 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Hello All, > > Here's what I'm trying to do: > > I need to connect to a pop3 server, download all messages, and copy all > of the attachments into a specific directory. The actual email message > is unimportant. Now, I've found plenty of examples that strip the > at

Looking for a web-based messaging system

2005-06-22 Thread Mike Meyer
One of my clients has a need for a web-based messaging system. Something python-based is preferred, as that's where our expertise is, but web frameworks built in Python are perfectly acceptable. If you know of something really good that isn't in Python, I wouldn't mind hearing about it - but I do h

Re: import search path

2005-06-22 Thread Mike Meyer
"SHELTRAW, DANIEL" <[EMAIL PROTECTED]> writes: > Hello Python list > > If a Python program has an import statement like: > > import FFT > > how do I determine the path to the imported file? guru% python Python 2.4.1 (#2, Apr 25 2005, 21:42:44) [GCC 3.4.2 [FreeBSD] 20040728] on freebsd5 Type "hel

Re: Loop until condition is true

2005-06-23 Thread Mike Meyer
Stelios Xanthakis <[EMAIL PROTECTED]> writes: > Michael Hoffman wrote: >> Stelios Xanthakis wrote: >> >>> Magnus Lycka wrote: >> > >> Right. Silly me. Maybe in some future Python version, True and False will be constants, like None is since Python 2.4. >>> >>> >>> Actually, there is sup

Re: Loop until condition is true

2005-06-23 Thread Mike Meyer
Michael Hoffman <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >> Making None a constant broke existing code (and I just saw old code >> that assigned to None). Are True and False that much more common as >> variable names than None? > > Yes. In fact, I c

Re: suggestions invited

2005-06-23 Thread Mike Meyer
gry@ll.mit.edu writes: > Aditi wrote: >> hi all...i m a software engg. student completed my 2nd yr...i have been >> asked to make a project during these summer vacations...and hereby i >> would like to invite some ideas bout the design and implementation of >> an APPLICATION MONITORING SYSTEMi

Tracing down segfault

2005-06-24 Thread Tony Meyer
but I'm not sure why that would be causing a problem; I am join()ing all threads before this happens). Does anyone have any advice for tracking this down? Thanks! Tony Meyer -- http://mail.python.org/mailman/listinfo/python-list

RE: Tracing down segfault

2005-06-26 Thread Tony Meyer
[Tony Meyer] >> I have (unfortunately) a Python program that I can >> consistently (in a reproducible way) segfault. [Tim Peters] > The _best_ thing to do next is to rebuild Python, and as many other > packages as possible, in debug mode. [...] > It's especially useful

Re: Favorite non-python language trick?

2005-06-28 Thread Mike Meyer
Tom Anderson <[EMAIL PROTECTED]> writes: > On Fri, 24 Jun 2005, Roy Smith wrote: >> Tom Anderson <[EMAIL PROTECTED]> wrote: >>> The one thing i really do miss is method overloading by parameter >>> type. I used this all the time in java >> You do things like that in type-bondage languages > I love

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-28 Thread Mike Meyer
Riccardo Galli <[EMAIL PROTECTED]> writes: > On Fri, 24 Jun 2005 09:00:04 -0500, D H wrote: > >>> Bo Peng wrote: >>> I need to pass a bunch of parameters conditionally. In C/C++, I can do func(cond1?a:b,cond2?c:d,.) Is there an easier way to do this in Python? >>> >>> >> Th

Re: Excellent Site for Developers

2005-06-28 Thread Mike Meyer
message to a >> mailing list or Usenet newsgroup (or other discussion forum, I suppose) >> they are often trying to get someone else to "take their bait". >> >> See also: http://www.answers.com/troll >> >> Skip > -- Mike Meyer <[EMAIL PROTECTE

RE: Modules for inclusion in standard library?

2005-06-28 Thread Tony Meyer
>>> Do you have any other good and valued Python modules that you would >>> think are bug-free, mature (that includes a long release >>> distance) and useful enough to be granted a place in the stdlib? >> >> First of all, numeric/numarray, obviously! > > There has been recent discussion about t

Re: Which kid's beginners programming - Python or Forth?

2005-06-28 Thread Mike Meyer
Ivan Van Laningham <[EMAIL PROTECTED]> writes: > In which case, you should start with PostScript;-) I learned it by > plugging a glass tty into the serial port on one of the very first > AppleWriters and typing away. None of this fancy-shmancy '>>>' > business;-) But what a great reward, having

Re: Boss wants me to program

2005-06-29 Thread Mike Meyer
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I realy prefer a WYSIWYG UI design tool > to having to code BUTTON(120, 123, 123, 335, -1, NULL, doButton, "Push", > "push this button") With a modern GUI library, it's more like: buttonBox.addWidget(Button("&New", my, "new")) and your button

Re: Modules for inclusion in standard library?

2005-06-29 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: > Except that (please correct me if I'm wrong) there is somewhat of a > policy for not including interface code for third party programs which > are not part of the operating system. (I.e. the modules in the > standard libary should all be usable for anyon

Re: Which kid's beginners programming - Python or Forth?

2005-06-30 Thread Mike Meyer
[EMAIL PROTECTED] (Roy Smith) writes: > There's a reprint this morning on slashdot of a 1984 review Byte did > on the brand-new Macintosh (executive summary: cool machine, needs > more memory). The first four software packages available for the new > machine? > > MacWrite/MacPaint (they seem to c

Re: Modules for inclusion in standard library?

2005-06-30 Thread Mike Meyer
Harry George <[EMAIL PROTECTED]> writes: > b) Installing distutils-aware python packages is trivial. I'd rather > the energy which might go into a bigger std library go instead into > helping projects which don't have distutils-style builds. How about integrating distutils and PyPI, so that dist

Re: script fichiers binaires lecture écriture

2005-06-30 Thread Mike Meyer
bruno modulix <[EMAIL PROTECTED]> writes: >> Be aware that I'm >> using pyhton 1.5, > Err... latest is 2.4.1, and the language has really, really changed. You > should consider upgrading... > >> unfortunately... > > BTW, in 1.5.x, you can use the String module instead of string class > methods:

Re: Python for everything?

2005-06-30 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I posted a article earlier pertaining programming for my boss. Now I am > gonna ask a question about programming for myself. I just finished my > first C++ Class. Next semester is a class on encryption(and it's > probably gonna be a math class too). And finally back in

Re: Python for everything?

2005-06-30 Thread Mike Meyer
Ivan Van Laningham <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> [EMAIL PROTECTED] writes: >> As other have noted, C was never really used for everything. Unix >> tools were designed to connect together from the very beginning, which >> is what makes shell scr

Re: How to run commands in command line from a script

2005-07-01 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Ivan Shevanski wrote: >> Alright well I'm quite a noob and when I run a simple command to >> change the current directory, nothing happens. I made a little test >> script to show it: >> import os >> cwd = os.getcwd() >> print cwd >> os.system('cd = C:\Pr

Re: LOC in Python and C++ in large projects

2005-07-01 Thread Mike Meyer
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I think the choice of a programming language is not very important in > determining the overal succes of a project. C++ and Python are however > my two favorite languages. Well, getting done on time is a crucial part of success, and it takes less tim

Re: Question about Python

2005-07-01 Thread Mike Meyer
Jan Danielsson <[EMAIL PROTECTED]> writes: > Hello all, > I'd like to ask seasoned Python developers: > - Are you comfortable in upgrading to the latest version of Python, or > are you worried about what you have to fix in your existing programs? No, I'm not worried. The Python developers worry a

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Mike Meyer
"iK" <[EMAIL PROTECTED]> writes: > Seems like he wants python programmers to solve their problems all in the > same way. While that is great for corporate slaves it is terrible for the > creative programmer. No, he wants Python to be Pythonic. TMTOWTDI is not Pythonic. > Python is quickly beco

Re: Assigning to None

2005-07-01 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> Yes. I once grabbed an old program that did assignments to None. But >> that's always been a bad idea. > What was the use case!? Unpacking a tuple. Something like this: (foo, bar, None) = gen_

Re:

2005-07-01 Thread Mike Meyer
Harry George <[EMAIL PROTECTED]> writes: >> > - more available libraries and more advanced developement tools. > If the library is in C, C++, or FORTRAN, Python can use it. Worst > case you have to write your own bindings. Are there really that many more libraries for C++? I'm not talking about d

Re: Favorite non-python language trick?

2005-07-01 Thread Mike Meyer
"Shai" <[EMAIL PROTECTED]> writes: > Joseph Garvin wrote: >> >> I'm curious -- what is everyone's favorite trick from a non-python >> language? And -- why isn't it in Python? > > 1. Lisp's "dynamically scoped" variables (Perl has them, and calls them > "local", but as far as I've seen their use th

Re: Favorite non-python language trick?

2005-07-01 Thread Mike Meyer
[Lots of quoted text left in...] I started thinking about this, and realized that there was a way to do what you wanted, with no execution time overhead, and without providing ways to radically change the program behavior behind the scenes. Mike Meyer <[EMAIL PROTECTED]> writes: > "

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Mike Meyer
"Sean McIlroy" <[EMAIL PROTECTED]> writes: > Peter Hansen wrote: > >> Sean, what gave you the impression this would change? > if that's the case then list comprehensions and/or "first class > functions" are likely to be the next target. The existence of list comprehensions are the reason that th

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-02 Thread Mike Meyer
Jamey Cribbs <[EMAIL PROTECTED]> writes: > Code blocks allow you to wrap up any Ruby code and pass it to a method > and have it executed within that method. It is more powerful than > lambda, because you can have multiple statements in the code block and > you can do assignment within the code blo

Re: Python for everything?

2005-07-02 Thread Mike Meyer
Christos "TZOTZIOY" Georgiou <[EMAIL PROTECTED]> writes: > On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer > <[EMAIL PROTECTED]> might have written: > >>Actually, I was thinking of pre-K&R Unix compilers. > > There must be something I

<    1   2   3   4   5   6   7   8   9   10   >