Re: while-loops enter the last time after condition is filled?

2008-04-06 Thread Sumit
On Apr 6, 4:53 am, [EMAIL PROTECTED] wrote: > it seems to me from my results that when i use a while-loop it will > execute once after the condition is met. Perhaps your condition is wrong. Please provide the code where this occured. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get an XML DOM while offline?

2008-04-06 Thread Fredrik Lundh
Stefan Behnel wrote: >> Is there a simpler way to read the iTunes XML? (It's merely a plist, >> so the format is much simpler than general XML.) > > Try lxml. Since version 2.0, its parsers will not access the network unless > you tell it to do so. > > http://codespeak.net/lxml which makes it t

Getting jabber:iq:last with xmpppy

2008-04-06 Thread georgeencina
Hi, I'm trying to do the following with the xmpppy library: - log on to the google jabber server - get idle time of one specific person on my roster. Idle time means the values of jabber:iq:last. When I do this in pidgin with the xmpp console open, I get the following conversation: (me)

Re: Python Data Utils

2008-04-06 Thread Jesse Aldridge
> Docstrings go *after* the def statement. Fixed. > changing "( " to "(" and " )" to ")". Changed. I attempted to take out everything that could be trivially implemented with the standard library. This has left me with... 4 functions in S.py. 1 one of them is used internally, and the others a

Re: How to get an XML DOM while offline?

2008-04-06 Thread Stefan Behnel
william tanksley wrote: > I want to parse my iTunes Library xml. All was well, until I unplugged > and left for the train (where I get most of my personal projects > done). All of a sudden, I discovered that apparently the presence of a > DOCTYPE in the iTunes XML makes xml.dom.minidom insist on ac

Re: html DOM

2008-04-06 Thread Stefan Behnel
Sam the Cat wrote: > Is there a package that would allow me the same or similar functionality > for modifying html code via the DOM model as I have in JavaScript ? I'd > like to parse an html file, then modify it and save the result. I am > not trying to do this online, rather I would like to do

Re: Parsing HTML?

2008-04-06 Thread Stefan Behnel
Benjamin wrote: > I'm trying to parse an HTML file. I want to retrieve all of the text > inside a certain tag that I find with XPath. The DOM seems to make > this available with the innerHTML element, but I haven't found a way > to do it in Python. import lxml.html as h tree = h.parse("s

Re: splitting an XML file on the basis on basis of XML tags

2008-04-06 Thread Stefan Behnel
[EMAIL PROTECTED] schrieb: > Hi all, > > i have an XML file with the following structure:: > > > -| > | > | > . | > . | > constitutes one record. > . | > . | > . | > | > | > | > > .

Re: how to do "load script; run script" in a loop in embedded python?

2008-04-06 Thread Gabriel Genellina
En Thu, 03 Apr 2008 20:52:31 -0300, <[EMAIL PROTECTED]> escribió: > Hi, all, > > I am currently involved in a project that needs to load/run a python > script dynamically in a C application. The sample code is as > following: > > PyObject *LoadScript(char *file, char *func) > { > PyObject *pNa

Adherence to PEP 8 for published code (was: ANN: pry unit testing framework)

2008-04-06 Thread Ben Finney
Aldo Cortesi <[EMAIL PROTECTED]> writes: > Thus spake Ben Finney ([EMAIL PROTECTED]): > > > > I'm afraid that Pry is unashamedly incompatible with any other unit > > > testing method in existence, including but not limited to doctest, > > > unittest, nose and py.test. ;) I didn't write this. Ple

Re: Help replacing os.system call with subprocess call

2008-04-06 Thread David Harrison
On 07/04/2008, David Harrison <[EMAIL PROTECTED]> wrote: > On 07/04/2008, David Pratt <[EMAIL PROTECTED]> wrote: > > Hi. I am trying to replace a system call with a subprocess call. I have > > tried subprocess.Popen and subprocess.call with but have not been > > successful. The command line wo

Re: Help replacing os.system call with subprocess call

2008-04-06 Thread David Harrison
On 07/04/2008, David Pratt <[EMAIL PROTECTED]> wrote: > Hi. I am trying to replace a system call with a subprocess call. I have > tried subprocess.Popen and subprocess.call with but have not been > successful. The command line would be: > > svnadmin dump /my/repository > svndump.db > > This is

Re: Learning curve for new database program with Python?

2008-04-06 Thread CM
On Apr 5, 11:50 am, Jetus <[EMAIL PROTECTED]> wrote: > I have a need for a database program. I downloaded the db2 from ibm, > and reviewed some of the documentation. > > My question is, what is the easiest program for me to try to learn. I > will be creating a database of about 25,000 records, it w

Help replacing os.system call with subprocess call

2008-04-06 Thread David Pratt
Hi. I am trying to replace a system call with a subprocess call. I have tried subprocess.Popen and subprocess.call with but have not been successful. The command line would be: svnadmin dump /my/repository > svndump.db This is what I am using currently: os.system('svnadmin dump %s > %s' % (svn

Re: Learning curve for new database program with Python?

2008-04-06 Thread CM
On Apr 5, 11:50 am, Jetus <[EMAIL PROTECTED]> wrote: > I have a need for a database program. I downloaded the db2 from ibm, > and reviewed some of the documentation. > > My question is, what is the easiest program for me to try to learn. I > will be creating a database of about 25,000 records, it w

Re: ANN: pry unit testing framework

2008-04-06 Thread Aldo Cortesi
Thus spake Steve Holden ([EMAIL PROTECTED]): > It probably reflects personal preference, but it's a preference that > many people will maintain. I understand that PEP 008 was largely > directed at standard library authors and maintainers, but anything > that claims wide utility should have ambiti

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread 7stud
On Apr 6, 8:50 pm, [EMAIL PROTECTED] wrote: > should i not use self. in Clean() and Calculate() either? > You probably shouldn't be using classes at all. When you are trying to learn the basics of a language, you don't want to complicate things further with classes. Copying a program off the int

Re: ANN: pry unit testing framework

2008-04-06 Thread Aldo Cortesi
Thus spake Roy Smith ([EMAIL PROTECTED]): > I've been following this thread for a while with a mix of amusement and > alarm. Contributing code to the community is a good thing, and should be > celebrated. If people like it, they will use it. If they don't, it will > be ignored. None of whic

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread skanemupp
should i not use self. in Clean() and Calculate() either? anyway i had changed it before. must have copied the wrong program. #! /usr/bin/env python from Tkinter import * import tkMessageBox class GUIFramework(Frame): """This is the GUI""" def __init__(self, master=None): """I

Re: When does a binary extension gets the file extension '.pyd' and when is it '.so'

2008-04-06 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > >>> for reference, here's what I get on Ubuntu 7.10, with the standard >>> Python interpreter (2.5.1): >>> >>> $ python -c "import imp; print imp.get_suffixes()" >>> [('.so', 'rb', 3), ('module.so', 'rb', 3), ('.py', 'U', 1), >>> ('.pyc', 'rb', 2)] >>>

Re: ANN: pry unit testing framework

2008-04-06 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Aldo Cortesi <[EMAIL PROTECTED]> wrote: > I should also note that converting from unittest to Pry is quite simple > - Pry's test structure is a superset of unittest's, and AutoTree was > explicitly written to make "unittest-style" testing possible, meaning > that n

Re: ANN: pry unit testing framework

2008-04-06 Thread Steve Holden
Aldo Cortesi wrote: > Thus spake Ben Finney ([EMAIL PROTECTED]): > >>> I'm afraid that Pry is unashamedly incompatible with any other unit >>> testing method in existence, including but not limited to doctest, >>> unittest, nose and py.test. ;) >> Which makes the deliberate deviations from PEP 8 n

Re: ANN: pry unit testing framework

2008-04-06 Thread Aldo Cortesi
Thus spake Ben Finney ([EMAIL PROTECTED]): > > I'm afraid that Pry is unashamedly incompatible with any other unit > > testing method in existence, including but not limited to doctest, > > unittest, nose and py.test. ;) > > Which makes the deliberate deviations from PEP 8 naming a large black >

Re: sine in python

2008-04-06 Thread Carl Banks
On Apr 6, 5:10 pm, Mark Wooding <[EMAIL PROTECTED]> wrote: > Astan Chee <[EMAIL PROTECTED]> wrote: > > I have a math function that looks like this > > sin (Theta) = 5/6 > > How do I find Theta (in degrees) in python? > > import math > theta = math.asin(5/6) * 180/math.pi Careful there, bud. 5/6

RE: ANN: pry unit testing framework

2008-04-06 Thread Ryan Ginstrom
> On Behalf Of Ben Finney > Aldo Cortesi <[EMAIL PROTECTED]> writes: > > Some day I might experiment with extending Pry to gather and run > > doctests and unittests. At this stage, however, I don't believe the > > (significant) effort would be worth it. > > That's very unfortunate. Until it plays

Re: appropriate python version

2008-04-06 Thread hdante
On Apr 6, 5:59 pm, xamdam <[EMAIL PROTECTED]> wrote: > Thanks. I am guessing the 32bit build should work anyways, same as > other 32 progs on XP 64? The right build should be the "amd64" one. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: pry unit testing framework

2008-04-06 Thread Ben Finney
Aldo Cortesi <[EMAIL PROTECTED]> writes: > I'm afraid that Pry is unashamedly incompatible with any other unit > testing method in existence, including but not limited to doctest, > unittest, nose and py.test. ;) Which makes the deliberate deviations from PEP 8 naming a large black mark against i

Re: Tkinter, repaint?, keep size?

2008-04-06 Thread jim-on-linux
On Sunday 06 April 2008 20:12, jim-on-linux wrote: > On Sunday 06 April 2008 13:24, > > [EMAIL PROTECTED] wrote: > > so my calculator is almost done for u > > that have read my previous posts. > > i have some minor problems i have to fix > > though. > > > > *one is i need to repaint once i have >

Re: py.test and test coverage analysis ?

2008-04-06 Thread Osmo Salomaa
On ke, 2008-04-02 at 11:23 -0600, j vickroy wrote: > Could someone offer a suggestion on how to combine coverage analysis > with py.test. Use the '-x' option to coverage.py to run py.test, then '-rm' to view the results. I use about the following shell script; additionally I find some grepping o

Re: Tkinter, repaint?, keep size?

2008-04-06 Thread jim-on-linux
On Sunday 06 April 2008 13:24, [EMAIL PROTECTED] wrote: > so my calculator is almost done for u that > have read my previous posts. > i have some minor problems i have to fix > though. > > *one is i need to repaint once i have > performed a calculation so that the old > results are not left on the

Re: ANN: pry unit testing framework

2008-04-06 Thread Aldo Cortesi
Thus spake Matthieu Brucher ([EMAIL PROTECTED]): > One last question : does it take doctests into account ? I'm afraid that Pry is unashamedly incompatible with any other unit testing method in existence, including but not limited to doctest, unittest, nose and py.test. ;) Some day I might exper

Re: Prevent GUI layout from changing?

2008-04-06 Thread skanemupp
On 6 Apr, 22:15, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 06 Apr 2008 15:12:55 -0300, <[EMAIL PROTECTED]> escribió: > > I can't help with your sizing problem, I don't know grids. But don't do > this: > > > def Display(self, number): > > self.expr = self.expr + number > >

Re: Python Data Utils

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 11:34:11 -0300, Jesse Aldridge <[EMAIL PROTECTED]> escribió: > On Apr 6, 6:14 am, "Konstantin Veretennicov" <[EMAIL PROTECTED]> > wrote: >> On Sun, Apr 6, 2008 at 7:43 AM, Jesse Aldridge >> <[EMAIL PROTECTED]> wrote: >> > In an effort to experiment with open source, I put a

Re: why does socket.makefile require non-blocking mode?

2008-04-06 Thread greg
Forest wrote: > I guess you mean that since _fileobject.read() calls recv() multiple > times, the second and later calls might block even if select() said the > socket was > readable. The main problem is buffering. The select() may block on the socket even though the file object has data in its bu

Re: read large zip file

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 19:20:31 -0300, Brian Blais <[EMAIL PROTECTED]> escribió: > I need to read a series of large zipfiles (which only contain one > large text file), and I noticed that the zipfile module: > > 1) has a read method which isn't an iterator, and returns the entire > file selected al

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread 7stud
On Apr 6, 4:12 pm, 7stud <[EMAIL PROTECTED]> wrote: > You said you were an experienced programmer, but you keep posting code > with the same mistakes over and over again.  Why are you attaching the > buttons to self? Remember this: > Another thing you should be aware of: self is like a class wide

read large zip file

2008-04-06 Thread Brian Blais
Hello, I need to read a series of large zipfiles (which only contain one large text file), and I noticed that the zipfile module: 1) has a read method which isn't an iterator, and returns the entire file selected all at once 2) has no readlines method, and no obvious way to implement one

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread 7stud
On Apr 6, 1:59 pm, [EMAIL PROTECTED] wrote: > is there anyway to make this shorter? i hate having these big blocks > of similar-looking code, very unaesthetic. > maybe doesnt matter good-code-wise? > anyway can i make some function that makes this shorter? > like put the etiquettes on the button fr

Re: A funnily inconsistent behavior of int and float

2008-04-06 Thread Mark Dickinson
On Apr 6, 1:29 pm, Lie <[EMAIL PROTECTED]> wrote: > I've noticed some oddly inconsistent behavior with int and float: > > Python 2.5.1 (r251:54863, Mar  7 2008, 03:39:23) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2>>> > int('-          345') > > -345 > > works, but > > >

Re: Python Data Utils

2008-04-06 Thread John Machin
On Apr 7, 12:32 am, Jesse Aldridge <[EMAIL PROTECTED]> wrote: > Thanks for the detailed feedback. I made a lot of modifications based > on your advice. Mind taking another look? > > > Some names are a bit obscure - "universify"? > > Docstrings would help too, and blank lines > > I changed the nam

Re: How to create an exe-file?

2008-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > a good thing about python is the portability though. but u cant make > an exe that can be used on mac too, ie one exe fpr both? you can create a portable python archive, but EXE files are windows only. > if i want to make an exe for mac, what do i need? see the second

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
>>> Or hexdigest_string.decode('hex') >> I would advise against this, as it's incompatible with Python 3. > > I didn't know that, you actually made me look it up in the Python 3 > FAQ. And yes, the difference is that decode will return bytes type > instead of a string. No. The decode method on st

Re: sine in python

2008-04-06 Thread Mark Wooding
Astan Chee <[EMAIL PROTECTED]> wrote: > I have a math function that looks like this > sin (Theta) = 5/6 > How do I find Theta (in degrees) in python? import math theta = math.asin(5/6) * 180/math.pi -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread marek . rocki
Martin v. Löwis napisał(a): > > Or hexdigest_string.decode('hex') > > I would advise against this, as it's incompatible with Python 3. I didn't know that, you actually made me look it up in the Python 3 FAQ. And yes, the difference is that decode will return bytes type instead of a string. This ma

Re: How to create an exe-file?

2008-04-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > On 6 Apr, 22:50, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> how do you create exe-files of your python-code? >>> is it different depending on what libraries, GUI-frameworks you use? >>> i want to create an exe-file of a pythonscript that us

Re: How to create an exe-file?

2008-04-06 Thread skanemupp
On 6 Apr, 22:50, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > how do you create exe-files of your python-code? > > > is it different depending on what libraries, GUI-frameworks you use? > > > i want to create an exe-file of a pythonscript that uses Tkinter. > > assuming w

Re: A funnily inconsistent behavior of int and float

2008-04-06 Thread Colin J. Williams
Grant Edwards wrote: > On 2008-04-06, Lie <[EMAIL PROTECTED]> wrote: > >> I've noticed some oddly inconsistent behavior with int and float: >> >> Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) >> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > int('- 345') >>

Re: appropriate python version

2008-04-06 Thread xamdam
Thanks. I am guessing the 32bit build should work anyways, same as other 32 progs on XP 64? -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.6a2 and 3.0a4

2008-04-06 Thread John Machin
On Apr 7, 12:50 am, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 6 Apr, 00:55, John Machin <[EMAIL PROTECTED]> wrote: > > > On Apr 5, 5:45 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > > The Windows x86 MSI installer is missing for both 2.6 and 3.0. > > > > And likely will continu

Re: How to create an exe-file?

2008-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > how do you create exe-files of your python-code? > > is it different depending on what libraries, GUI-frameworks you use? > > i want to create an exe-file of a pythonscript that uses Tkinter. assuming windows only, you want: http://www.py2exe.org/ also see: http://

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread Peter Otten
[EMAIL PROTECTED] wrote: > is there anyway to make this shorter? i hate having these big blocks > of similar-looking code, very unaesthetic. > maybe doesnt matter good-code-wise? > anyway can i make some function that makes this shorter? > like put the etiquettes on the button froma string of > '1

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
Sorry to reply to myself. By reading the whole document I see he does give a few different ways one can hadle the lack of padding (including adding it back in.) Both the specs. seem to fudge a bit on this...I'll have to think more about it. On Apr 6, 5:40 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTE

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
Gabriel... I looked at Zooko's encoding. I didn't really like that the first 16 characters weren't the same as for base 16, [0-9a-f]. I hadn't considered the need for padding. Zooko doesn't seem to use it either. How does he get around it? Thanks p.s. Paul...yes it is different. :) On Apr

How to create an exe-file?

2008-04-06 Thread skanemupp
how do you create exe-files of your python-code? is it different depending on what libraries, GUI-frameworks you use? i want to create an exe-file of a pythonscript that uses Tkinter. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | is there anyway to make this shorter? i hate having these big blocks | of similar-looking code, very unaesthetic. | maybe doesnt matter good-code-wise? | anyway can i make some function that makes this shorter? | like put the etiquette

Re: traceback.print_exc() supposed to stop exception propagation.

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 16:16:46 -0300, Sami <[EMAIL PROTECTED]> escribió: > In the Python book that I am using to learn the language it says that > the traceback.print_exc() can be used to stop exception propagation and > make the program keep running. Either the book is wrong or you have misinter

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
> Or hexdigest_string.decode('hex') I would advise against this, as it's incompatible with Python 3. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: traceback.print_exc() supposed to stop exception propagation.

2008-04-06 Thread Terry Reedy
"Sami" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Hello, | | In the Python book that I am using to learn the language it says that | the traceback.print_exc() can be used to stop exception propagation and | make the program keep running. It is possible that the unspecified boo

Re: Prevent GUI layout from changing?

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 15:12:55 -0300, <[EMAIL PROTECTED]> escribió: I can't help with your sizing problem, I don't know grids. But don't do this: > def Display(self, number): > self.expr = self.expr + number > self.lbText = Label(self, text=self.expr) > self.lbText.gri

Re: How To Uses Modules And Plugins

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 14:28:44 -0300, <[EMAIL PROTECTED]> escribió: > I am working on a client/server, computer role-play game using Python. > I want to gradually expand the game world by creating maps as > individual py files in a map directory. I am a little foggy of how to > do this. I have read

Odd PyQt4 crash on exit when importing on windows

2008-04-06 Thread Chris Bergstresser
Hi all -- I'm having an odd import issue with PyQt4. If I create two files, like so --- xbomb.py --- from PyQt4.QtGui import * import sys, ybomb app = QApplication(sys.argv) if __name__ == "__main__": main_win = QMainWindow() main_win.show() sys.exit(qApp.exec

Tkinter, a lot of buttons, make prog shorter?

2008-04-06 Thread skanemupp
is there anyway to make this shorter? i hate having these big blocks of similar-looking code, very unaesthetic. maybe doesnt matter good-code-wise? anyway can i make some function that makes this shorter? like put the etiquettes on the button froma string of '123+456-789*0Cr/' ? problem is the comm

Re: traceback.print_exc() supposed to stop exception propagation.

2008-04-06 Thread Diez B. Roggisch
Sami schrieb: > Hello, > > In the Python book that I am using to learn the language it says that > the traceback.print_exc() can be used to stop exception propagation and > make the program keep running. > > Here is a simple piece of code that I typed in to test this fact: > ---

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread marek . rocki
Martin v. Löwis napisał(a): > > How can convert string from sha1.hexdigest() to string that is the > > same, like from sha1.digest() > > Use binascii.unhexlify. > > HTH, > Martin Or hexdigest_string.decode('hex') -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Leo 4.4.8 final

2008-04-06 Thread Ville Vainio
On Apr 6, 8:10 pm, "Edward K Ream" <[EMAIL PROTECTED]> wrote: > - Completed ILeo: a bridge between IPython and Leo. > See http://webpages.charter.net/edreamleo/IPythonBridge.html Additional note: to use ILeo, you need a new IPython. Download the not- yet-blessed release candidate (I don't fores

traceback.print_exc() supposed to stop exception propagation.

2008-04-06 Thread Sami
Hello, In the Python book that I am using to learn the language it says that the traceback.print_exc() can be used to stop exception propagation and make the program keep running. Here is a simple piece of code that I typed in to test this fact: -

Re: A funnily inconsistent behavior of int and float

2008-04-06 Thread Grant Edwards
On 2008-04-06, Lie <[EMAIL PROTECTED]> wrote: > I've noticed some oddly inconsistent behavior with int and float: > > Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 int('- 345') > -345 > > works, IMO, it oughtn

Prevent GUI layout from changing?

2008-04-06 Thread skanemupp
when i added the results-LABEL the buttons have changed place. meh why cant i just put buttons and stuff on a specific coordinate and have them staying there? #! /usr/bin/env python from Tkinter import * import tkMessageBox class GUIFramework(Frame): """This is the GUI""" def __init__

subprocess end

2008-04-06 Thread John Deas
Hi, I am coding a small script to batch-convert flv files. At the core of it, mencoder is called through processString='mencoder -oac lavc -ovc lavc -of lavf -lavcopts aglobal=1:vglobal=1:vcodec=mpeg4:acodec=libfaac:vbitrate=256:abitrate=64 -lavfopts format=mp4 -ofps 15 -vf scale=320:240,harddup

Re: How To Uses Modules And Plugins

2008-04-06 Thread Lie
On Apr 7, 12:28 am, [EMAIL PROTECTED] wrote: > I am working on a client/server, computer role-play game using Python. > I want to gradually expand the game world by creating maps as > individual py files in a map directory. I am a little foggy of how to > do this. I have read about the __import__()

Graph, Math and Stats Online Software

2008-04-06 Thread Dexter
have designed and developed Graphing tools and Math/Stats online software that is available on internet. Most of my visitor are from US academia. The list of programs include the following 1. Graphing Rectangular 2D 2. Graphing Rectangular 3D 3. Graphing Polar 4. Graphing 2D Parametric curves 5.

Re: @x.setter property implementation

2008-04-06 Thread Daniel Fetchinson
> I found out about the new methods on properties, .setter() > and .deleter(), in python 2.6. Obviously that's a very tempting > syntax and I don't want to wait for 2.6... > > It would seem this can be implemented entirely in python code, and I > have seen hints in this directrion. So before I go

Re: append to a sublist - please help

2008-04-06 Thread Lie
On Apr 6, 11:16 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Hi, > > I must be blind but I don't see what's going wrong > with The reason is: > G=[[]]*2 is doing a "shallow copy" of the blank list. The corrected code is either: G = [[] for _ in xrange(2)] or G = [[], []] btw, this is a

A funnily inconsistent behavior of int and float

2008-04-06 Thread Lie
I've noticed some oddly inconsistent behavior with int and float: Python 2.5.1 (r251:54863, Mar 7 2008, 03:39:23) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 >>> int('- 345') -345 works, but >>> float('- 345.083') Traceback (most recent call last): File

How To Uses Modules And Plugins

2008-04-06 Thread marion
I am working on a client/server, computer role-play game using Python. I want to gradually expand the game world by creating maps as individual py files in a map directory. I am a little foggy of how to do this. I have read about the __import__() function. I want to understand what the difference i

Tkinter, repaint?, keep size?

2008-04-06 Thread skanemupp
so my calculator is almost done for u that have read my previous posts. i have some minor problems i have to fix though. *one is i need to repaint once i have performed a calculation so that the old results are not left on the screen. cant find a method for that. *another is now when i write the

ANN: Leo 4.4.8 final

2008-04-06 Thread Edward K Ream
Leo 4.4.8 final is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 This version features a new ipython plugin that provides a two-way bridge between Leo and IPython. See http://webpages.charter.net/edreamleo/IPythonBridge.html Leo is a text editor,

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Anyone know of a Python implementation of this: > http://www.crockford.com/wrmg/base32.html Is that different from the base32 encoding already in the base64 module? http://docs.python.org/lib/module-base64.html -- http://mail.python.org/mailman/

Re: Presumably an import is no faster or slower than opening a file?

2008-04-06 Thread Paul McGuire
On Apr 6, 8:41 am, [EMAIL PROTECTED] wrote: > I'm trying to minimise the overheads of a small Python utility, I'm > not really too fussed about how fast it is but I would like to > minimise its loading effect on the system as it could be called lots > of times (and, no, I don't think there's an eas

Re: append to a sublist - please help

2008-04-06 Thread Arnaud Delobelle
On Apr 6, 5:16 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > Hi, > > I must be blind but I don't see what's going wrong > with > > G=[[]]*2 > > G[0].append('A') > G[1].append('B') > print G[0] > > gives > > ['A', 'B'] > > as well as > print G[1] > > I was expecting > ['A'] > and > ['B'] > respec

Re: A file iteration question/problem

2008-04-06 Thread Arnaud Delobelle
On Apr 6, 4:40 pm, [EMAIL PROTECTED] wrote: > I want to iterate through the lines of a file in a recursive function > so I can't use:- > >     f = open(listfile, 'r') >     for ln in f: > > because when the function calls itself it won't see any more lines in > the file.  E.g. more fully I want to

@x.setter property implementation

2008-04-06 Thread Floris Bruynooghe
Hello I found out about the new methods on properties, .setter() and .deleter(), in python 2.6. Obviously that's a very tempting syntax and I don't want to wait for 2.6... It would seem this can be implemented entirely in python code, and I have seen hints in this directrion. So before I go and

append to a sublist - please help

2008-04-06 Thread Helmut Jarausch
Hi, I must be blind but I don't see what's going wrong with G=[[]]*2 G[0].append('A') G[1].append('B') print G[0] gives ['A', 'B'] as well as print G[1] I was expecting ['A'] and ['B'] respectively. Many thanks for enlightening me, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mat

Re: Presumably an import is no faster or slower than opening a file?

2008-04-06 Thread tinnews
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On 6 avr, 15:41, [EMAIL PROTECTED] wrote: > > I'm trying to minimise the overheads of a small Python utility, I'm > > not really too fussed about how fast it is but I would like to > > minimise its loading effect on the system as it could be called lot

Re: Best way to check if string is an integer?

2008-04-06 Thread bowman
Jorgen Grahn wrote: > [0] There would have been more if Python had supported hexadecimal > floating-point literals, like (I believe) C does. C99 does. On the other hand, it isn't a feature I sorely missed during the first 20 years or so of C's history, but you could always do some creative byte t

Re: appropriate python version

2008-04-06 Thread Michael Torrie
xamdam wrote: > Sorry if this is a stupid q, > I am trying to figure out the appropriate version of Python(2.4 or > 2.5) for an XP 64 system running on an Intel Core2 Quad. Python.org > has a to a 64bit build, but it specifies Itanium as the target. Should > I just be using the regular build? Itan

A file iteration question/problem

2008-04-06 Thread tinnews
I want to iterate through the lines of a file in a recursive function so I can't use:- f = open(listfile, 'r') for ln in f: because when the function calls itself it won't see any more lines in the file. E.g. more fully I want to do somthing like:- def recfun(f) while True:

Re: Presumably an import is no faster or slower than opening a file?

2008-04-06 Thread [EMAIL PROTECTED]
On 6 avr, 15:41, [EMAIL PROTECTED] wrote: > I'm trying to minimise the overheads of a small Python utility, I'm > not really too fussed about how fast it is but I would like to > minimise its loading effect on the system as it could be called lots > of times (and, no, I don't think there's an easy

анти-целлюлитные банки (масс ажные вакуумные банки)

2008-04-06 Thread Золотой Клон
Вакуумные масажные баночки <<Чудо-банка>> применяется при терапии и профилактике простудных и воспалительных болезней , таких как пневмония, плеврит, бронхит, бронхиальная астма; радикулит, миозит, невралгия, неврит, хондроз , а также при терапии целлюлита. <<Чудо-банка>> незаменима при проведении

Re: Is there any way to say ignore case with "in"?

2008-04-06 Thread Paul McGuire
On Apr 6, 8:53 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> I know I could use:- > > >>     if lower(string1) in lower(string2): > >>         > > >> but it somehow feels there ought to be an easier (tidier?) way. > > > Easier?  You mean like some kind of mind meld? > > Interestingly enoug

Re: Is there any way to say ignore case with "in"?

2008-04-06 Thread ijoshua
On Apr 5, 7:14 am, Steve Holden <[EMAIL PROTECTED]> wrote: > 7stud wrote: > > > Easier?  You mean like some kind of mind meld? > > That's right, DWIM mode Python. Rock on! If it is common enough, define a custom type of string. I have appended a simple version that should work for your example of

Re: RELEASED Python 2.6a2 and 3.0a4

2008-04-06 Thread Giampaolo Rodola'
On 6 Apr, 00:55, John Machin <[EMAIL PROTECTED]> wrote: > On Apr 5, 5:45 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > > The Windows x86 MSI installer is missing for both 2.6 and 3.0. > > > And likely will continue to do so for some time. > > Someone's got strange definitions of "missing"!

Re: Python Data Utils

2008-04-06 Thread Jesse Aldridge
On Apr 6, 6:14 am, "Konstantin Veretennicov" <[EMAIL PROTECTED]> wrote: > On Sun, Apr 6, 2008 at 7:43 AM, Jesse Aldridge <[EMAIL PROTECTED]> wrote: > > In an effort to experiment with open source, I put a couple of my > >  utility files up http://github.com/jessald/python_data_utils/ > >  tree/mast

Re: Python Data Utils

2008-04-06 Thread Jesse Aldridge
Thanks for the detailed feedback. I made a lot of modifications based on your advice. Mind taking another look? > Some names are a bit obscure - "universify"? > Docstrings would help too, and blank lines I changed the name of universify and added a docstrings to every function. > ...PEP8 I ma

Re: Is there any way to say ignore case with "in"?

2008-04-06 Thread Martin v. Löwis
>> I know I could use:- >> >> if lower(string1) in lower(string2): >> >> >> but it somehow feels there ought to be an easier (tidier?) way. >> > > Easier? You mean like some kind of mind meld? Interestingly enough, it shouldn't be (but apparently is) obvious that a.lower() in b.

appropriate python version

2008-04-06 Thread xamdam
Sorry if this is a stupid q, I am trying to figure out the appropriate version of Python(2.4 or 2.5) for an XP 64 system running on an Intel Core2 Quad. Python.org has a to a 64bit build, but it specifies Itanium as the target. Should I just be using the regular build? I was also thinking of gettin

Presumably an import is no faster or slower than opening a file?

2008-04-06 Thread tinnews
I'm trying to minimise the overheads of a small Python utility, I'm not really too fussed about how fast it is but I would like to minimise its loading effect on the system as it could be called lots of times (and, no, I don't think there's an easy way of keeping it running and using the same copy

Re: Form sha1.hexdigest to sha1.digest

2008-04-06 Thread Martin v. Löwis
> How can convert string from sha1.hexdigest() to string that is the > same, like from sha1.digest() Use binascii.unhexlify. HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: py.test and test coverage analysis ?

2008-04-06 Thread John J. Lee
j vickroy <[EMAIL PROTECTED]> writes: > Hello all, > > I am using py.test (http://codespeak.net/py/dist/test.html) to perform > unit testing. I would like to include test coverage analysis using > coverage.py (http://nedbatchelder.com/code/modules/coverage.html), but > I do not know how to simult

Re: Problems trying to hook own exception function to sys.excepthook

2008-04-06 Thread Peter Otten
Sami wrote: > Does this mean that one should always use the command line to run a > python program? Yes. Peter -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >