Re: decimal and trunkating

2005-06-02 Thread Raymond Hettinger
>> i want to trunkate 199.999 to 199.99 >> getcontext.prec = 2 isn't what i'm after either, all that does >> is E's the value. do i really have to use floats to do this? The precision is the total number of digits (i.e 199.99 has 5 digit precision). Either round to that precision level or use th

Re: (OT) lincense protection generator

2005-06-02 Thread flupke
flupke wrote: Thanks for the good ideas people. Regards, Benedict -- http://mail.python.org/mailman/listinfo/python-list

Re: Moving Places, Subtracting from slices/lists

2005-06-02 Thread Mark Sargent
Fredrik Lundh wrote: >Elliot Temple wrote: > > > >>btw hotcat[:] is a *copy* of hotcat, so just leave out "[:]" >> >> > >when you want to modify the thing you're looping over, you need >to be careful. looping over a copy is often a good idea (see the >Python tutorial and the FAQ for more on

Re: Moving Places, Subtracting from slices/lists

2005-06-02 Thread Mark Sargent
Dennis Lee Bieber wrote: >On Thu, 02 Jun 2005 16:12:44 +0900, Mark Sargent ><[EMAIL PROTECTED]> declaimed the following in >comp.lang.python: > > > >>How do I get that x to be an integer b4 it is entered into the indice.? >>Cheers. >> >> >> > If you really want the index, ask for the

Simple Kiosks Serve The World

2005-06-02 Thread [EMAIL PROTECTED]
Jeff_Relf wrote: > As I've told you a quintillion times, Earthlink's insanity aside, > Win_XP is a virtual network, quite indepent of the connection used. > Linux is hardly an OS, it's just a kernel. The world doesn't need a 'virtual network'...it needs an Internet Kiosk. While Jeff the Bolshevi

Re: provide 3rd party lib or not... philosophical check

2005-06-02 Thread Andrew Dalke
Maurice LING wrote: > Just a philosophical check here. When a program is distributed, is it > more appropriate to provide as much of the required 3rd party libraries, > like SOAPpy, PLY etc etc, in the distribution itself or it is the > installer's onus to get that part done? Depends on who you

Re: Two questions

