Re: HELP Printing with wxPython

2005-05-11 Thread Mike Meyer
James Carroll <[EMAIL PROTECTED]> writes: > If you are doing this just for yourself, and you know you have a > printer that will really print just the plain text when you send it > plain text (like a dot matrix printer from the early 90s) then you can > probably open the printer device and send it

Re: Importing modules

2005-05-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > A part the fact that I have not understood the "real" difference > between import and from ... import (or also from... import *), is it > possible to re-build the application in only one chunck? > This is only to better understand the application's structure, in order >

Re: Finding startup files

2005-05-11 Thread Mike Meyer
jeff elkins <[EMAIL PROTECTED]> writes: > On Wednesday 11 May 2005 04:44 pm, Grant Edwards wrote: >> On 2005-05-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> > The following script demonstrates a method that should work for you. I >> > believe it is entirely cross-platform. >> > >> > #! /usr

Re: reg mail sending without smtp module

2005-05-12 Thread Mike Meyer
praba kar <[EMAIL PROTECTED]> writes: > In Php we can build a Mail Message by > Mail_mime class and send this message by > Mail::Factory's class send Method. Here Php > doesn't use any smtp modules. Like that > In Python I used email.Message class to > build Mail Message and Now I am searching > mo

Re: HELP Printing with wxPython

2005-05-12 Thread Mike Meyer
jeff elkins <[EMAIL PROTECTED]> writes: >> Instead, as was suggested earlier, use the "lpr" command and send it >> the text/data on standard input. Any reasonably managed Unix system >> should be able to handle a fair range of graphics formats, though >> postscript is preferred. > I've been using:

Re: Python Documentation (should be better?)

2005-05-12 Thread Mike Meyer
"Christopher J. Bottaro" <[EMAIL PROTECTED]> writes: > because there are no namespaces or classes, but still I think Python could > do something similar. Say for instance search for "append" and it will > come back with a page for list's append, a page for array's append, etc. A seperate page fo

Re: pyvm -- faster python

2005-05-12 Thread Mike Meyer
Paul Rubin writes: > Andrew Dalke <[EMAIL PROTECTED]> writes: > >> Years ago, presented at one of the Python conferences, was a program >> to generate C code from the byte code The conclusion I recall >> was that it wasn't faster - at best a few percent - and there

Re: bash like expansion

2005-05-12 Thread Mike Meyer
"bill" <[EMAIL PROTECTED]> writes: > Consider the following: > > import os, commands > os.environ['QWE']="string with foo" > a = '$QWE ${QWE/foo/baz}' > b = commands.getoutput('echo ' + a) > > > This does what I want, which is to expand > a according to the standard bash expansion rules > (so b n

Re: Jesus said, "I am the way, the truth and the life: no one can come to the Father(God)(in Heaven), but by me." (John 14:6) This means that if you die without trusting in Jesus Christ as your Lord and Saviour you will die in your sins and be forever sepa

2005-05-16 Thread Mike Meyer
[EMAIL PROTECTED] (Mike brown) writes: > In article <[EMAIL PROTECTED]>, "Bubba" <[EMAIL PROTECTED]> wrote: > >> I'm so glad you've decided what everyone believes >> > > > > Some of us don't. > > > > > > Believe that is. > > > > > > In anything in particular. Everybody should believe in som

Re: Calling C/C++ not contained inside a .dll

2005-05-16 Thread Mike Meyer
[EMAIL PROTECTED] writes: > My question is.. > How do I get python scripts to call functions in my game code without > having to build a .dll that has the entire meat of my game inside of > it? Ultimately I want to be able to load scripts from my game and > have those scripts call functions in my

Re: Newbie : checking semantics

2005-05-16 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > Or the infamous, and maybe urban legend, of the early FORTRAN > compiler in which literal constants weren't... > > call inc(1) > write(6, 100) 1 > 100 format("I5") > > > subroutine inc(i) > i = i + 1 > retur

Re: Reg Date string conversion into timestamp function

2005-05-16 Thread Mike Meyer
praba kar <[EMAIL PROTECTED]> writes: > Dear All, > > I have doubt regarding date string to time > conversion function. In Python I cannot find flexible > date string conversion function like php strtotime. I > try to use following type > function > 1) parsedate function failed if a date str

