Re: RELEASED Python 2.6a2 and 3.0a4

2008-04-06 Thread Martin v. Löwis
John Machin 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! Rather a flexible definition of some time; this

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

2008-04-06 Thread Jorgen Grahn
On Sat, 5 Apr 2008 22:02:10 -0700 (PDT), Paddy [EMAIL PROTECTED] wrote: On Apr 6, 5:18 am, ernie [EMAIL PROTECTED] wrote: On Apr 6, 10:23 am, Roy Smith [EMAIL PROTECTED] wrote: int(s) and catching any exception thrown just sounds like the best way. Another corner case: Is 5.0 an integer or

Re: Recursively Backup Directories

2008-04-06 Thread Jorgen Grahn
On Sat, 5 Apr 2008 16:56:31 -0700 (PDT), [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I am writing a script that will backup specified folders from one hard drive to another (for example, backup source C:\DATA, destination D: \Backup), and was thinking of using shutil. I'd avoid doing that

Re: Python Data Utils

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 01:43:29 -0300, Jesse Aldridge [EMAIL PROTECTED] escribió: In an effort to experiment with open source, I put a couple of my utility files up a href=http://github.com/jessald/python_data_utils/ tree/masterhere/a. What do you think? Some names are a bit obscure -

Re: Weird scope error[SOLVED?]

2008-04-06 Thread Rory McKinley
Kay Schluehr wrote: On 5 Apr., 23:08, Michael Torrie [EMAIL PROTECTED] wrote: You need to either fix all these imports in these other modules (that are probably in the site_packages folder), or modify the python import path so that it can find ElementTree directly. I'd prefer to set an

Re: Looking for Advanced Python Tutorials

2008-04-06 Thread Lie
On Apr 4, 6:58 pm, [EMAIL PROTECTED] wrote: I was wondering if anyone knew of some online (free if possible) advanced tutorials, especially ones that provides tasks and ideas for small projects. The issue for myself is I want to improve my python programming level, and my ability to program in

Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread [EMAIL PROTECTED]
Anyone know of a Python implementation of this: http://www.crockford.com/wrmg/base32.html Google shows a Perl library. I'm sure someone must have a Python library somewhere? :) Thanks [And yes...I know it won't be that hard to do... I will do it if it doesn't already exist, but I'd much

PyGtk Windows all in one installer

2008-04-06 Thread Marco Bonifazi
I realized a PyGtk all in one installer for Windows. You can download it from here: http://www.bonifazi.eu/appunti/pygtk_windows_installer.exe It is simply an assembling of all the different installers I previously downloaded (which are executed step by step), and you can choose. I realized

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

2008-04-06 Thread Fredrik Lundh
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)] any Ubuntu gurus here that can sort this one

Re: ANN: pry unit testing framework

2008-04-06 Thread Matthieu Brucher
2008/4/5, Aldo Cortesi [EMAIL PROTECTED]: Thus spake Matthieu Brucher ([EMAIL PROTECTED]): How does it compare to the nose framework ? As far as the base unit testing functionality is concerned, I think they try to address similar problems. Both have assert-based testing with inspection

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread Petite Abeille
On Apr 6, 2008, at 9:20 AM, [EMAIL PROTECTED] wrote: Anyone know of a Python implementation of this: http://www.crockford.com/wrmg/base32.html Not sure about Crockford's Base32 encoding itself, but here is an implementation of Bryce Zooko Wilcox-O'Hearn's human-oriented base-32 encoding:

Re: Self in Interactive Interpreter

2008-04-06 Thread Fredrik Lundh
kj7ny wrote: With some of my larger applications, it doesn't seem to work well to try to run the whole thing in the interpreter. At least for me, I am not a big IDE sort of programmer. I am much more comfortable in vim and command line stuff. I suppose I should use the IDE more. you don't

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

2008-04-06 Thread Peter Otten
Sami wrote: Hello, I am new to Python. I tried to hook my own ExceptionPrintingFunction sys.excepthook but it does not work. This is what I wrote: --- import sys def MyOwnExceptHook(typ, val, tb): print Inside my

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

