Re: using super() to call two parent classes __init__() method

2007-08-17 Thread Evan Klitzke
On 8/16/07, 7stud <[EMAIL PROTECTED]> wrote: > When I run the following code and call super() in the Base class's > __init__ () method, only one Parent's __init__() method is called. As the other posters have mentioned, each class needs to make a call to super. This is because the super call does

Re: Cancelling events on a COM Object

2007-08-17 Thread Oliver Nelson
James, I was getting an error everytime so I thought I had a setup problem... Sorry everybody... OLIVER James Stroud wrote: > Oliver, wait a while before you panic about your post not getting through! > > James > -- http://mail.python.org/mailman/listinfo/python-list

Re: help on object programing

2007-08-17 Thread Scott David Daniels
yadin wrote: > class big(self): > ... > how can i define my variables so that there are valid outside the > class??? Although you did not describe the issue all that well, I _think_ you are referring to the fact that the following two pieces of code behave less like each other than one might suspe

customizing a logging logger

2007-08-17 Thread garyjefferson123
Suppose I have some sort of context variable that I want to appear in log messages. E.g.: logger = logging.getLogger("somelogger") class SomeOp: def __init__(self, ctx): self.ctx = ctx def method1(self): logger.info("%s: here's a message", self.ctx) What's the idiomatic w

Re: encrypting files + filestreams?

2007-08-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, per9000 wrote: > crptz = AES.new("my-secret_passwd") You're using ECB mode. Never use ECB mode. At a minimum, use CBC mode. Also, another common thing is, don't use the actual password to encrypt the entire file. Instead, randomly generate a "session key" to u

Re: python socket usage

2007-08-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Oğuz Yarımtepe wrote: > Is it possible to send a data object like a tuple or a list in socket > programming? You'll have to define a bytestream encoding to send over the connection. I recently wrote up some Python code

Re: python video editing libs

2007-08-17 Thread math2life
On Aug 17, 5:55 pm, DavidM <[EMAIL PROTECTED]> wrote: > Hi, > > Does anyone know of any python or python-wrapped libs for video editing? > > My requirements: > - open video files in any of the popular containers (avi, mov, ogg, flv >etc) and all the popular codecs (mpeg3, theora, mpeg2 etc) an

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread Alex Martelli
Stefan Behnel <[EMAIL PROTECTED]> wrote: ... > Which virtually all computation-intensive extensions do. Also, note the gmpy doesn't (release the GIL), even though it IS computationally intensive -- I tried, but it slows things down horribly even on an Intel Core Duo. I suspect that may partly

Re: clarification

2007-08-17 Thread samwyse
Scott David Daniels wrote: > lefts = set() > rights = set() > with open('sheet1', 'r') as fh: > for line in fh: > trimmed = line.strip() > if trimmed: # Skip blanks (file end often looks like that) > left, right = line.strip().split('\t') >

Your message to use-revolution awaits moderator approval

2007-08-17 Thread use-revolution-bounces
Your mail to 'use-revolution' with the subject Returned mail: see transcript for details Is being held until the list moderator can review it for approval. The reason it is being held: Post by non-member to a members-only list Either the message will get posted to the list, or you will

Re: How to setup pyOpenGL3.0.a6 for window xp?

2007-08-17 Thread math2life
On Aug 17, 5:42 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Aug 17, 8:07 pm, math2life <[EMAIL PROTECTED]> wrote: > > > Hi, > > I've already download the pyOpenGL3..0.a6 for python2.4 and installed > > python2.4, > > > Is it necessary to install OpenGL? And if need, which version of > > OpenGL

python video editing libs

2007-08-17 Thread DavidM
Hi, Does anyone know of any python or python-wrapped libs for video editing? My requirements: - open video files in any of the popular containers (avi, mov, ogg, flv etc) and all the popular codecs (mpeg3, theora, mpeg2 etc) and audio codecs (raw, wav, mp3 etc) - get an abstract video cli

Re: How to setup pyOpenGL3.0.a6 for window xp?

2007-08-17 Thread Carl Banks
On Aug 17, 8:07 pm, math2life <[EMAIL PROTECTED]> wrote: > Hi, > I've already download the pyOpenGL3..0.a6 for python2.4 and installed > python2.4, > > Is it necessary to install OpenGL? And if need, which version of > OpenGL should be > installed? Windows comes with OpenGL libraries. However, b

Re: Question about 'for' loop

2007-08-17 Thread Carsten Haese
On Fri, 2007-08-17 at 17:45 -0500, Robert Dailey wrote: > [...] > Secondly, I'm wondering how I can use this method of a for loop to > append strings to strings in a list. For example: > > mylist = [ > "Hello ", > "Hello again " > ] > > I should be able to do this: > > print [ i + "World" for i

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-17 Thread Steve Holden
Carl Banks wrote: > On Aug 16, 10:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: >> On Aug 16, 8:28 pm, Jonathan Gardner >> >> >> >> <[EMAIL PROTECTED]> wrote: >>> On Aug 16, 3:35 pm, beginner <[EMAIL PROTECTED]> wrote: In perl it is just one line: $a=$b->{"A"} ||={}. >>> a = b.setdefault('A',

Re: wxPython in C++ app using wxWidgets

2007-08-17 Thread Chris Mellon
On 8/17/07, Marcin Kalicinski <[EMAIL PROTECTED]> wrote: > I have an application written in C++ that uses wxWidgets for GUI. I use > embedded Python for scripting inside of this application. I want to use > wxPython to add GUI to my scripts - because my C++ App uses wxWidgets I > thought it to be e

Re: What does this thread have to do with classical music,

2007-08-17 Thread ah
Art Deco wrote: > ah <[EMAIL PROTECTED]> wrote: >>Art Deco wrote: >>> ah <[EMAIL PROTECTED]> wrote: Art Deco wrote: > ah <[EMAIL PROTECTED]> wrote: >>Art Deco wrote: >>> ah <[EMAIL PROTECTED]> wrote: Art Deco wrote: > Who wrote? > > >>What d

How to setup pyOpenGL3.0.a6 for window xp?

2007-08-17 Thread math2life
Hi, I've already download the pyOpenGL3..0.a6 for python2.4 and installed python2.4, Is it necessary to install OpenGL? And if need, which version of OpenGL should be installed? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to say $a=$b->{"A"} ||={} in Python?

2007-08-17 Thread Carl Banks
On Aug 16, 10:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Aug 16, 8:28 pm, Jonathan Gardner > > > > <[EMAIL PROTECTED]> wrote: > > On Aug 16, 3:35 pm, beginner <[EMAIL PROTECTED]> wrote: > > > > In perl it is just one line: $a=$b->{"A"} ||={}. > > > a = b.setdefault('A', {}) > > > This comb

Re: Question about 'for' loop

2007-08-17 Thread Steve Holden
Robert Dailey wrote: > Hi, > > I noticed that the 'for' loop can be used inline with a list definition. > For example: > > print [i for i in mylist] > > My first question is what is the name for this? I couldn't find this > usage in the python docs; I only managed to learn about it through cod

Re: wxPython in C++ app using wxWidgets

2007-08-17 Thread Stephen Hansen
On 8/17/07, Marcin Kalicinski <[EMAIL PROTECTED]> wrote: > > I have an application written in C++ that uses wxWidgets for GUI. I use > embedded Python for scripting inside of this application. I want to use > wxPython to add GUI to my scripts - because my C++ App uses wxWidgets I > thought it to be

Re: Encryption and hashing

2007-08-17 Thread Paul Rubin
Kless <[EMAIL PROTECTED]> writes: > So it haven't Twofish, Serpent, neither Whirlpool. Neither many others. Unless you have an interoperability requirement or some other specific issue, you should stick with AES and the SHA2 family. Don't make your own cipher selections unless you know completely

Re: Encryption and hashing

2007-08-17 Thread Kless
On 17 ago, 20:34, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > For who knows any of criptography I comment that you can use > > algorithms as secure as Rijndael, Twofish, or Serpent with the CFB > > cipher mode. And for hash you can use RIPEMD, SHA-2 or WHIRLPOOL. > > As I recall, PyCrypto can also u

Re: advice about `correct' use of decorator

2007-08-17 Thread Steve Holden
Gerardo Herzig wrote: [...] > As far as i know (by the way, AFAK is the shortcut? [...] That's "AFAIK", AFAIK :-) regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden -

Re: Question on SPE and pwintypes.dll

2007-08-17 Thread Ian Clark
Gerry wrote: >... but the OS wasn't migrated ... There's your problem right there. It's hard to run most software these days without an OS. Ian -- http://mail.python.org/mailman/listinfo/python-list

Question about 'for' loop

2007-08-17 Thread Robert Dailey
Hi, I noticed that the 'for' loop can be used inline with a list definition. For example: print [i for i in mylist] My first question is what is the name for this? I couldn't find this usage in the python docs; I only managed to learn about it through code samples on the internet. Secondly, I'm

Re: best GUI library for vector drawing program

2007-08-17 Thread Alexander Schmolck
[x-posts removed] chewie54 <[EMAIL PROTECTED]> writes: > I should have also mentioned that is for a commercial application. That > doesn't rule Qt or PyQt out, but this is a startup company with very little > income so my first choice would be to use some GUI library that is free to > use for comme

Hiding / encrypting source code

2007-08-17 Thread Ricardo Aráoz
Hi, I'm new to this python stuff so maybe I'm stating the obvious, or worse, maybe I'm completely off track. Not long ago someone was asking about a way to hide source code. I stumbled upon zipimport standard module. It seems it lets you get your imports from zip files. The docs say it is implicit

wxPython in C++ app using wxWidgets

2007-08-17 Thread Marcin Kalicinski
I have an application written in C++ that uses wxWidgets for GUI. I use embedded Python for scripting inside of this application. I want to use wxPython to add GUI to my scripts - because my C++ App uses wxWidgets I thought it to be easy. The problem is that wxPython knows nothing about wxApp/w

Problems with threading in embedded Python

2007-08-17 Thread Nico Blodow
Hi all, I hope this hasn't been brought up before, but if it did i missed it, so bear with me please :) anyway, i'm trying to embed Python into a C program. A sample python syript i want to run is as follows: ---SNIP--- import time import threading go_on = 1 t = 0 def ProcessMessage(): prin

Re: Python and Tkinter Programming--Expensive!

2007-08-17 Thread James Stroud
W. Watson wrote: > Why is the book in Subject (author is Grayson) so expensive? $100 on > Amazon and $195 on ABE. Aren't there alternatives? Read the fine print. Its available as an ebook for about $25.00 at Manning. You can print out just the parts you need--or read it from your iphone. Jame

Re: Encryption and hashing

2007-08-17 Thread Marshall T. Vandegrift
Kless <[EMAIL PROTECTED]> writes: > For who knows any of criptography I comment that you can use > algorithms as secure as Rijndael, Twofish, or Serpent with the CFB > cipher mode. And for hash you can use RIPEMD, SHA-2 or WHIRLPOOL. PyCrypto does includes the AES version of Rijndael as Crypto.Ci

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread sturlamolden
On Aug 17, 6:00 pm, nikhilketkar <[EMAIL PROTECTED]> wrote: > What are the implications of the Global Interpreter Lock in Python ? This is asked every second week or so. The GIL is similar to the Big Kernel Lock (BKL) use to support SMPs in older versions of the Linux kernel. The GIL prevents t

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread sturlamolden
On Aug 17, 6:00 pm, nikhilketkar <[EMAIL PROTECTED]> wrote: > What are the implications of the Global Interpreter Lock in Python ? This is asked every second week or so. The GIL is similar to the Big Kernel Lock (BKL) use to support SMPs in older versions of the Linux kernel. The GIL prevents t

Re: sub-classing the types in the builtin module datetime

2007-08-17 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: [My question snipped] > > > > This problem arises when you change the function signature of __new__. > I'm a little unclear as to why but it seems for the classmethods > (thosed marked with the METH_CLASS flag in the C source code), you > need to arrange to bypass the no

Re: Array and floating point

2007-08-17 Thread Robert Kern
Jonathan Shan wrote: > Hello, > > I'm experiencing a problem where the float being appended to the array > is not the same as the result of the appending. > from array import * x = array('f') x.append(float("0.1")) x[0] > 0.1000149011612 float("0.1") > 0.1

Re: Array and floating point

2007-08-17 Thread Peter Otten
Jonathan Shan wrote: > Hello, > > I'm experiencing a problem where the float being appended to the array > is not the same as the result of the appending. > from array import * x = array('f') x.append(float("0.1")) x[0] > 0.1000149011612 float("0.1") > 0.1000

Re: Array and floating point

2007-08-17 Thread Zentrader
On Aug 17, 2:06 pm, Jonathan Shan <[EMAIL PROTECTED]> wrote: > Hello, > > I'm experiencing a problem where the float being appended to the array > is not the same as the result of the appending. > > >>> from array import * > >>> x = array('f') > >>> x.append(float("0.1")) > >>> x[0] > 0.1000149

Re: wxpython log redirect

2007-08-17 Thread kyosohma
On Aug 16, 2:29 pm, [EMAIL PROTECTED] wrote: > Hello, > > Why this wx example don't return \nHELLO WORLD and other text in same > window: > > import wx > import logging > import sys > > def nekaj(): > print "\nHELLO WORLD" > > class WxLog(logging.Handler): > def __init__(self, ctrl): >

Array and floating point

2007-08-17 Thread Jonathan Shan
Hello, I'm experiencing a problem where the float being appended to the array is not the same as the result of the appending. >>> from array import * >>> x = array('f') >>> x.append(float("0.1")) >>> x[0] 0.1000149011612 >>> float("0.1") 0.10001 I'm expecting x[0] = 0.100

round-trip from egg to code and back to egg

2007-08-17 Thread Catherine
I'd like to use Scriptaculous with TurboGears on Python 2.5. Unfortunately, Scriptaculous is currently in the Cheese Shop only as a Python 2.4 egg. If I had the setup.py that was used to generate the egg, I think it would be really easy to generate a new Python 2.5 egg from the existing 2.4 egg.

Re: help on object programing

2007-08-17 Thread DouhetSukd
> how can i define my variables so that there are valid outside the > class??? Not to be obnoxious, but your sample code has a number of fairly big conceptual issues (like subclassing self and assigning 32 at the big class level and printing 'list' which is a built-in type). Been there myself -

Re: how to convert a c program to java program

2007-08-17 Thread Matt McCredie
> I heard I need to port C program to JPython first and compile it to native > JAVA. I don't know > anything about JPython. Is there a tool to do the porting? If not, what is > the quickest way to learn > JPython? I'm assuming that you are refering to Jython. You probably want to start by learn

Re: why psyco using more memery in liunx?

2007-08-17 Thread Michael L Torrie
kyo guan wrote: > Hi all: > > When you import psyco in python2.5, you can see the memery grow up near > 40MB in linux. but the same version python and > psyco, is only grow up 1MB under windows. I have a hunch it's because of how the OS's are reporting shared memory usage. IE, the 1 MB i

Re: best GUI library for vector drawing program

2007-08-17 Thread Jeremy Sanders
chewie54 wrote: > I looked at your application, Veusz (it looks very nice), and I see > you have binary distrubitions > for each os. Is is difficult to build these binaries for each > system. Could > you tell me how that is done? I use pyinstaller to make the binaries (see the veusz_pyinst.spe

Re: Downloading multiple csv files from a website

2007-08-17 Thread tkpmep
Mike, Thanks for the pointers. I looked through the ASPN cookbook, but found a more reliable (and easier to implement) way to get the files I want. I downloaded GNU Wget from http://users.ugent.be/~bpuype/wget/( the current version is 1.10.2), and then ran it from Python as follows import os rc =

Re: Encryption and hashing

2007-08-17 Thread Laszlo Nagy
> For who knows any of criptography I comment that you can use > algorithms as secure as Rijndael, Twofish, or Serpent with the CFB > cipher mode. And for hash you can use RIPEMD, SHA-2 or WHIRLPOOL. > As I recall, PyCrypto can also use these, and many others. And it can also do RSA. > And the

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread Bjoern Schliessmann
nikhilketkar wrote: > What are the implications of the Global Interpreter Lock in Python > ? Please have a look at the archives. This topic is brought up anew every few weeks. > Does this mean that Python threads cannot exploit a dual core > processor and the only advantage of using threads is

Re: Problem with directory recursion!

2007-08-17 Thread Laszlo Nagy
> > Does anyone see anything immediately suspicious about the code? Yes. os.walk does the recursion for you. Either you should use os.listdir instead of os.walk, or use os.walk ONCE and iterate over the results. I prefer to use the former because usually I do not remember how os.walk works. Re

Re: Problem with directory recursion!

2007-08-17 Thread Robert Dailey
I figured it out. I was doing a recursive function call when I didn't have to. The walk() method already walks into every possible sub-directory for you! On 8/17/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > > Here's part of the output that's incorrect: > > models\W_BoomerEdge > BYOS_C.e

Encryption and hashing

2007-08-17 Thread Kless
Since that I'm working to let encrypt/hash data in the data base of my projects I have been looking for libraries and/or wrappers. So I want give my feedback about it. In the first I found PyCrypto [1] but I see any problems: * I think that isn't been maintained because the last modification of i

Re: Naming dictionaries recursively

2007-08-17 Thread Paddy
On Aug 17, 3:43 pm, TYR <[EMAIL PROTECTED]> wrote: > > So the tougher problem seems to be parsing those lines. That is not a > > valid Python dictionary unless the names `Bob`, `Humboldt`, `red`, and > > `predatory` are not already defined. So you can't just ``eval`` it. > > In what way? {'key':

Re: help on object programing

2007-08-17 Thread Neil Cerutti
On 2007-08-17, yadin <[EMAIL PROTECTED]> wrote: > class big(self): > > x = 32 > list = [] > def inside (self): > > class small(self): # a new class defined inside the first > > y = 348 > list.append(y) # send the value to first list > list.app

Re: question

2007-08-17 Thread Peter Otten
[EMAIL PROTECTED] wrote: > "I've parsed a webpage into a text file. In doing so, I've kept all > the text I'm interested in, and removed all the text I don't want. My > result is a text file that is comma-separated. However, the text file > is one, very long, single string. I need to substitute e

Re: Making a copy (not reference) of a file handle, or starting stdin over at line 0

2007-08-17 Thread Peter Otten
Shawn Milochik wrote: > How can I check a line (or two) from my input file (or stdin stream) > and still be able to process all the records with my function? One way: from itertools import chain firstline = instream.next() head = [firstline] # loop over entire file for line in chain(head, instr

Re: question

2007-08-17 Thread Shawn Milochik
You need to post some kind of code (even non-working) to show that you've actually done some work. Nobody will do your work for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Tkinter Programming--Expensive!

2007-08-17 Thread kyosohma
On Aug 17, 12:59 pm, "W. Watson" <[EMAIL PROTECTED]> wrote: > Why is the book in Subject (author is Grayson) so expensive? $100 on Amazon > and $195 on ABE. Aren't there alternatives? > -- > Wayne Watson (Nevada City, CA) > > Web Page: Probably b

Re: Problem with directory recursion!

2007-08-17 Thread Robert Dailey
Here's part of the output that's incorrect: models\W_BoomerEdge BYOS_C.entity.xml BYOS_C_Collision.entity.xml Notice that the file BYOS_C.entity.xml is showing up as a file in the directory W_BoomerEdge. This file does not exist in this folder, but yet in a different folder. The o

Problem with directory recursion!

2007-08-17 Thread Robert Dailey
Hi, I've created a function that is used to recurse a directory tree in Windows XP using os.walk(). For the most part it works, however in some instances the data is incorrect and I'm getting invalid sub-directory paths. Here's the function: def __doSearch( root_dir, sub_path, restype, ext ):

Re: best GUI library for vector drawing program

2007-08-17 Thread Thomas Kellerer
chewie54 wrote on 17.08.2007 15:27: > Hello, > > What would be the best cross-platform GUI library to use for a vector > based CAD program ( something like Visio on Windows ) WxWidgets, > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > draw and edit in a window that looks l

question

2007-08-17 Thread CarpeSkium
"I've parsed a webpage into a text file. In doing so, I've kept all the text I'm interested in, and removed all the text I don't want. My result is a text file that is comma-separated. However, the text file is one, very long, single string. I need to substitute every eighth (8th) comma with a new

Python and Tkinter Programming--Expensive!

2007-08-17 Thread W. Watson
Why is the book in Subject (author is Grayson) so expensive? $100 on Amazon and $195 on ABE. Aren't there alternatives? -- Wayne Watson (Nevada City, CA) Web Page: -- http://mail.python.org/mailman/listinfo/python-list

Re: unexpected optparse set_default/set_defaults behavior

2007-08-17 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Some rather unexpected behavior in the set_default/set_defaults > methods for OptionParser that I noticed recently: > import optparse parser = optparse.OptionParser() parser.add_option("-r", "--restart", dest="restart", action="store_true") > parser.

Re: best GUI library for vector drawing program

2007-08-17 Thread chewie54
On Aug 17, 12:07 pm, chewie54 <[EMAIL PROTECTED]> wrote: > On Aug 17, 9:27 am, chewie54 <[EMAIL PROTECTED]> wrote: > > > Hello, > > > What would be the best cross-platform GUI library to use for a vector > > based CAD program ( something like Visio on Windows ) WxWidgets, > > Tk, PyQt, Java Sw

Re: Memory leak when creating lots of object

2007-08-17 Thread Terry Reedy
"Godzilla" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | What should I do next? Can I force garbage collection manually? If so, | how do I do that? Read doc for gc module. I think import gc gc.collect() -- http://mail.python.org/mailman/listinfo/python-list

Making a copy (not reference) of a file handle, or starting stdin over at line 0

2007-08-17 Thread Shawn Milochik
I wrote a script which will convert a tab-delimited file to a fixed-width file, or a fixed-width file into a tab-delimited. It reads a config file which defines the field lengths, and uses it to convert either way. Here's an example of the config file: 1:6,7:1,8:9,17:15,32:10 This converts a fix

Re: to property or function in class object

2007-08-17 Thread Steven Bethard
james_027 wrote: > i am very new to python, not knowing much about good design. I have an > object here for example a Customer object, where I need to retrieve a > info which has a number of lines of code to get it. > > my question is weather what approach should I use? to use the property > which

Re: help on object programing

2007-08-17 Thread mike
On Aug 17, 11:07 am, yadin <[EMAIL PROTECTED]> wrote: > class big(self): > > x = 32 > list = [] > def inside (self): > > class small(self): # a new class defined inside the first > > y = 348 > list.append(y) # send the value to first list > li

Re: help to make program better

2007-08-17 Thread math2life
On Aug 17, 9:27 am, yadin <[EMAIL PROTECTED]> wrote: > hi! > Can any one tell me why is it that i can't see my second frame and why > is the value of freq not Appended in the First frame ...thanks > I know it is wx python but it has to do with passing variables.thanks > > import wx > > def create(

help on object programing

2007-08-17 Thread yadin
class big(self): x = 32 list = [] def inside (self): class small(self): # a new class defined inside the first y = 348 list.append(y) # send the value to first list list.append(x) print list how can i define my variables so that there are

Re: best GUI library for vector drawing program

2007-08-17 Thread chewie54
On Aug 17, 12:08 pm, Jeremy Sanders wrote: > chewie54 wrote: > > What would be the best cross-platform GUI library to use for a vector > > based CAD program ( something like Visio on Windows ) WxWidgets, > > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > > draw and edit in

help to make program better

2007-08-17 Thread yadin
hi! Can any one tell me why is it that i can't see my second frame and why is the value of freq not Appended in the First frame ...thanks I know it is wx python but it has to do with passing variables.thanks import wx def create(parent): return Frame1(parent) [wxID_FRAME1, wxID_FRAME1FREQ,

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread Diez B. Roggisch
nikhilketkar schrieb: > What are the implications of the Global Interpreter Lock in Python ? > Does this mean that Python threads cannot exploit a dual core > processor and the only advantage of using threads is in that > computation and IO-bound operations can continue in parallel ? Essentially,

Re: Can python threads take advantage of use dual core ?

2007-08-17 Thread Stefan Behnel
Diez B. Roggisch wrote: > nikhilketkar schrieb: >> What are the implications of the Global Interpreter Lock in Python ? >> Does this mean that Python threads cannot exploit a dual core >> processor and the only advantage of using threads is in that >> computation and IO-bound operations can continu

Re: best GUI library for vector drawing program

2007-08-17 Thread Jeremy Sanders
chewie54 wrote: > What would be the best cross-platform GUI library to use for a vector > based CAD program ( something like Visio on Windows ) WxWidgets, > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > draw and edit in a window that looks like a page of paper so WYSIWYG >

Re: best GUI library for vector drawing program

2007-08-17 Thread chewie54
On Aug 17, 9:27 am, chewie54 <[EMAIL PROTECTED]> wrote: > Hello, > > What would be the best cross-platform GUI library to use for a vector > based CAD program ( something like Visio on Windows ) WxWidgets, > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > draw and edit in a w

Can python threads take advantage of use dual core ?

2007-08-17 Thread nikhilketkar
What are the implications of the Global Interpreter Lock in Python ? Does this mean that Python threads cannot exploit a dual core processor and the only advantage of using threads is in that computation and IO-bound operations can continue in parallel ? Thanks, Nikhil -- http://mail.python.org/

Re: advice about `correct' use of decorator

2007-08-17 Thread Gerardo Herzig
BJörn Lindqvist wrote: >On 8/16/07, Gerardo Herzig <[EMAIL PROTECTED]> wrote: > > >>@is_logued_in >>def change_pass(): >>bla >>bla >> >>And so on for all the other functions who needs that the user is still >>loged in. >> >>where obviosly the is_logued_in() function will determine if the

Re: advice about `correct' use of decorator

2007-08-17 Thread Gerardo Herzig
Laszlo Nagy wrote: > >>> >>> Are you developing a website or a GUI program? >>> >>> >> It will be used in a web development. It is an important point? > > Yes, I think. Unless you use AJAX. :-) Most web sites work this way: > > user clicks -> request to server -> process on server -> response > >

Re: best GUI library for vector drawing program

2007-08-17 Thread [EMAIL PROTECTED]
I used wxWidgets for a work like that. I found it quite easy to use and I found simple to create a Gui with wxdev which is quite rad. bye Pier Paolo -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting the result of a process after exec*()

2007-08-17 Thread Miles
On 8/17/07, AndrewTK <[EMAIL PROTECTED]> wrote: > The problem for me is this: once an external process is called via > exec*() the script has effectively fulfilled its task. Is there any > way one can process a file with an external process and continue > further processing in Python; /once the ext

Re: Question on SPE and pwintypes.dll

2007-08-17 Thread Gerry
On Aug 17, 10:14 am, [EMAIL PROTECTED] wrote: > On Aug 17, 8:38 am, Gerry <[EMAIL PROTECTED]> wrote: > > >I'm running SPE 8.3.c under XP, on a new PC. > > >The files for SPE and Python were copied to the new machine, but > > the OS wasn't migrated, so the registry didn't know about either.

Re: Hijack! Different book:

2007-08-17 Thread kyosohma
On Aug 16, 3:50 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On Thu, 16 Aug 2007 04:21:07 -0700, Paul Boddie <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > >> Is this the book that came out before TurboGears even reached 1.0, > >> probably hav

help to make program better

2007-08-17 Thread yadin
hi! Can any one tell me why is it that i can't see my second frame and why is the value of freq not Appended in the First frame ...thanks I know it is wx python but it has to do with passing variables.thanks import wx def create(parent): return Frame1(parent) [wxID_FRAME1, wxID_FRAME1FREQ,

Re: Downloading multiple csv files from a website

2007-08-17 Thread tkpmep
Our systems administrator suggested that I try wget, a GNU utility that is designed to pick up data. It might prove to be the easiest way to get the data I want, and I am going to try that first. Thanks again. Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list

Re: Naming dictionaries recursively

2007-08-17 Thread Paul McGuire
On Aug 17, 7:38 am, TYR <[EMAIL PROTECTED]> wrote: > I'd like to do something like this; iterate through a file which > consists of data stored in dictionary format, one dict on each line, > and read each line into a new dict using one of the values in the dict > as its name... > > for example: > >

Re: how to pass a custom object to re.search?

2007-08-17 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I've done that (and added __unicode__ too). I only didn't want to, I > want to do: > > re.search(custom_object) > > so, code that worked before as: > > re.search(parentobj.custom_object) > > don't have to be changed for: > > re.search(str(parentobj.custom_object))

Re: Naming dictionaries recursively

2007-08-17 Thread TYR
> So the tougher problem seems to be parsing those lines. That is not a > valid Python dictionary unless the names `Bob`, `Humboldt`, `red`, and > `predatory` are not already defined. So you can't just ``eval`` it. In what way? {'key': val}, right? Anyway, I can always change the format they g

Re: passing variables and values to texboxdisplays

2007-08-17 Thread kyosohma
On Aug 17, 6:57 am, yadin <[EMAIL PROTECTED]> wrote: > hi! > Can any one tell me why is it that i can't see my second frame and why > is the value of freq not Appended in the First frame ...thanks > I know it is wx python but it has to do with passing variables.thanks > > import wx > > def create(

Re: how to pass a custom object to re.search?

2007-08-17 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > and I'm also curious to know if it is possible to do that... :-) Only if re.search() doesn't check for the type of the argument, which it seems it does. -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man to understand something when his salary

Getting the result of a process after exec*()

2007-08-17 Thread AndrewTK
Hi, I am trying to write a Python script that takes a ZIP file from a web form (using CGI) and uses either of the UN*X unzip, gunzip, tar, bunzip2 utilities to expand it. I can use Python to save the script to disk; but processing it is another matter. If for example I have received a *.tar.gz fi

Re: Need to generate some functions.

2007-08-17 Thread J. Robertson
you can use the dictionary returned by the built in function vars, along the lines of >>> vars()["foo"] = lambda x: 3*x >>> foo(2) 6 but polluting your name space with data counts as bad style and will probably bite you at some point -- you probably are better of putting closures in a dictio

Re: how to pass a custom object to re.search?

2007-08-17 Thread brunovianarezende
> Try to implement __str__() for your object and provide a string > representation for it. > > re.search(str(custom_object)) > I've done that (and added __unicode__ too). I only didn't want to, I want to do: re.search(custom_object) so, code that worked before as: re.search(parentobj.custom_obj

Re: Question on SPE and pwintypes.dll

2007-08-17 Thread kyosohma
On Aug 17, 8:38 am, Gerry <[EMAIL PROTECTED]> wrote: >I'm running SPE 8.3.c under XP, on a new PC. > >The files for SPE and Python were copied to the new machine, but > the OS wasn't migrated, so the registry didn't know about either. > >I reinstalled Python 2.5.1, and Python seems fine

Re: best GUI library for vector drawing program

2007-08-17 Thread kyosohma
On Aug 17, 8:27 am, chewie54 <[EMAIL PROTECTED]> wrote: > Hello, > > What would be the best cross-platform GUI library to use for a vector > based CAD program ( something like Visio on Windows ) WxWidgets, > Tk, PyQt, Java Swing, Java SWT, I need the capibility to > draw and edit in a w

unexpected optparse set_default/set_defaults behavior

2007-08-17 Thread mbeachy
Some rather unexpected behavior in the set_default/set_defaults methods for OptionParser that I noticed recently: >>> import optparse >>> parser = optparse.OptionParser() >>> parser.add_option("-r", "--restart", dest="restart", action="store_true") >>> parser.defaults {'restart': None} >>> parser

Re: (sort of) deterministic timing in Python

2007-08-17 Thread Chris Mellon
On 8/17/07, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > > "Paul Rubin" wrote: > > > >[EMAIL PROTECTED] (John Fisher) writes: > >> mark start time > >> start event > >> event finishes > >> count time until next interval > >> start second event… > >> > >> rather than this:

Re: best GUI library for vector drawing program

2007-08-17 Thread chewie54
On Aug 17, 9:45 am, "Victor Bazarov" <[EMAIL PROTECTED]> wrote: > chewie54 wrote: > > What would be the best cross-platform GUI library to use for a vector > > based CAD program ( something like Visio on Windows ) WxWidgets, > > Tk, PyQt, Java Swing, Java SWT, I need the capibility to >

Re: how to pass a custom object to re.search?

2007-08-17 Thread Lawrence Oluyede
<[EMAIL PROTECTED]> wrote: > Is it possible to make what I want (to pass a custom object to > re.search)? Try to implement __str__() for your object and provide a string representation for it. re.search(str(custom_object)) -- Lawrence, oluyede.org - neropercaso.it "It is difficult to get a man

how to pass a custom object to re.search?

2007-08-17 Thread brunovianarezende
Hi, sorry if this is a faq. I've searched and got no result. I'm willing to pass a custom object to re.search method, but I'm getting the error: TypeError: expected string or buffer I don't want to make my object to inherit from basestring (nor I know how to do it...). Then I was left with 'buff

  1   2   >