Re: trouble with copy/deepcopy

2005-05-17 Thread Mike Meyer
[EMAIL PROTECTED] (Alexander Zatvornitskiy) writes: > ðÒÉ×ÅÔ Marc! > > 16 ÍÁÑ 2005 × 22:18, Marc 'BlackJack' Rintsch × Ó×ÏÅÍ ÐÉÓØÍÅ Ë All ÐÉÓÁÌ: > > MR> That clears only one dictionary at class level. Which is visible on > MR> both instances. > > MR> class Distribution: > MR> def __init__

Re: Parsing text into dates?

2005-05-17 Thread Mike Meyer
"Thomas W" <[EMAIL PROTECTED]> writes: > I'm developing a web-application where the user sometimes has to enter > dates in plain text, allthough a format may be provided to give clues. > On the server side this piece of text has to be parsed into a datetime > python-object. Does anybody have any p

Re: Python on a public library computer

2005-05-17 Thread Mike Meyer
"Anton Vredegoor" <[EMAIL PROTECTED]> writes: > Timothy Smith wrote: > >> how locked down is the computer? there's a few (brave) public access >> unix shell providers out there. if you could run telnet you could use > them > > Sorry, no telnet. Every executable that is not listed is blocked. You

Re: processing a Very Large file

2005-05-18 Thread Mike Meyer
DJTB <[EMAIL PROTECTED]> writes: > I'm not a Python memory specialist, but does del immediately release/free > the memory to the OS? I thought it was impossible to let Python immediately > release memory. Unknown. Python relies on the C alloc/free routines for handling memory. del may immediately

Re: newbie file/DB processing

2005-05-19 Thread Mike Meyer
"len" <[EMAIL PROTECTED]> writes: > I am in the process of learning python. I have bought Learning Python > by Mark Lutz, printed a copy of Dive into Python and various other > books and looked at several tutorials. I have started a stupid little > project in python and things are proceeding wel

Re: How to learn OO of python?

2005-05-19 Thread Mike Meyer
"Harlin Seritt" <[EMAIL PROTECTED]> writes: > I think I know what you mean. When I first started trying to learn the > OOP aspect of Python I thought it was strange since I had started with > OOP on Java and C++. Nonetheless, once you get the hang of it, OOP will > make way more sense than all of t

Re: datetime

2005-05-19 Thread Mike Meyer
Nader Emami <[EMAIL PROTECTED]> writes: > L.S., > > It is very simple question: Why doesn't work the next statments? > > import datetime > > today = datetime.date.today() > > and I get the next error: > > today = datetime.date.today() > Traceback (most recent call last): >File "", line 1, in ?

Re: Convert from numbers to letters