2005-06-02 Thread Andrew Dalke
Steven D'Aprano wrote: > The existence of one or two or a thousand profitable software packages > out of the millions in existence does not invalidate my skepticism that > some random piece of software will directly make money for the > developer. 'Tis true. I think (but have no numbers to back m

Re: (OT) lincense protection generator

2005-06-02 Thread Robert Kern
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >>Alternatively, put a lot of error checking in one >>module which you import and run at startup. Something like: >> >>try: >>import mymodule >>import databasemodule >>except: >>print "PEBCAK

Re: REQ: Small Perl to Python conversion needed

2005-06-02 Thread Koncept
In article <[EMAIL PROTECTED]>, Steven Bethard <[EMAIL PROTECTED]> wrote: > I don't speak Perl, but based on your output, I'd probably do something > like: > > py> lines = ["1,2,3,4,5", "2,3,4,5", "3,4,5", "4,5", "5"] > py> counts = {} > py> for items in lines: > ...for item in items.split('

Bailo's LSD: Linux_Shamanism_Delusion.

2005-06-02 Thread Jeff_Relf
Hi Bailo, Leonard_Blaisdell and Phaywood, I commented: Targeting Win_XP is taboo somehow ? It shouldn't be. And Bailo, under the heavy influence of LSD, the Linux_Shamanism_Delusion, asked: Why target a dying OS that a Top Tier ISP has abandoned ? Earthlink is featuring the thrifty Xandro

OpenSource Automation tool - Pamie 1.5 released

2005-06-02 Thread calfdog
PAMIE 1.50 released!! Now with Frames suport Why wait, when you could be using this to Automate now!... It's Free!!! http://pamie.sourceforge.net What is PAMIE? PAMIE stands for Python Automation module for Internet Explore

provide 3rd party lib or not... philosophical check

2005-06-02 Thread Maurice LING
Hi, Just a philosophical check here. When a program is distributed, is it more appropriate to provide as much of the required 3rd party libraries, like SOAPpy, PLY etc etc, in the distribution itself or it is the installer's onus to get that part done? Cheers Maurice -- http://mail.python.org

Re: (OT) lincense protection generator

2005-06-02 Thread Aahz
In article <[EMAIL PROTECTED]>, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >Alternatively, put a lot of error checking in one >module which you import and run at startup. Something like: > >try: > import mymodule > import databasemodule >except: > print "PEBCAK error, call tech supp

Re: Unicode string in exec

2005-06-02 Thread Shrii
I came out with proper solution today ! thanx for your response -- http://mail.python.org/mailman/listinfo/python-list

ANN: Cleveland Area Python Interest Group

2005-06-02 Thread David Stanek
I am attempting to start a Cleveland (Ohio) Python Interest Group. This group is a revival of the very inactive Cleveland Python Meetup Group. If you are in the Cleveland area and are interested goto http://www.clepy.org for more information. -- David Stanek www.roninds.net GPG keyID #6272EDAF

Re: Beginner question: Logs?

2005-06-02 Thread Robert Kern
Greg Ewing wrote: > Peter Hansen wrote: > >>It's always a good idea, especially when answering a beginner's >>question, to add the caution that this form ("from xxx import *") has >>certain dangers** associated with it, and is widely considered poor >>style, and should really only rarely be use

Earthlink Thinks It's Time To Move On...

2005-06-02 Thread [EMAIL PROTECTED]
Jeff_Relf wrote: > Targeting Win_XP is taboo somehow ? It shouldn't be. Why target a dying OS that a Top Tier ISP has abandoned. Earthlink is featuring the thrifty Xandrox Desktop. A $69 PC that is Internet Ready? Earthlink has it! It can't be done with the buggy and expensive Windos... --

Targeting Win_XP is taboo somehow ? It shouldn't be.

2005-06-02 Thread Jeff_Relf
Hi Leonard_Blaisdell and phaywood, I'm in Comp.OS.Linux.Advocacy Leonard_Blaisdell is in Comp.Sys.Mac.Advocacy. Re: The MicroSoft_C++ 7.1 code I showed, You told me: Unless clc has changed dramatically and rapidly, you won't be welcomed with this. What were you thinking ? Embrace the f

Re: (OT) lincense protection generator

2005-06-02 Thread Steven D'Aprano
flupke wrote: > Jarek Zgoda wrote: > >> flupke napisał(a): >> >>> I'm thinking of a function that will generate such a code and put it >>> in a file. Then when the program starts it checks this file and >>> checks the code in there with a code that it generates at that time >>> again based for

Re: decimal and trunkating

2005-06-02 Thread Facundo Batista
On 6/2/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > >>> d = decimal.Decimal('199.999') > >>> decimal.getcontext().rounding = decimal.ROUND_FLOOR > >>> d.quantize(decimal.Decimal('1.00')) > Decimal("199.99") > > -Peter > > (I hope this inspires someone who actually knows what he's doing with

Re: [python-gtk] problem with multiple inheritance

2005-06-02 Thread Chris Lambacher
One way to get around this would be to omit the TreeSortable interface and use TreeModelSort to do the sorting instead. It doesn't look like GenericTreeModel is designed to also support the TreeSortable interface (you would need something like GenericTreeSortable since you would need some magic to

Re: Like a star, I burn bright, dissipating into the night.

2005-06-02 Thread Leonard Blaisdell
In article <[EMAIL PROTECTED]>, Jeff_Relf <[EMAIL PROTECTED]> wrote: > #include Unless clc has changed dramatically and rapidly, you won't be welcomed with this. What were you thinking? Embrace the flames if they deign to reply at all. Posted from csma leo --

Re: Two questions

2005-06-02 Thread Steven D'Aprano
Andrew Dalke wrote: > Steven D'Aprano wrote: > >>I can think of a number of reasons why somebody might want to hide their >>code. In no particular order: > > >>(3) You have create an incredibly valuable piece of code that will be >>worth millions, but only if nobody can see the source code. Ye

Re: Two questions

2005-06-02 Thread alex23
Sorry to continue with the thread hijack... Steven D'Aprano wrote: > (3) You have create an incredibly valuable piece of code that will be > worth millions, but only if nobody can see the source code. Yeah right. An interesting corollay that comes from source code transparency is that it generall

Re: Two questions

2005-06-02 Thread Andrew Dalke
Greg Ewing wrote: > Hmmm... if these are GPL weapons, if you want to fire > them at anyone you'll *have* to make them available to > all other countries as well... not good for > non-proliferation... I think the source code only needs to be sent to the country which receive the weapons. Include a

Re: [python-gtk] problem with multiple inheritance

2005-06-02 Thread Greg Ewing
Taki Jeden wrote: > class view_tree_model(gtk.GenericTreeModel,gtk.TreeSortable): > > raises a "TypeError: multiple bases have instance lay-out conflict" > Is this a bug in gtk, or python-gtk, or something? It's not a bug, it's a limitation of the way Python handles inheritance from built-in typ

For review: PEP 343: Anonymous Block Redux and Generator Enhancements

2005-06-02 Thread Guido van Rossum
After many rounds of discussion on python-dev, I'm inviting public comments for PEP 343. Rather than posting the entire PEP text here, I'm inviting everyone to read it on line (http://www.python.org/peps/pep-0343.html) and then post comments on a Wiki page I've created for this purpose (http://wiki

Re: Two questions

2005-06-02 Thread Greg Ewing
Andrew Dalke wrote: > You are the US government developing software to design/test the > next generation nuclear weapons system and don't want any other > country to use it. (GnuNuke?) Hmmm... if these are GPL weapons, if you want to fire them at anyone you'll *have* to make them available

Re: Two questions

2005-06-02 Thread Steven D'Aprano
John Machin wrote: >> In other words, to create your .pyc file, just run your .py file and >> Python will do it automatically. >> > > The notion that just running a .py file will create a .pyc file is > contrary to widely-held belief, and (admittedly small, but very recent, > on Python 2.4.1, i

Re: thread vs GC

2005-06-02 Thread Jeff Epler
I suspect that getting the threads to die will be tricky, and as written the thread holds a reference to the 'primegen' instance (this part can be cured, but it still doesn't ever make the thread exit). Instead of figuring out how to get this to clean itself up, why not make sure you only make one

Re: Looking for Image, Audio and Internet/Web HOTWO's or tutorials

2005-06-02 Thread rdsteph
try looking at http://www.awaretek.com/tutorials.html -- http://mail.python.org/mailman/listinfo/python-list

Re: thread vs GC

2005-06-02 Thread Chris Lambacher
You probably have one or more of several problems. If a __del__ method exists, the object might be stuck in the gc.garbage list. In general you are better off explicitly stopping it my adding a method that is called to set your threading.Event. Likely you will still be stuck waiting on your que

Re: optparse.py: FutureWarning error

2005-06-02 Thread kosuke
man python --- COMMAND LINE OPTIONS -c command Specify the command to execute (see next section). This terminates the option list (following options are passed as arguments to the command). -d Turn on parser debugging output (for wizards only, depen

Re: optparse.py: FutureWarning error

2005-06-02 Thread John Machin
Michael Hoffman wrote: > Terry Reedy wrote: > >> c) Check to see if Python has a startup option for suppressing warnings >> >> As to c) python -h gives a list indicating what I thought, that -W >> controls warnings, but gives insufficient info for me to use it, and I >> didn't find any more in t

Re: Beginner question: Logs?

2005-06-02 Thread Greg Ewing
Peter Hansen wrote: > It's always a good idea, especially when answering a beginner's > question, to add the caution that this form ("from xxx import *") has > certain dangers** associated with it, and is widely considered poor > style, and should really only rarely be used. Better still, don'

Re: optparse.py: FutureWarning error

2005-06-02 Thread Michael Hoffman
Terry Reedy wrote: > c) Check to see if Python has a startup option for suppressing warnings > > As to c) python -h gives a list indicating what I thought, that -W controls > warnings, but gives insufficient info for me to use it, and I didn't find > any more in the docs. I hope someone else c

Re: REQ: Small Perl to Python conversion needed

2005-06-02 Thread Steven Bethard
John Machin wrote: > freq_dict = {} > ... > if thing in freq_dict: > freq_dict[thing] += 1 > else: > freq_dict[thing] = 1 > > or, less plainly, > > freq_dict[thing] = freq_dict.get(thing, 0) + 1 or try: freq_dict[thing] += 1 except KeyError: freq_dict[thing] = 1 STeVe -- htt

Re: py2exe problems with win32com [ EnsureDispatch('ADODB.Connection') ]

2005-06-02 Thread Mudcat
Ok apparently that's not the fix. I just tried that with Python 2.4 and the newest version of py2exe and win32all, and I can not get it to work. Can someone explain how to freeze Excel with the new version of py2exe? The old way isn't working anymore. I used one of the templates provided, but I ke

Re: REQ: Small Perl to Python conversion needed

2005-06-02 Thread Ivan Van Laningham
Hi All-- John Machin wrote: > > > how to duplicate the following bit of code using Python dictionaries. > > > > [expletives deleted] > +1 QOTW Metta, Ivan -- Ivan Van Laningham God N Locomotive Works http://www.andi-holmes.com/ http://www.foretec.com

Re: REQ: Small Perl to Python conversion needed

2005-06-02 Thread John Machin
Koncept wrote: > Howdie Python folks! I am very new to Python ( 3rd day now ) and it has > already earned its place as my fav. language to work in. I hope to > continue, and I really would appreciate some good resources if anybody > would care to contribute. > > My current head-scratcher concerns

thread vs GC

2005-06-02 Thread Paul Rubin
Another of those "how can I kill a thread" questions. Let's say I have an app that needs a random prime number for something every now and then, based on user interaction. I have a function makeprime() which creates such a prime, but it's pretty slow, so I don't want to wait for it when the user

Re: odbc and python

2005-06-02 Thread John Machin
MM wrote: > Are there any other odbc packages other than the win32all and mxodbc > ones? The win32all odbc.pyd can't access table structure info like > SQLColumns, and mxobdc requires a commercial license which is > unjustifiable for this tiny project. Presumably you really mean 'are there any

Re: REQ: Small Perl to Python conversion needed

2005-06-02 Thread Steven Bethard
Koncept wrote: > #!/usr/bin/perl > > # Parse comma delimited lines and create a final frequency hash > # Real example would read a file line by line > my %dict = {}; > my @lines = ( "1,2,3,4,5", "2,3,4,5", "3,4,5", "4,5", "5" ); > foreach(@lines) { map( $dict{ $_ }++, split( "," ) ); } > foreach(

Re: Python 2.4 and BLT

2005-06-02 Thread dimitri pater
In the past (I was using tcl/tk to be more precise) I used Blt and I was very satisfied with it. But now I use Matplotlib for my Python apps. And it is amazing! You really should try it. I use it with PyGTK and it is truly wonderful. http://matplotlib.sourceforge.net/ DimitriOn 6/2/05, Lyddall's

Re: (OT) lincense protection generator

2005-06-02 Thread John Machin
flupke wrote: > I'm going to be distributing a program based on wxPython & python in a > few weeks time. The code will run on windows machines. > > Because i don't want the users to move the folders around or mess with > the program or taking copies home to fiddle with it, i was thinking of a >

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
"scrimp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Im using the winpython IDE to run that script for the unpacking the > email. The usage says unpackmail [options] msgfile. I type unpackmail > -d filename and it gives me a syntax error. What modifications did u do > to that mo

REQ: Small Perl to Python conversion needed

2005-06-02 Thread Koncept
Howdie Python folks! I am very new to Python ( 3rd day now ) and it has already earned its place as my fav. language to work in. I hope to continue, and I really would appreciate some good resources if anybody would care to contribute. My current head-scratcher concerns something I can do in Per

Re: The need to put "self" in every method

2005-06-02 Thread Aahz
In article <[EMAIL PROTECTED]>, Peter Maas <[EMAIL PROTECTED]> wrote: >Aahz schrieb: >>> >>>Because Python has no declarations there must be a different way to >>>indicate in which category an identifier falls. >[...] >> Any objection to swiping this for the FAQ? (Probably with some minor >> edit

Re: something like CPAN, PPMs?

2005-06-02 Thread Maurice LING
deelan wrote: > Maurice LING wrote: > >> Hi Alex, >> >> I am actually working on something like that as an academic project. >> At this stage, at least for the purpose of my scope, it will not be as >> extensive as CPAN but a set of mechanisms for the same effect for Python. > > > don't foget

odbc and python

2005-06-02 Thread MM
Are there any other odbc packages other than the win32all and mxodbc ones? The win32all odbc.pyd can't access table structure info like SQLColumns, and mxobdc requires a commercial license which is unjustifiable for this tiny project. Any other OS alternatives for win32?. Thanks. -- http://mai

Re: mac address

2005-06-02 Thread John Machin
[EMAIL PROTECTED] wrote: > Hello, > I am a newbie and i have problems filling an array with the mac address > read from the command line. > > The mac address is FF:FF:FF:FF:FF:FF > > options, args = parser.parse_args() > # options.d contains the address > destAddress = options.d > > data = array

Re: Formatting Time

2005-06-02 Thread John Machin
[EMAIL PROTECTED] top-posted: > May be > > sec = 2472 "%d:%02d:%02d" % (int(sec/360), int(sec % 360 /60), int(sec % 60)) > > '6:05:12' > Could you possibly have meant 3600 instead of 360? -- http://mail.python.org/mailman/listinfo/python-list

mac address

2005-06-02 Thread shama . bell
Hello, I am a newbie and i have problems filling an array with the mac address read from the command line. The mac address is FF:FF:FF:FF:FF:FF options, args = parser.parse_args() # options.d contains the address destAddress = options.d data = array('L', '\0' * 24) The array should contain the d

Re: Performance Issues please help

2005-06-02 Thread John Machin
Michael Spencer wrote: > minc, minr, maxc, maxr = box[e] > # note correction for c == 0 > # also Peter's simplification > box[e] = ( c and (c < minc and c or minc), >minr, >c > m

Re: (OT) lincense protection generator

2005-06-02 Thread Elliot Temple
Why not check if all files you use are in appropriate directories, but not worry about same computer? You could also use some kind of hash on all your files, and check that they haven't been changed using that (ie, do they still hash to the same value they are supposed to?). (I know very li

Re: optparse.py: FutureWarning error

2005-06-02 Thread Terry Reedy
"kosuke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I keep getting the following error/warning message when using the > python based program getmail4: > > /usr/lib/python2.3/optparse.py:668: FutureWarning: %u/%o/%x/%X of > negative int will return a signed string in Python 2.4 a

Re: (OT) lincense protection generator

2005-06-02 Thread flupke
Jarek Zgoda wrote: > flupke napisał(a): > >> I'm thinking of a function that will generate such a code and put it >> in a file. Then when the program starts it checks this file and checks >> the code in there with a code that it generates at that time again >> based for instance on the current

RE: Formatting Time

2005-06-02 Thread rochoa
May be >>> sec = 2472 >>> "%d:%02d:%02d" % (int(sec/360), int(sec % 360 /60), int(sec % 60)) '6:05:12' Regards -Mensaje original- De: Ognjen Bezanov [mailto:[EMAIL PROTECTED] Enviado el: Jueves, 02 de Junio de 2005 03:29 p.m. Para: python-list@python.org Asunto: Formatting Time I never

Re: how to retrieve info about print jobs

2005-06-02 Thread Roger Upole
There are functions for managing printers and print jobs in the win32print module from the Pywin32 package. Roger "Guy Lateur" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > We have several printers in our company network. I would like to know if it > is possibl

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread Peter Hansen
scrimp wrote: > OK i got past that syntax error I think. This is the error I am getting > nowAttributeError: 'NoneType' object has no attribute 'lower' All > Im reading is a text file of the email message with an attachment --zip > file Always post a *complete* traceback, with the line numbers

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
OK i got past that syntax error I think. This is the error I am getting nowAttributeError: 'NoneType' object has no attribute 'lower' All Im reading is a text file of the email message with an attachment --zip file -- http://mail.python.org/mailman/listinfo/python-list

Re: viewing generated images

2005-06-02 Thread Tim Flynn
Fredrik Lundh wrote: > Tim Flynn wrote: > >>def createWidgets(self): >>self.image_size = (50,50) >>self.pilim = Image.new( "1", self.image_size ) >> >># Generate a blank image >>f = lambda(x): 0 >>Image.eval( self.pilim, f ) > > I'm not sure what you t

Re: (OT) lincense protection generator

2005-06-02 Thread Jarek Zgoda
flupke napisał(a): > I'm thinking of a function that will generate such a code and put it in > a file. Then when the program starts it checks this file and checks the > code in there with a code that it generates at that time again based for > instance on the current directory and other compone

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
Im using the winpython IDE to run that script for the unpacking the email. The usage says unpackmail [options] msgfile. I type unpackmail -d filename and it gives me a syntax error. What modifications did u do to that module to make it work? -- http://mail.python.org/mailman/listinfo/python-list

(OT) lincense protection generator

2005-06-02 Thread flupke
I'm going to be distributing a program based on wxPython & python in a few weeks time. The code will run on windows machines. Because i don't want the users to move the folders around or mess with the program or taking copies home to fiddle with it, i was thinking of a way to check when the pro

Re: saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread John Roth
"scrimp" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How would I go about retriving an email message and stripping out the > attachment into a file. I have seen examples where they would read in > the file and delete the attachment and replace it with text saying that > the attac

saving .zip or .txt email attachments instead of deleting them

2005-06-02 Thread scrimp
How would I go about retriving an email message and stripping out the attachment into a file. I have seen examples where they would read in the file and delete the attachment and replace it with text saying that the attachment was removed. For testing purposes Im using a pop3 server to receive mes

Re: Formatting Time

2005-06-02 Thread Andrew Dalke
Ognjen Bezanov wrote: > I have a float variable representing seconds, and i want to format it > like this: > > 0:00:00 (h:mm:ss) >>> def format_secs(t): ... m, s = divmod(t, 60) ... h, m = divmod(m, 60) ... return "%d:%02d:%02d" % (h, m, s) ... >>> format_secs(0) '0:00:00' >>> format_sec

Re: Two questions

2005-06-02 Thread Andrew Dalke
Steven D'Aprano wrote: > I can think of a number of reasons why somebody might want to hide their > code. In no particular order: > (3) You have create an incredibly valuable piece of code that will be > worth millions, but only if nobody can see the source code. Yeah right. - id software makes

Re: Two questions

2005-06-02 Thread John Machin
Steven D'Aprano wrote: > On Thu, 02 Jun 2005 06:45:18 -0700, qscomputing wrote: > >>2. Philospohy(sp?) aside, > > > Philosophy. > > >>I could potentially want to create a >>binary-only distribution of my finished apps. I noticed the >>documentation on .pyc files: how do I create these > >

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Andreas Kostyrka
Am Donnerstag, den 02.06.2005, 17:52 + schrieb Karl A. Krueger: > Andreas Kostyrka <[EMAIL PROTECTED]> wrote: > > *) GPL is not acceptable for "library" stuff, because as a software > > developer I'm sometimes forced to do "closed" stuff. > > (Yep, even nowadays there are place where it's b

Python 2.4 and BLT

2005-06-02 Thread Lyddall's
Hello. I am new to this list, but wondered if anyone could help me. I have had Python set up with PMW and BLT on two machines previous to my current laptop, but I can't seem to get them all to work together on this machine. It may be the version of python (2.4, with TCL 8.4) that I have inst

Formatting Time

2005-06-02 Thread Ognjen Bezanov
I never thought id need help with such a thing as time formatting (admittadly i never did it before) but ok, i guess there is a first for everything. I have a float variable representing seconds, and i want to format it like this: 0:00:00 (h:mm:ss) Now search as I might i am finding this quite

Re: Two questions

2005-06-02 Thread John Machin
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > >> Thanks to you all for the quick response. >> >> I've noticed that when I do >> $ python myprog.py >> the file myprog.pyc file is not created, but the .pyc files for files I >> import *are* created. Is this intentional and, if so, how do I get the

Re: Two questions

2005-06-02 Thread qscomputing
> > 1. What is the easiest way to create a for loop in the style I'm used > > to from Delphi > > Use Delphi. Very literal interpretation of my text: I should have said "in a similar style to". :-) > I can think of a number of reasons why somebody might want to hide their > code. I can't really t

Re: date and time range checking

2005-06-02 Thread Andrew Dalke
Maksim Kasimov wrote: > there are few of a time periods, for example: > 2005-06-08 12:30 -> 2005-06-10 15:30, > 2005-06-12 12:30 -> 2005-06-14 15:30 > > and there is some date and time value: > 2005-06-11 12:30 > what is the "pythonic" way to check is the date/time value in th

JOB: Google.com Engineering

2005-06-02 Thread JPolo
Senior Software Engineer/Unix System & Network Administrator, Google.com (SRE) Positions available in: Mt.View, CA; Kirkland, WA; New York, NY; Zurich, Switzerland; and Dublin, Ireland We're looking for top-notch thrill seeking, python gurus to join the Google.com team. Google.com engineers are i

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

2005-06-02 Thread RunLevelZero
Jeff Epler wrote: > You're not going to find a single portable "unix" way of doing this. > The format of /etc/fstab and /etc/mtab are pretty portable, but they > only list mountable/mounted partitions, not all partitions. > > In addition to the linux possibilities mentioned in another reply, ther

Re: calling ksh script from python

2005-06-02 Thread Donn Cave
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Cameron Laird) wrote: > In article <[EMAIL PROTECTED]>, > Donn Cave <[EMAIL PROTECTED]> wrote: > . > . > . > >Meanwhile, it might be worthwhile to reconsider the use > >of ksh her

Re: PYSH? (was:Re: calling ksh script from python)

2005-06-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Paul McNett <[EMAIL PROTECTED]> wrote: . . . >I keep wondering how difficult it would be to make a Python shell that >exposes all of Python but also includes some builtin commands such as >cd,

Re: Unicode string in exec

2005-06-02 Thread John Roth
See below. -- "Jeff Epler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] First off, I just have to correct your terminology. "exec" is a statement, and doesn't require parentheses, so talking about "exec()" invites confusion. I'll answer your question in terms of eval

Re: date and time range checking

2005-06-02 Thread Peter Hansen
Maksim Kasimov wrote: > what is the "pythonic" way to check is the date/time value in the given > periods range? Something like this, though I won't make strong claims of "pythonicness". If you want to use the "in" keyword you'll want a custom class and overriding of __contains__. import time

Re: PYSH? (was:Re: calling ksh script from python)

2005-06-02 Thread Fernando Perez
Paul McNett wrote: > Cameron Laird wrote: >> Infidel. While I sure feel that way about csh(1), it >> surprises me you'd criticize ksh(1) so. 'Fact, 'mong >> all the *sh-s, I *recommend* ksh for programming. May- >> be the two of us see things differently. > > I keep wondering how difficult it

date and time range checking

2005-06-02 Thread Maksim Kasimov
there are few of a time periods, for example: 2005-06-08 12:30 -> 2005-06-10 15:30, 2005-06-12 12:30 -> 2005-06-14 15:30 and there is some date and time value: 2005-06-11 12:30 what is the "pythonic" way to check is the date/time value in the given periods range? someth

Re: Performance Issues please help

2005-06-02 Thread Michael Spencer
Michael Spencer wrote: > def search1(m): > box = {} > for r,row in enumerate(m): > for c,e in enumerate(row): > try: > minc, minr, maxc, maxr = box[e] > box[e] = ( c < minc and c or minc, > r < minr and

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

2005-06-02 Thread Jeff Epler
You're not going to find a single portable "unix" way of doing this. The format of /etc/fstab and /etc/mtab are pretty portable, but they only list mountable/mounted partitions, not all partitions. In addition to the linux possibilities mentioned in another reply, there is also /proc/partitions.

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Karl A. Krueger
Andreas Kostyrka <[EMAIL PROTECTED]> wrote: > *) GPL is not acceptable for "library" stuff, because as a software > developer I'm sometimes forced to do "closed" stuff. > (Yep, even nowadays there are place where it's basically a legal >requirement.) I'm curious about this last one. The G

Looking for Image, Audio and Internet/Web HOTWO's or tutorials

2005-06-02 Thread CPUFreak91
The Python Tutorials don't suply me with enough info and examples. If you know of any python tutorials or howto's please tell me, but preferably the Audio, Image, and Internet/Web ones. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: TkInter Listbox Widget Formatting

2005-06-02 Thread Jeff Epler
This isn't an option in the stock Tk listbox or any of the alternatives I know of offhand (bwidget ListBox, TixTList). The TkTable widget, which can also display multiple columns, can select different justifications, either for the whole table, or for single cells. I've never used TkTable with Pyt

Re: Unicode string in exec

2005-06-02 Thread Jeff Epler
First off, I just have to correct your terminology. "exec" is a statement, and doesn't require parentheses, so talking about "exec()" invites confusion. I'll answer your question in terms of eval(), which takes a string representing a Python expression, interprets it, and returns the result. In

Re: python 2.4: tarfile tell() and seek() seem to be broeken

2005-06-02 Thread N. Volbers
Am Thu, 02 Jun 2005 17:57:20 +0200 schrieb Lars Gustäbel: > On Wed, 01 Jun 2005 14:58:23 +0200, N. Volbers wrote: > >> - subsequent calls of fd.readline() and fd.tell() will yield the correct >> lines but always the same value from fd.tell(). [...] > > Thank you for pointing that out. I'll tak

New mailing list to discuss Google Summer of Code

2005-06-02 Thread David Ascher
In order to centralize discussion and minimize spam, we've created a new mailing list to discuss the Google Summer of Code from a Python POV. I strongly encourage people interested in discussing possible projects, people who'd be willing to help students this summer as mentors, and any students co

Re: Beginner question: Logs?

2005-06-02 Thread Terry Reedy
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Elliot Temple wrote: >> from math import * >> log10(15625) > > It's always a good idea, especially when answering a beginner's > question, to add the caution that this form ("from xxx import *") has > certain dangers** a

Re: Beginner question: Logs?

2005-06-02 Thread Terry Reedy
> import math > math.log10(15625) To find out the names of function in the math module without checking the docs, do >>> dir(math) #same for any other module To get more info, do >>> help(math) # same for any other module with a doc string Terry J. Reedy -- http://mail.python.org/mailman

PYSH? (was:Re: calling ksh script from python)

2005-06-02 Thread Paul McNett
Cameron Laird wrote: > Infidel. While I sure feel that way about csh(1), it > surprises me you'd criticize ksh(1) so. 'Fact, 'mong > all the *sh-s, I *recommend* ksh for programming. May- > be the two of us see things differently. I keep wondering how difficult it would be to make a Python shel

Re: calling ksh script from python

2005-06-02 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Donn Cave <[EMAIL PROTECTED]> wrote: . . . >Meanwhile, it might be worthwhile to reconsider the use >of ksh here, if you have any choice in the matter. Ksh >is fine for interactive use, but has

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

2005-06-02 Thread Peter Hansen
RunLevelZero wrote: > 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. os.popen('/sbin/sfdisk -l /dev/hda') etc.

Re: PYTHONSTARTUP and the -i command line option

2005-06-02 Thread Peter Hansen
Christopher Wood wrote: > But these two things won't play together, as (by design, it seems) > $PYTHONSTARTUP isn't read when the -i option is used, leaving me with an > unenhanced Python interpreter environment after after script execution. > > Is the any way round this, other than editing all

Re: Performance Issues please help

2005-06-02 Thread Michael Spencer
PyPK wrote: > Yep that improved the speed by about 50% now it takes about 10 secs > instead of 24 seconds..Thanks much. I guess that is the best we could > do right.It would be really helpful if I could get it less than 5 > seconds. Any suggestions on that?? > Things to try: * in-lining the min a

Re: wxPython

2005-06-02 Thread Peter Hansen
Michael wrote: > Hi, > I've got a question about wxPython, wheres the best place to ask?? The wxPython mailing list. Visit www.wxpython.org to find it and more. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >