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

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

Re: What are the other options against Zope?

2005-07-02 Thread Mike Meyer
Terry Hancock <[EMAIL PROTECTED]> writes: > This is true in the same sense that Python is unnecessary > because all programs can be written in assembler. Or machine > code for that matter. Entered by flipping switches, even -- throw > away that keyboard. > > I have actually seen this done, BTW.

Re: What are the other options against Zope?

2005-07-03 Thread Mike Meyer
Christopher Subich <[EMAIL PROTECTED]> writes: > That, and the file format definitely isn't robust to bit-rot that > happened too often on FAT16/32 filesystems. >From where I sit, the critical difference between the registry and a set of .ini files (or Unix rc files) is that the registry requires

Re: website catcher

2005-07-03 Thread Mike Meyer
"jwaixs" <[EMAIL PROTECTED]> writes: > If I should put the parsedwebsites in, for example, a tablehash it will > be at least 5 times faster than just putting it in a file that needs to > be stored on a slow harddrive. Memory is a lot faster than harddisk > space. And if there would be a lot of peo

Re: How do you program in Python?

2005-07-03 Thread Mike Meyer
anthonyberet <[EMAIL PROTECTED]> writes: > My question isn't as all-encompassing as the subject would suggest... > > I am almost a Python newbie, but I have discovered that I don't get > along with IDLE, as i can't work out how to run and rerun a routine > without undue messing about. > > What I w

Re: Python for everything?

2005-07-03 Thread Mike Meyer
Joseph Garvin <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > >>You wind up >>having to invoke the function through your data object, and then pass >>the data object in - sort of as an explicit "self". >> > Yeah, and us pythonists hate expl

Re: looping over a big file

2005-07-03 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > The "right" way to do this is: > > for line in file ("filename"): >whatever > > The file object returned by file() acts as an iterator. Each time through > the loop, another line is read and returned (I'm sure there is some > block-level buffering goin

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

2005-07-03 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I don't object to adding sum and product to the language. I don't object > to adding zip. I don't object to list comps. Functional, er, functions > are a good thing. We should have more of them, not less. Yes, but where should they go? Adding functions

Re: math.nroot

2005-07-04 Thread Mike Meyer
"George Sakkis" <[EMAIL PROTECTED]> writes: > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > >> But it doesn't make sense to say that two flags are equal: >> >> keep_processing = True >> more_reading_needed = True >> while more_reading_needed and keep_processing: >> get_more_records() >>

Re: threads and sleep?

2005-07-05 Thread Mike Meyer
Jeffrey Maitland <[EMAIL PROTECTED]> writes: > What I would like to do is have say 1 thread use as much of a given > CPU as possible and if a new thread is started (added) that if a CPU > is available use it instead of using the same cpu. That way it should > speed the application up. The standalo

Re: Folding in vim

2005-07-05 Thread Mike Meyer
Sybren Stuvel <[EMAIL PROTECTED]> writes: > Andrea Griffini enlightened us with: >> - never ever use tabs > > I always use one tab for indents, and set my editor to display it as > four spaces. I like being able to unindent a line by deleting a single > character. I don't see a reason why _not_ to

Re: How do you program in Python?

2005-07-05 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Tom Anderson wrote: >> +1 insight of the century. This is the heart of the unix way - lots >> of simple little programs that do exactly one thing well, and can be >> composed through simple, clean interfaces. For actually getting >> things done, a toolkit

Re: Lisp development with macros faster than Python development?..

2005-07-05 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> Well, his Viaweb company was founded in about '95, right? So he probably just >> used Lisp because Python wasn't as well known yet. ;-) > > David > > That is what I thought too. It makes sense but I wasn't sure. Still > ain't. > The problem is t

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

2005-07-06 Thread Mike Meyer
Ron Adam <[EMAIL PROTECTED]> writes: > So doing this would give an error for functions that require an argument. > > def foo(x): > return x > > a = None > b = foo(a)# error because a dissapears before foo gets it. So how do I pass None to a function? > >>TypeErro

Re: Favorite non-python language trick?

2005-07-06 Thread Mike Meyer
"Shai" <[EMAIL PROTECTED]> writes: > They're called "Special vars", and you need to define them (unlike > local LISP variables, which behave essentially like Python vars), but > then you use them just like other vars (that is, you usually bind them > with LET). This is the first I hear about them

Re: f*cking re module

2005-07-07 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Thu, 07 Jul 2005 06:47:54 -0400, Chris Smith wrote: >> Oh, come on: what's a Perliodic Table of Operators, between friends? >> http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html > That, and the discussion on operators by Larry Wall, are two

Re: question about introspection using inspect module

2005-07-07 Thread Mike Meyer
Benjamin Rutt <[EMAIL PROTECTED]> writes: > what I am actually trying to do is to build a database of Python > modules. so then later, I can write a tool in my favorite editor > (Emacs) to invoke some forms of completion against this database > (e.g. os.remov or socket. to see a list of all socket

Re: How do you program in Python?

2005-07-07 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > Hey, it's not fair to make fun of emacs now that I've mentioned vim > favourably so many times ;-) > > Seriously, nothing about emacs seems big or slow today. It has been > outbloated by pretty much everything else. Who could have imagined /that/ > ten yea

Re: Lisp development with macros faster than Python development?..

2005-07-07 Thread Mike Meyer
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'll clarify. A lot of the time I hear arguments against > features that boils down to. It seems that you've lost some of the intent during the boiling. > 1) I don't need it. Is that what you get out of the oft-used "

Re: f*cking re module

2005-07-08 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: > François Pinard wrote: > If your program had only minor errors, there was likely a good chance > that the compiler might guess correctly, and your program would > compile to what you wanted in the first place. If not, by continuing > on, the compiler can

Re: __autoinit__

2005-07-11 Thread Mike Meyer
"Ralf W. Grosse-Kunstleve" <[EMAIL PROTECTED]> writes: > --- Bengt Richter <[EMAIL PROTECTED]> wrote: >> No, that limitation wouldn't exist, so you wouldn't have to explain it ;-) >> I.e., the above would act like >> >> class Foo: >> x = Bar() >> def method_1(self, _anonymous_arg_1): >

Re: Fwd: Should I use "if" or "try" (as a matter of speed)?

2005-07-12 Thread Mike Meyer
Dark Cowherd <[EMAIL PROTECTED]> writes: > But one advise that he gives which I think is of great value and is > good practice is > "Always catch any possible exception that might be thrown by a library > I'm using on the same line as it is thrown and deal with it > immediately." Yuch. That sort

Re: new division in Pythonwin

2005-07-12 Thread Mike Meyer
"Jive Dadson" <[EMAIL PROTECTED]> writes: > I like to use Pythonwin as my desktop calculator. It's bothersome > to have to type in "from __future__ import division" into the > interactive window every time I open it. I've tried various ways to > attempt to get it to import new division at startu

Re: threads and sleep?

2005-07-13 Thread Mike Meyer
Andreas Kostyrka <[EMAIL PROTECTED]> writes: > That doesn't change the contrary facts: > > -) the general threading programming model is very hard to get right. > It's basically at the moment where we were with memory management at C > level. Painful, and errorprone. Nothing to be happy about. I'd

Re: Native ODBC access for python on linux?

2005-07-14 Thread Mike Meyer
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: > Although I hear rumors about ODBC drivers on Linux, I confess I don't > understand the need. Certainly you can use Python with the MySQLdb module > from any Linux machine and query away at the server. As long as the MySQL > server accepts your IP/usr/

Re: goto

2005-07-18 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > Many of the world's most profitable software companies (MS for example) > have thousands of goto statements in their code... oh the horror of it > all. Why aren't these enlightened-by-the-gods know-it-alls as profitable > as these obviously ignorant companies? Bec

Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-18 Thread Mike Meyer
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: >> > Re-train on a new platform, >> > and re-write from scratch? > > What do you do when an open source project you were using gets abandoned? cvs import -m "sources for orphaned project" > Hard to see much difference here. Doing support for objec

Re: Opinions on KYLIX 3 (Delphi 4 Linux)

2005-07-19 Thread Mike Meyer
Thomas Bartkus <[EMAIL PROTECTED]> writes: > On Mon, 18 Jul 2005 19:56:24 -0400, Mike Meyer wrote: > >> "Thomas Bartkus" <[EMAIL PROTECTED]> writes: >>>> > Re-train on a new platform, >>>> > and re-write from scratch? >&g