2005-05-19 Thread Mike Meyer
Bill Mill <[EMAIL PROTECTED]> writes: > On 19 May 2005 11:59:00 -0700, rh0dium <[EMAIL PROTECTED]> wrote: >> This is great but backwards... >> >> Ok because you all want to know why.. I need to convert Excel columns >> A2 into , [1,0] and I need a simple way to do that.. >> >> ( The way this wo

Re: Twisted an several CPUs

2005-05-19 Thread Mike Meyer
Jp Calderone <[EMAIL PROTECTED]> writes: >>Has anyone experience high load and twisted? > Distributing load across multiple machines scales better than distributing > it over multiple CPUs in a single machine. If you have serious scalability > requirements, SMP is a minor step in the wrong di

Re: Convert from numbers to letters

2005-05-19 Thread Mike Meyer
"rh0dium" <[EMAIL PROTECTED]> writes: > Now can you reverse this process tuple2coord?? You didn't provide enough context to know who you're asking, but here's the inverse of my coord2tuple2 function: from string import uppercase def tuple2coord(number): if 1 > number or number > 26: ra

Re: Running a python program during idle time only

2005-05-20 Thread Mike Meyer
"los" <[EMAIL PROTECTED]> writes: > I'm trying to create a program similar to that of Google's desktop that > will crawl through the hard drive and index files. I have written the > program and as of now I just put the thread to sleep for 1 second after > indexing a couple of files. > > I'm wonder

Re: first release of PyPy

2005-05-21 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Torsten Bronger wrote: > Even if things don't turn out that way, note that each generation of > programming languages builds on its predecessors, and PyPy could help > bootstrap the next generation. Assemblers first had to be written in > machine code;

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Mike Meyer
"Xah Lee" <[EMAIL PROTECTED]> writes: So now we find out that Xah Lee is as ignorant of other programming languages as he is of Python and Perl. > In advanced languages such as LISP family, it is not uncommon to define > functions inside a function. For example: > subroutine f (x1, x2, ...) { >

Re: first release of PyPy

2005-05-23 Thread Mike Meyer
Shane Hathaway <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > > Basically, there's a *lot* of history in programming languages. I'd > > hate to see someone think that we went straight from assembler to C, > > or that people didn't understand the

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Mike Meyer
Jonathan Bartlett <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: > > "Xah Lee" <[EMAIL PROTECTED]> writes: > > So now we find out that Xah Lee is as ignorant of other programming > > languages as he is of Python and Perl. > > I think you

Re: Running a python program during idle time only

2005-05-23 Thread Mike Meyer
"los" <[EMAIL PROTECTED]> writes: > Thanks for all the replies. > > I did try using nice under windows. I created a java program that > would just loop and print numbers on the screen. Even when I ran that > simple program with nice, (lets call it program A) as soon as I started > the program t

Re: Python Impact Analysis Tool ?

2005-05-26 Thread Mike Meyer
[EMAIL PROTECTED] writes: > I am a mainframe designer/progrmmer. What I need is a tool that shows > me at design time what links to what so that I can understand the > application. When a design change comes through I could say OK this > change affects only A, B, and C out of the whole alphanet. Th

Re: Case Sensitive, Multiline Comments

2005-05-26 Thread Mike Meyer
"Elliot Temple" <[EMAIL PROTECTED]> writes: > Hi I have two questions. Could someone explain to me why Python is > case sensitive? I find that annoying. Because it comes from a language background of case sensitive languages (C, shell, etc.). But read what the BDFL has to say about it: http://ma

Re: concurrent access to object file

2005-05-26 Thread Mike Meyer
"Frank Abel" <[EMAIL PROTECTED]> writes: > Hi again! > > I will make the question more simple: > > If two call to the "write" method of a file object "occur simultaneously " > is totally sure that the data of each call is writen successive or exist the > posibility of merge data? Youv'e asked thi

Re: Pyrex: step in for loop

2005-05-26 Thread Mike Meyer
"Luis P. Mendes" <[EMAIL PROTECTED]> writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I'm trying to improve speed in a module and substituted the pythonic > 'for in range()' for 'for i from min < i < max:' > > But, I need to define a step for the i variable. How can I do it?

Re: Pyrex: step in for loop

2005-05-26 Thread Mike Meyer
"Luis P. Mendes" <[EMAIL PROTECTED]> writes: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > | so it's > | > | for i in range(8, 14, 1): ... > | > | > For what I've read, for i in range is slower than the other for > construct used by Pyrex: > > for i from iMin <= i < iMax

Re: Case Sensitive, Multiline Comments

2005-05-28 Thread Mike Meyer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > On 26 May 2005 17:33:33 -0700, "Elliot Temple" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> Thanks for the link on case sensitivity. I'm curious about the person >> who found case sensitivity useful though: what is it usef

Re: write to the same file from multiple processes at the same time?

2005-05-28 Thread Mike Meyer
Paul Rubin writes: > Really, I think the Python library is somewhat lacking in not > providing a simple, unified interface for doing stuff like this. It's got one. Well, three, actually. The syslog module solves the problem quite nicely, but only works on Unix. If the O

Re: __call__

2005-05-28 Thread Mike Meyer
TK <[EMAIL PROTECTED]> writes: > Simon Percivall wrote: >> Look at http://docs.python.org/ref/callable-types.html >> >class Test(object): >> ... def __call__(self): >> ... print "the instance was called" >> ... >> >t = Test() >t() >> the instance was called >> Is this what y

Re: Help with choice of suitable Architecture

2005-05-28 Thread Mike Meyer
"Rob Cowie" <[EMAIL PROTECTED]> writes: > Paul. I agree that client-side scripting increases the level of > compexity, but did it really go out of fashion with pop-ups? It seems > to be just getting started. Google use it to great effect maps, > suggest etc. I wasn't thinking of using it t

Re: prime number

2005-05-29 Thread Mike Meyer
"lostinpython" <[EMAIL PROTECTED]> writes: > I'm having trouble writing a program that figures out a prime number. > Does anyone have an idea on how to write it? All I know is that n > 2 > is prim if no number between 2 and sqrt of n (inclusivly) evenly > divides n. How about this (untested): im

Re: write to the same file from multiple processes at the same time?

2005-05-30 Thread Mike Meyer
gabor <[EMAIL PROTECTED]> writes: > ok, i ended up with the following code: > > def syncLog(filename,text): > f = os.open(filename,os.O_WRONLY | os.O_APPEND) > fcntl.flock(f,fcntl.LOCK_EX) > os.write(f,text) > #FIXME: what about releasing the lock? > os.close(f) > > it see

Re: Alternative history

2005-06-04 Thread Mike Meyer
[EMAIL PROTECTED] (Cameron Laird) writes: > In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: > . >>If it isn't a homework assignment, and you're honestly in such, then >>you should know there's been a lot o

Re: Software licenses and releasing Python programs for review

2005-06-04 Thread Mike Meyer
Steve Holden <[EMAIL PROTECTED]> writes: > But this would only be a restriction if the code were to be > redistributed, of course. It's stil perfectly legal to use it > internaly without making the modified source available. I've heard people argue otherwise on this case. In particular, if you all

Re: any macro-like construct/technique/trick?

2005-06-04 Thread Mike Meyer
Andrew Dalke <[EMAIL PROTECTED]> writes: > Mac wrote: >> Is there a way to mimic the behaviour of C/C++'s preprocessor for >> macros? > > There are no standard or commonly accepted ways of doing that. > > You could do as Jordan Rastrick suggested and write your own sort > of preprocessor, or use a

Re: Easy way to detect hard drives and partitions in Linux

2005-06-04 Thread Mike Meyer
Jeff Epler <[EMAIL PROTECTED]> writes: >> I need a way to detect hard drives and their partitions... labels would >> be nice too... I did some googling but did not find anything all too >> useful. This will strictly be on Linux / Unix so any help would be >> greatly appreciated. > You're not going

GUI builders considered harmful (Was: anygui,anydb, any opinions?)

2005-06-05 Thread Mike Meyer
"Thomas Bartkus" <[EMAIL PROTECTED]> writes: > "Paul Rubin" wrote in message >> Are we talking about a drag-and-drop GUI builder? > I am! [...] > I happen to be one - and I *know* I'm not alone - who thinks that building > user interfaces is way too difficult and way too

Re: For review: PEP 343: Anonymous Block Redux and GeneratorEnhancements

2005-06-05 Thread Mike Meyer
Paul Rubin writes: > "Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]> writes: >> Be sure to read the referenced PEPs (and the ones referenced from them) >> - they contain a lot of history. Also read PEP 346 for a competing PEP >> to PEPs 340 and 343 that gradually conv

Re: GUI builders considered harmful

2005-06-05 Thread Mike Meyer
Bruce Stephens <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: > > [...] > >> The first, and most obvious, thing that GUI builders do is force the >> developer to specify an exact position - if not size - for the >> graphical elements

Re: Destructive Windows Script

2005-06-06 Thread Mike Meyer
"Terry Reedy" <[EMAIL PROTECTED]> writes: > On *nix, one could open '/dev/rawdisk' (actual name depends on the *nix > build) and write a tracks worth of garbage for as many tracks as there are. > I don't how to programmaticly get the track size and number (if there is a > standard way at all).

Re: Destructive Windows Script

2005-06-06 Thread Mike Meyer
rbt <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >> "Terry Reedy" <[EMAIL PROTECTED]> writes: >> >>> On *nix, one could open '/dev/rawdisk' (actual name depends on the >>> *nix build) and write a tracks worth of garbage for as ma

Re: SMTP help please

2005-06-07 Thread Mike Meyer
Martin Franklin <[EMAIL PROTECTED]> writes: > server = smtplib.SMTP("mailserver.somewhere.com") Why are you beating up Kee's mail server (hint: "whois somewhere.com")? See RFC 2606 http://www.ietf.org/rfc/rfc2606.txt > and search for "example.com" for how to pick example domain names properly.

Re: Help with SMTP

2005-06-08 Thread Mike Meyer
"Ivan Shevanski" <[EMAIL PROTECTED]> writes: > Ok, all my problems are solved except for one. . .If I want my program > to send a message back to me do I need the from adress? Because I > don't specifically know it for the person using the program. Any help > is appreciated =D You need a from ad

Re: Fast text display?

2005-06-09 Thread Mike Meyer
Paul Rubin writes: > Jp Calderone <[EMAIL PROTECTED]> writes: >> What does "included with Python" mean anyway? Different packagers >> make different decisions. > I mean included with the source distro from python.org. Well, it includes Tkinter, but it doesn't include t

Re: my golf game needs gui

2005-06-09 Thread Mike Meyer
Mike Hoy <[EMAIL PROTECTED]> writes: > hi > > i've been writing a golf game in text only. this was to work out some of > details. it's great but making a golf course with ---'s and |||'s is > kinda silly looking. (at least to some..) > > now i'm ready to begin shopping for a gui widget to work wi

Re: Start application & continue after app exits

2005-06-09 Thread Mike Meyer
"guy lateur" <[EMAIL PROTECTED]> writes: >>>Also note that this method of creating tempfiles is technically unsafe, >>>as it is theoretically possible that another process would create a file >>>of the same name in the same directory and then try to use it, resulting >>>in a race condition between

Re: Fast text display?

2005-06-09 Thread Mike Meyer
Paul Rubin <http://[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> writes: >> > I mean included with the source distro from python.org. >> Well, it includes Tkinter, but it doesn't include tcl/tk. So you get a >> non-functional version of Tki

Re: Fast text display?

2005-06-10 Thread Mike Meyer
Paul Rubin writes: >> > What about wxwidgets, which wxpython requires? >> >> If the package needs something and it's not installed, the package >> system will get it and install it. That's the *point* of a package >> system. > > Not really. A package system turns a so

Re: Is pyton for me?

2005-06-10 Thread Mike Meyer
"Mark de+la+Fuente" <[EMAIL PROTECTED]> writes: > I need to write simple scripts for executing command line functions. > Up till now I've used C-Shell scripts for this, but I'm looking for > a better alternative. And I keep reading about how “easy” it is to > program with python. Lots of answers

Re: Sending mail from 'current user' in Python

2005-06-10 Thread Mike Meyer
Leo Breebaart <[EMAIL PROTECTED]> writes: > I can get the username info (at least on Unix) via the 'pwd' > module, but that still leaves me with the domainname, or rather > the mailname, and I have not been able to spot a way of finding > that from within Python. (I could try opening /etc/mailname

Re: Start application & continue after app exits

2005-06-10 Thread Mike Meyer
"Guy Lateur" <[EMAIL PROTECTED]> writes: > To be honest, I don't really understand what it means to have the same file > open for writing by several processes. You don't want to modify data which > is already being modified by someone else, do you? I mean, how do you > determine what changes to

Re: Is pyton for me?

2005-06-11 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Kirk Job Sluder wrote: >> I agree with this approach. For me, there has to be a certain level of >> complexity before I reach for python as a tool. > > For me as well. In my case, the key question is "is this bash script > going to be longer than two li

Re: Best Web dev language

2005-06-11 Thread Mike Meyer
"Jon Slaughter" <[EMAIL PROTECTED]> writes: > Also, can anyone recommend any book or web page that gives an introduction > to the method in which one programs web sites? I am not clear on who one, > for instance, would use C++ as the language for a web site except by using > it to create html..

Re: cgi script runs under Opera, but not firefox

2005-06-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > fixed, thanks for all of your help. > i am pouring over python texts and the problem is > html... duh Right. To get HTML that will work in any browser, http://www.anybrowser.org/campaign/ >, you really need to validate your HTML. w3.org provides a public validator

Re: Controlling a generator the pythonic way

2005-06-11 Thread Mike Meyer
Thomas Lotze <[EMAIL PROTECTED]> writes: > A related problem is skipping whitespace. Sometimes you don't care about > whitespace tokens, sometimes you do. Using generators, you can either set > a state variable, say on the object the generator is an attribute of, > before each call that requires a

Re: What is different with Python ?

2005-06-12 Thread Mike Meyer
John Machin <[EMAIL PROTECTED]> writes: > Roy Smith wrote: >> "Philippe C. Martin" <[EMAIL PROTECTED]> wrote: >>>Yet, many issues that a future software engineer should know are >>>mostly hidden by Python (ex: memory management) and that could be >>>detrimental. >> I know I'm going out on a limb by

Re: Dealing with marketing types...

2005-06-12 Thread Mike Meyer
Andrew Dalke <[EMAIL PROTECTED]> writes: > Paul Rubin replied to me: >> As for "big", hmm, I'd say as production web sites go, 100k users is >> medium sized, Slashdot is "largish", Ebay is "big", Google is huge. > I'ld say that few sites have >100k users, much less > daily users with personalized i

Re: Best Web dev language

2005-06-12 Thread Mike Meyer
"John Roth" <[EMAIL PROTECTED]> writes: > "Mike Meyer" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> "Jon Slaughter" <[EMAIL PROTECTED]> writes: >> >> Someone mentioned that you might "req

Re: What is different with Python ?

2005-06-12 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Sat, 11 Jun 2005 21:52:57 -0400, Peter Hansen <[EMAIL PROTECTED]> > wrote: > Also concrete->abstract shows a clear path; starting > in the middle and looking both up (to higher > abstractions) and down (to the implementation > details) is IMO much mo

Re: Sending mail from 'current user' in Python

2005-06-12 Thread Mike Meyer
Marcus Alanen <[EMAIL PROTECTED]> writes: > Mike Meyer wrote: >>>Finally, if at all possible I'd also like to get this working on >>>Windows, so I'd rather stick with the standard smtplib if I can. >> smtplib needs an SMTP server to connect to. For u

Re: What is different with Python ?

2005-06-13 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: >>In short, you're going to start in the middle. > > I've got "bad" news for you. You're always in the > middle :-D. That's what I just said. >>Is it really justified to confuse them all >>by introducing what are really extraneous details early on? > >

Re: What is different with Python ?

2005-06-13 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Mon, 13 Jun 2005 01:54:53 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >>Andrea Griffini <[EMAIL PROTECTED]> writes: >>I disagree. If you're going to make competent programmers of them, >>they need

Re: How to get/set class attributes in Python

2005-06-13 Thread Mike Meyer
Kalle Anke <[EMAIL PROTECTED]> writes: > On Mon, 13 Jun 2005 20:41:48 +0200, Terry Hancock wrote > (in article <[EMAIL PROTECTED]>): > >> 1) Assume the variables are of a sensible type (not >> necessarily the one you expected, though), and provide >> exception handling to catch the case where the

Re: recursive import list

2005-06-13 Thread Mike Meyer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: >> I have a fairly large project going on and would like to figure out >> automatically from the source which files are being imported. > If you use your own import function, like below, you could create a > list of all imported modules. Why not use

Re: What is different with Python ?

2005-06-14 Thread Mike Meyer
Andrea Griffini <[EMAIL PROTECTED]> writes: > On Mon, 13 Jun 2005 21:33:50 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: > >>But this same logic applies to why you want to teach abstract things >>before concrete things. Since you like concrete examples, let's lo

Re: What is different with Python ?

2005-06-14 Thread Mike Meyer
Roy Smith <[EMAIL PROTECTED]> writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> I've never seen someone explain why, for instance, string addition is >> O(n^2) beyond the very abstract "it creates a new string with each >> addition". No concret

Re: urllib2.urlopen broken?

2007-06-06 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> typed: > In 2.5.1 (and 2.[45], but not 2.3): Sigh. Sorry 'bout that. Since I started it, the breakage is: Python 2.5.1 (r251:54863, May 15 2007, 15:31:37) [GCC 3.4.6 [FreeBSD] 20060305] on freebsd6 Type "help&qu

urllib2.urlopen broken?

2007-06-06 Thread Mike Meyer
In 2.5.1 (and 2.[45], but not 2.3): -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list

Re: Another dumb scope question for a closure.

2008-01-09 Thread Mike Meyer
On Wed, 9 Jan 2008 13:47:30 -0500 (EST) "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > So sorry because I know I'm doing something wrong. > > 574 > cat c2.py > #! /usr/local/bin/python2.4 > > def inc(jj): > def dummy(): > jj = jj + 1 > return jj > return dummy > > h =

Re: problem of converting a list to dict

2008-01-09 Thread Mike Meyer
On Wed, 9 Jan 2008 14:34:26 -0600 "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:python- > > [EMAIL PROTECTED] On Behalf Of John Machin > > Sent: Wednesday, January 09, 2008 3:02 PM > > To: python-list@python.org > > Subject: Re: pro

Re: Python too slow?

2008-01-09 Thread Mike Meyer
On Wed, 9 Jan 2008 15:45:41 -0800 (PST) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Okay I profiled the code and here is the output: > > http://heightened.files.wordpress.com/2008/01/output.txt > > It seems that the function it spends the longest on is the red_points > function that he use

Re: for loop without variable

2008-01-09 Thread Mike Meyer
On Wed, 9 Jan 2008 18:49:36 -0800 (PST) erik gartz <[EMAIL PROTECTED]> wrote: > The loop performs some actions with web services. The particular > iteration I'm on isn't important to me. It is only important that I > attempt the web services that number of times. If I succeed I > obviously break ou

Re: What is "lambda x=x : ... " ?

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 10:25:27 -0800 (PST) "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm reading this page: > http://www.ps.uni-sb.de/~duchier/python/continuations.html > and I've found a strange usage of lambda: > > > Now, CPS would transform the baz function above in

Re: What is "lambda x=x : ... " ?

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 19:59:23 +0100 Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Mike Meyer wrote: > >> What does "y=y" and "c=c" mean in the lambda function? > > > > Older versions of python didn't make variables in an outer scope > > vi

Re: for loop without variable

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 08:42:16 +0100 Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Mike Meyer <[EMAIL PROTECTED]> writes: > > It sounds to me like your counter variable actually has meaning, > It depends how the code is written. In the example such as: > > for

Re: XML+Logs to Latex. XSLT?

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 22:32:50 +0100 Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > Yes. For sure. I though XSLT was something like XML not other > > "language" and that Python will have any library that uses XSLT to do > > transformation... > XSLT is definitely a language (it's turing complete, after

Re: Detecting OS platform in Python

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 18:37:59 -0800 (PST) Devraj <[EMAIL PROTECTED]> wrote: > Hi everyone, > > My Python program needs reliably detect which Operating System its > being run on, infact it even needs to know which distribution of say > Linux its running on. The reason being its a GTK application th

Re: Newbie Q: modifying SQL statements

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 20:32:06 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm in the process of learning Python by writing a job queue program. > Nothing fancy, mind you, just read from a table, shell out to a program, > write back to the table. > > I'm working off of the tuto

Re: for loop without variable

2008-01-10 Thread Mike Meyer
On Thu, 10 Jan 2008 22:36:56 -0500 Marty <[EMAIL PROTECTED]> wrote: > I recently faced a similar issue doing something like this: > > data_out = [] > for i in range(len(data_in)): > data_out.append([]) More succinctly: data_out = [] for _ in data_in: data_out.append([]) Or, a

Re: for loop without variable

2008-01-10 Thread Mike Meyer
On Fri, 11 Jan 2008 01:48:43 -0500 Marty <[EMAIL PROTECTED]> wrote: > Mike Meyer wrote: > >> This caused me to wonder why Python does not have a "foreach" statement > >> (and > >> also why has it not come up in this thread)? I realize the topic ha

Re: How to POST call and retrieve result page

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 14:44:19 +0530 "suyash jape" <[EMAIL PROTECTED]> wrote: > Hi all > i want to access a web page through python script, fillup the necessary > fields, > and press submit button (which does POST call) and retrieve the result page > and retrieve some values from it. > > Here is th

Re: Learning Python via a little word frequency program

2008-01-11 Thread Mike Meyer
On 11 Jan 2008 03:50:53 -0800 Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote: > rent <[EMAIL PROTECTED]> writes: > > keys = freq.keys() > > keys.sort(key = freq.get, reverse = True) > > for k in keys: > > print "%-10s: %d" % (k, freq[k]) > > I prefer (untested): > > def snd((x,y)): ret

Re: Magic function

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 08:29:18 -0800 (PST) [EMAIL PROTECTED] wrote: > Hi all, > > I'm part of a small team writing a Python package for a scientific > computing project. The idea is to make it easy to use for relatively > inexperienced programmers. As part of that aim, we're using what we're > call

Re: Python Frontend/GUI for C Program

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 08:12:48 -0800 (PST) [EMAIL PROTECTED] wrote: > I have a C program that works very well. However, being C it has no > GUI. What does C have to do with it not having a GUI? I've written more C programs with a GUI than Python ones - and the C experience was generally better. Of c

Re: improving performance of python webserver running python scripts in cgi-bin

2008-01-11 Thread Mike Meyer
On Thu, 10 Jan 2008 23:17:28 -0800 (PST) Dale <[EMAIL PROTECTED]> wrote: > I am using a simple python webserver (see code below) to serve up > python scripts located in my cgi-bin directory. > > import BaseHTTPServer > import CGIHTTPServer > class Handler(CGIHTTPServer.CGIHTTPRequestHandler): >

Re: for loop without variable

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 22:18:22 GMT Neil Hodgson <[EMAIL PROTECTED]> wrote: > Marty: > > I recently faced a similar issue doing something like this: > > data_out = [] > > for i in range(len(data_in)): > > data_out.append([]) > > Another way to write this is > data_out = [[]] * le

Re: Import and execfile()

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > I maintain a few configuration files in Python syntax (mainly nested > dicts of ints and strings) and use execfile() to read them back to > Python. This has been working great; it combines the convenience of > pic

Re: encrypting python modules

2008-01-11 Thread Mike Meyer
On Sat, 12 Jan 2008 09:47:26 +1100 Ben Finney <[EMAIL PROTECTED]> wrote: > Paul Sijben <[EMAIL PROTECTED]> writes: > > I know that I can not stop a dedicated hacker deconstructing my code. > A direct consequence of this is that you can not stop *anyone* from > deconstructing your code if it's in t

Re: Newbie Q: modifying SQL statements

2008-01-11 Thread Mike Meyer
On Fri, 11 Jan 2008 18:11:41 -0500 "Faber J. Fedor" <[EMAIL PROTECTED]> wrote: > On 10/01/08 22:53 -0500, Mike Meyer wrote: > > Personally, I think it would be more pythonic to not try and use two > > different APIs to walk the list of jobs (... One Way To Do

Re: Import and execfile()

2008-01-12 Thread Mike Meyer
On Fri, 11 Jan 2008 20:55:07 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 11, 5:24 pm, Mike Meyer <[EMAIL PROTECTED]> > wrote: > > On Fri, 11 Jan 2008 14:05:11 -0800 (PST) George Sakkis <[EMAIL PROTECTED]> > > wrote: > > > I mainta

Re: where do my python files go in linux?

2008-01-12 Thread Mike Meyer
On Sat, 12 Jan 2008 16:13:08 +0100 "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > > Normally you'd split up the bulk of the code into a module which gets > > installed into site-packages and a piece of stand-alone front-end code which > > imports the module and executes whatever you need to do and get

Re: super, decorators and gettattribute

2008-01-12 Thread Mike Meyer
On Sat, 12 Jan 2008 10:45:25 -0800 (PST) Richard Szopa <[EMAIL PROTECTED]> wrote: > Hello all, > > I am playing around w/ Python's object system and decorators and I > decided to write (as an exercise) a decorator that (if applied to a > method) would call the superclass' method of the same name

<    8   9   10   11   12   13