2008-04-06 Thread Roel Schroeven
llothar schreef: There are ways to build distributions of Python extensions (modules or packages involving binary code from languages like C or C++), but you will want to understand a bit more about computing in general Believe me nobody needs to teach me anything about general programming

Problems trying to hook own exception function to sys.excepthook

2008-04-06 Thread Sami
Hello, I am new to Python. I tried to hook my own ExceptionPrintingFunction sys.excepthook but it does not work. This is what I wrote: --- import sys def MyOwnExceptHook(typ, val, tb): print Inside my own hook

Re: Self in Interactive Interpreter

2008-04-06 Thread kj7ny
On Apr 4, 1:41 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: kj7nywrote: For years it has been a slight annoyance that every time I wanted to test a snippet of code from a class by running it in the interactive interpreter, I had to remove all of the self. instances from the code. After I

Re: mailbox.Maildir(), confusing documentation

2008-04-06 Thread tinnews
Peter Otten [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: Having got my Python 2.5.2 installed I'm trying some things out with the mailbox.Maildir() class. If I do the following:- import maibox mailbox.Maildir(/home/isbd/Mail/Li/pytest) then the pytest Maildir

Re: Implementation of Crockford's Base32 Encoding?

2008-04-06 Thread Gabriel Genellina
En Sun, 06 Apr 2008 06:07:18 -0300, Petite Abeille [EMAIL PROTECTED] escribió: On Apr 6, 2008, at 9:20 AM, [EMAIL PROTECTED] wrote: Anyone know of a Python implementation of this: http://www.crockford.com/wrmg/base32.html Not sure about Crockford's Base32 encoding itself, but here is an

Re: Python Data Utils

2008-04-06 Thread Konstantin Veretennicov
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 a href=http://github.com/jessald/python_data_utils/ tree/masterhere/a. What do you think? Would you search for, install, learn and use

Re: Any fancy grep utility replacements out there?

2008-04-06 Thread John J. Lee
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: So I need to recursively grep a bunch of gzipped files. This can't be easily done with grep, rgrep or zgrep. (I'm sure given the right pipeline including using the find command it could be donebut seems like a hassle). So I figured I'd find

Form sha1.hexdigest to sha1.digest

2008-04-06 Thread LMZ
How can convert string from sha1.hexdigest() to string that is the same, like from sha1.digest() thanks for your help! Alexandr. -- http://mail.python.org/mailman/listinfo/python-list

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

2008-04-06 Thread Sami
Peter Otten wrote: Sami wrote: Hello, I am new to Python. I tried to hook my own ExceptionPrintingFunction sys.excepthook but it does not work. This is what I wrote: --- import sys def MyOwnExceptHook(typ, val, tb):

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

Control process execution

2008-04-06 Thread Wesley Mesquita
Hi all, I am trying to create a test environment to a couple C applications (simple UDP and TCP server/clients), so I want to write this in python and I m looking for ways to do it. Basically I need an execution timer and timeout control (to kill the apps in certain situations). Looking at google,

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

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

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): do something 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

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

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

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! For each

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 a href=http://github.com/jessald/python_data_utils/  

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 `in`.

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):         do something but it somehow feels there ought to be an easier (tidier?) way. Easier?  You mean like some kind of mind meld? Interestingly enough, it

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

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

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 way

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? Itanium

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

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 lots of

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

@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

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'] respectively. Many thanks

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 do

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 easy

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

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=3458package_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,

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

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

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 very

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 and

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__()

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

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.

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

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

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

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't.

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

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

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 about

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)

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 book

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

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

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()

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 etiquettes

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

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 PROTECTED]

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

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:

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 continue to do so for some

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: 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') -345 works,

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 windows only,

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 uses Tkinter.

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 may

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

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

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 float('-      

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 froma

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

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 all at

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

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 couple of my  

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

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

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 performed a

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 it.

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

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 might not

  1   2   >