Re: goto

2005-07-19 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: > Leif K-Brooks wrote: >> rbt wrote: >> >>>IMO, most of the people who deride goto do so because they heard or read >>> where someone else did. >> 1 GOTO 17 >> 2 mean,GOTO 5 >> 3 couldGOTO 6 >> 4 with GOTO 7 >> 5 what G

Re: retrieving https pages

2005-07-19 Thread Mike Meyer
Eric <[EMAIL PROTECTED]> writes: > I'm using Linux - Manriva LE2005, python 2.3 (or i can also use python 2.4 > on my other system just as well). > Anyways... > I want to get a web page containing my stock grants. > The initial page is an https and there is a form on it to > fill in your username

Re: How to send a query to the browser from time to time?

2005-07-19 Thread Mike Meyer
"Simon Dahlbacka" <[EMAIL PROTECTED]> writes: > Short answer: Not using HTTP. > > However, you can use something like AJAX to just load new data from > time to time and not the entire page. AJAX is overkill for this. If you just want to automatically refresh the page automatically, you can use a

Re: email format in python

2005-07-19 Thread Mike Meyer
Jorgen Grahn <[EMAIL PROTECTED]> writes: > Agree. In the case of user input validation, it might be ok to politely > inform the user that the address looks a bit funny, but refusing to work > with it will anger a user sooner or later. Yup. I use cryptographically signed addresses as one-time addre

Re: Read only files

2005-07-19 Thread Mike Meyer
Pranav Bagora <[EMAIL PROTECTED]> writes: > Hello, > > I am getting a permission Denied error when i am > trying to make changes in some read only files in a > directory. How do we check and change the read only > attributes of files in python. You want the os.stat and os.chmod functions.

Re: goto

2005-07-20 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Sybren Stuvel wrote: >> Mike Meyer enlightened us with: >> >>>>I dislike gotos because it is too easy to inadvertently create >>>>infinite loops. <10 WINK; 20 GOTO 10> >>> >>>And it

Re: Web-Forms

2005-07-21 Thread Mike Meyer
Mathias Waack <[EMAIL PROTECTED]> writes: > Hi, > > I need to access some information from a web site which are only accessible > through a form. Thus for each bucket of data you have to fill out the form, > submit it and wait for an answer. Very easy - if you don't have to check > some hundred t

Re: goto

2005-07-22 Thread Mike Meyer
Rocco Moretti <[EMAIL PROTECTED]> writes: >> My "favorite" infinte loop with while is: >>i = 0 >>while i < 20: >> do_process(i) >> Note the prominent *lack* of any change to i here? >> Oh, for: >> from i = 0 >> invariant 0 <= i <= 20 >> variant 21 - i >> until i >

Re: Generating images with text in them

2005-07-22 Thread Mike Meyer
[EMAIL PROTECTED] (phil hunt) writes: > On Thu, 21 Jul 2005 02:44:03 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >>While bitmap font files are not copyrightable, there are license issues >>with most of the "nicer" fonts you are probably talking about. > > Oh? I can understand them being copyrig

Re: Stupid question: Making scripts python-scripts

2005-07-22 Thread Mike Meyer
Bill Mill <[EMAIL PROTECTED]> writes: > On 7/21/05, Jan Danielsson <[EMAIL PROTECTED]> wrote: >> Hello all, >> >>How do I make a python script actually a _python_ in unix:ish >> environments? >> >> I know about adding: >> #!/bin/sh >> >>..as the first row in a shell script, but when I i

Re: time.time() under load between two machines

2005-07-23 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I am seeing negative latencies of up to 1 second. I am using ntp to > synchronize both machines at an interval of 2 seconds, so the clocks > should be very much in sync (and are from what I have observed). I > agree that it is probably OS, perhaps I should hop over t

Re: Getting a dictionary from an object

2005-07-23 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 23 Jul 2005 11:48:27 +0300, Thanos Tsouanas wrote: >> Hello. >> >> I would like to have a quick way to create dicts from object, so that a >> call to foo['bar'] would return obj.bar. > > That looks rather confusing to me. Why not just call obj.

Re: [path-PEP] Path inherits from basestring again

2005-07-23 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: >> * staticmethod Path.getcwd() -> Path.cwd() >> * bytes() / lines() / text() -> read_file_{bytes,lines,text} methods >> * write_{bytes,lines,text} -> write_file_{bytes,lines,text} methods > Under Linux isn't it possible to open and read from directories mu

Re: [path-PEP] Path inherits from basestring again

2005-07-24 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 23 Jul 2005 17:51:31 -0600, John Roth wrote: > >> I also like to know the number of elements, which seems to make >> sense as len(path). Again, the number of characters in the path seems >> to be utterly useless information - at least, I can't

Re: How to run python script in background after i logout

2005-07-24 Thread Mike Meyer
Thanos Tsouanas <[EMAIL PROTECTED]> writes: > On Sun, Jul 24, 2005 at 12:51:17PM +0300, Thanos Tsouanas wrote: >> On Sun, Jul 24, 2005 at 02:43:44AM -0700, Harlin Seritt wrote: >> > I have a remote linux server where I can only access it via ssh. I have >> > a script that I need to have run all th

Re: Counting processors

2005-07-26 Thread Mike Meyer
"k pur" <[EMAIL PROTECTED]> writes: > You can use > > print os.sysconf("SC_NPROCESSORS_CONF") > > works on Linux Works on FreeBSD as well. It hooks up to the sysconf C call. That's a Posix call, so this should work portably across Posix systems. I know Windows can be made Posix compliant, but I'm

Re: Safest manner to extend search path for modules?

2005-07-26 Thread Mike Meyer
"Joseph Turian" <[EMAIL PROTECTED]> writes: > Hi, > > What is the safest manner to extend search path for modules, minimizing > the likelihood of shooting oneself in the foot? > > The system (which includes scripts and their shared modules) may be > checked out in several different locations, but

Re: multiple inheritance super()

2005-07-27 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: >>I am mostly >>using old style (without type unification) init but this motivate the >>shift for the new style. Is there somewhere a document about this? > Yes, see http://www.python.org/2.3/mro.html by yours truly I'd also recommend reading http:/

Re: [OT] Problems with permissions etc

2005-07-27 Thread Mike Meyer
"Frank Millman" <[EMAIL PROTECTED]> writes: > While developing under linux, I use my own computer, as the only user, > so it has become my habit to login as root and do all my work as a > superuser. I know that this is not desirable, but it has become a > habit, which I am now trying to get out of

Re: searching string url

2005-07-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Anyway to the orginally replier - I wish it was homework ;-), that > would mean I wouldnt be trying to find myself a job as a recent > graduate... I decided to crawl something similar to the yellow pages > (do you have them in the US?) for my select area and then find

Re: monitor a folder for file creation, how?

2005-07-28 Thread Mike Meyer
fanbanlo <[EMAIL PROTECTED]> writes: > How do I monitor a folder for new file(s) creation? > How to use thread to do a wait until a new file is 'detected'? There's not a clean portable way to do this. The portable way is to poll the update time of the folder at regular intervals, and act when it

Re: writing a web client

2005-07-29 Thread Mike Meyer
"Fuzzyman" <[EMAIL PROTECTED]> writes: > Ajar wrote: >> I want to write a program which will automatically login to my ISPs >> website, retrieve data and do some processing. Can this be done? Can >> you point me to any example python programs which do similar things? >> >> Regards, >> Ajar > > Ver

Re: multiple inheritance super()

2005-07-29 Thread Mike Meyer
"Michele Simionato" <[EMAIL PROTECTED]> writes: > adding methods on the fly and metaclasses could live pretty well > without > multiple inheritance. There would be no real loss > of power and hopefully less monstruosities such > a Zope 2. But maybe this is just wishful thinking ... Um, no real lo

A replacement for lambda

2005-07-29 Thread Mike Meyer
I know, lambda bashing (and defending) in the group is one of the most popular ways to avoid writing code. However, while staring at some Oz code, I noticed a feature that would seem to make both groups happy - if we can figure out how to avoid the ugly syntax. This proposal does away with the wel

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