Re: Creating a function to make checkbutton with information from a list?

2007-05-12 Thread Peter Otten
Thomas Jansson wrote: > Dear all > > I am writing a program with tkinter where I have to create a lot of > checkbuttons. They should have the same format but should have > different names. My intention is to run the functions and the create > all the buttons with the names from the list. > > I n

Setting thread priorities

2007-05-12 Thread John Nagle
There's no way to set thread priorities within Python, is there? We have some threads that go compute-bound, and would like to reduce their priority slightly so the other operations, like accessing the database and servicing queries, aren't slowed as much. John N

Re: keyword checker - keyword.kwlist

2007-05-12 Thread tom
[EMAIL PROTECTED] kirjoitti: > Gabriel Genellina kirjoitti: >> En Thu, 10 May 2007 17:03:13 -0300, <[EMAIL PROTECTED]> escribió: >> my_input = raw_input("...").strip() >> >> as Peter Otten suggested before >> >> --Gabriel Genellina >> > Ok, it seems to work with strip(). Thanks for your help. > >

Re: keyword checker - keyword.kwlist

2007-05-12 Thread tom
Gabriel Genellina kirjoitti: > En Thu, 10 May 2007 17:03:13 -0300, <[EMAIL PROTECTED]> escribió: > my_input = raw_input("...").strip() > > as Peter Otten suggested before > > --Gabriel Genellina > Ok, it seems to work with strip(). Thanks for your help. Do you guys have any clue why mine previo

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 11:02�pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 12 May 2007 18:43:54 -0700, [EMAIL PROTECTED] wrote: > > On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > >> On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > >> > On May 12, 12:56?pm, Carsten Haese

Re: __dict__ for instances?

2007-05-12 Thread half . italian
On May 12, 5:20 pm, Ivan Voras <[EMAIL PROTECTED]> wrote: > While using PyGTK, I want to try and define signal handlers > automagically, without explicitly writing the long dictionary (i.e. I > want to use signal_autoconnect()). > > To do this, I need something that will inspect the current "self"

Re: Read from Windows Address Book (.wab file format) ?

2007-05-12 Thread 詹光耀
On May 13, 3:57 am, rynt <[EMAIL PROTECTED]> wrote: > On May 12, 11:30 am, 詹光耀 <[EMAIL PROTECTED]> wrote: > > > Hi all! > > > I wonder if there's any Python module that could read from .wab file. > > I googled but found nothing useful. Any idea? Thanks :) > > > Rio > > Hi Rio, > > Don't know if the

Re: Interesting list Validity (True/False)

2007-05-12 Thread Steven D'Aprano
On Sat, 12 May 2007 18:43:54 -0700, [EMAIL PROTECTED] wrote: > On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: >> > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: >> > > On Fri, 2007-05-11 at 14:26 -0700, [E

Re: How to cleanly pause/stop a long running function?

2007-05-12 Thread Michael Tobis
> Doing a Ctrl+C > interrupt would be a not-so-clean-way of performing such a thing, and > it would quit the application altogether. I'd rather have the function > return a status object of what it has accomplished thus far. Just in case you are unaware that you can explicitly handle ^C in your py

Re: How to cleanly pause/stop a long running function?

2007-05-12 Thread Steven D'Aprano
On Sat, 12 May 2007 13:51:05 -0700, Basilisk96 wrote: > Suppose I have a function that may run for a long time - perhaps from > several minutes to several hours. An example would be this file > processing function: > > import os > def processFiles(startDir): > for root, dirs, files in os.walk

[ANN] PyYAML-3.05: YAML parser and emitter for Python

2007-05-12 Thread Kirill Simonov
Announcing PyYAML-3.05 A new bug fix release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML Changes === * Windows binary packages were built with LibYAML trunk. * Fixed a bug that prevent processing a live stream of YAML doc

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 8:10?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > > > if arg==True: > > > > > tests the ty

Problems with thread safety

2007-05-12 Thread Sven Rech
Hi, In my C program, I want to use python scripts. This scripts should also have the ability to start threads. So at the initilisation phase I do: PyEval_InitThreads(); PyEval_ReleaseLock(); With the second call I want to release lock, for that the python threads can also do their work. But the

Re: Interesting list Validity (True/False)

2007-05-12 Thread Carsten Haese
On Sat, 2007-05-12 at 17:55 -0700, [EMAIL PROTECTED] wrote: > On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > > if arg==True: > > > > > tests the type property (whether a list is a boolean). > > > > That sounds nonsen

Re: How to cleanly pause/stop a long running function?

2007-05-12 Thread Adam Atlas
On May 12, 4:51 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: > Suppose I have a function that may run for a long time - perhaps from > several minutes to several hours. An example would be this file > processing function: > > import os > def processFiles(startDir): > for root, dirs, files in os.wa

Re: Thread-safe dictionary

2007-05-12 Thread tuom . larsen
On May 12, 11:40 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > - in __getitem__, does it release the lock after returning the item? > > Yes, it does. > > > - wouldn't it be better to use threading.RLock, mutex, ... instead? > > Better in what sense? Performance-wise? Semantically? Performanc

Re: Video: Professor of Physics Phd at Cal Tech says: 911 Inside Job

2007-05-12 Thread schoenfeld . one
On Apr 29, 2:44 am, War Office <[EMAIL PROTECTED]> wrote: > Why can't any of you just discuss the fact that free-fall collapse of > this building contradicts the laws of physics? Why do you assume he's even capable of doing so? He's just a crackpot, but he's in the unfortunate majority. > Why do

Re: Interesting list Validity (True/False)

2007-05-12 Thread [EMAIL PROTECTED]
On May 12, 12:56?pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > > if arg==True: > > > tests the type property (whether a list is a boolean). > > That sounds nonsensical and incorrect. Please explain what you mean. Sec 2.2.3: Objects of

Re: ctree data

2007-05-12 Thread John Machin
On May 13, 7:05 am, Carl K <[EMAIL PROTECTED]> wrote: > A friend needs to convert c-tree plus data to MySql. I can to the "to MySql > part, but need some help with the "from c-tree." If I just wanted to get this > done, I would hunt down the ODBC driver and use some MSy thing. But I am > trying

__dict__ for instances?

2007-05-12 Thread Ivan Voras
While using PyGTK, I want to try and define signal handlers automagically, without explicitly writing the long dictionary (i.e. I want to use signal_autoconnect()). To do this, I need something that will inspect the current "self" and return a dictionary that looks like: { "method_name" : self.

Licence for webchecker module?

2007-05-12 Thread Kevin Walzer
I want to use webchecker.py (distributed in Tools/webchecker of the Python source code tarball) in a project, but there is no license listed in any of the scripts that I can see. Is this code covered by the standard Python license? -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- h

Re: Basic question

2007-05-12 Thread sturlamolden
On May 12, 6:18 pm, "Cesar G. Miguel" <[EMAIL PROTECTED]> wrote: > Am I missing something? Python for loops iterates over the elements in a container. It is similar to Java's "for each" loop. for j in range(10): print j if(True): j=j+2 print 'interno',j Is equivalent to: int[

Re: ctree data

2007-05-12 Thread Terry Reedy
"Carl K" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |A friend needs to convert c-tree plus data to MySql. I can to the "to MySql | part, but need some help with the "from c-tree." If I just wanted to get this | done, I would hunt down the ODBC driver and use some MSy thing.

Re: Dynamic subclassing ?

2007-05-12 Thread Alex Martelli
manatlan <[EMAIL PROTECTED]> wrote: > I've got an instance of a class, ex : > > b=gtk.Button() > > I'd like to add methods and attributes to my instance "b". > I know it's possible by hacking "b" with setattr() methods. But i'd > like to do it with inheritance, a kind of "dynamic subclassing", >

Re: Basic question

2007-05-12 Thread Alex Martelli
Cesar G. Miguel <[EMAIL PROTECTED]> wrote: > On May 12, 3:40 pm, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > > > Actually I'm trying to convert a string to a list of float numbers: > > > str = '53,20,4,2' to L = [53.0, 20.0, 4.0, 2.0] > > > > str="53,20,4,2" > > map(lambda s: float(s), str.split(','

Re: Bug? import cp1252

2007-05-12 Thread John Machin
On May 13, 3:33 am, "Méta-MCI" <[EMAIL PROTECTED]> wrote: > Hi! > > I've a problem with these 2 scripts: > > file aaa.py (write in ANSI/cp1252): What is "ANSI/cp1252"??? > > # -*- coding: cp1252 -*- > > compo={} > > compo['pxrtf']= { > 'fichier': "pxrtf.py", > 'description': "Génération de fich

Re: Newbie look at Python and OO

2007-05-12 Thread walterbyrd
> > You started this thread with a list of conceptual problems you were > having. Are they now cleared up? > Yes. Thank you, and everybody else. I'm still learning, and still getting used to Python. But, I understand the concepts that I was having trouble with before. -- http://mail.python.org

Re: Optimizing numpy

2007-05-12 Thread sturlamolden
On May 12, 10:52 pm, Gerdus van Zyl <[EMAIL PROTECTED]> wrote: > I have the following, that is used to convert pixel data and thus > should be as fast as possible: > > b = numpy.ndarray (shape=(w,h,4), dtype=numpy.uint8) > > a = numpy.frombuffer(buf, numpy.uint8) > a.shape = (w, h, 3) > > b[:,:,0]

Re: Popen and wget, problems

2007-05-12 Thread Rob Wolfe
"Jesse" <[EMAIL PROTECTED]> writes: > Hi all, I have a problem using wget and Popen. I hope someone can help. > > > -- Problem -- > I want to use the command: > wget -nv -O "dir/cpan.txt" "http://search.cpan.org"; > and capture all it's stdout+stderr. > (Note that option -O requires 'dir' to be ex

Re: mmap thoughts

2007-05-12 Thread Nikita the Spider
In article <[EMAIL PROTECTED]>, "James T. Dennis" <[EMAIL PROTECTED]> wrote: >* There don't seem to be any currently maintained SysV IPC > (shm, message, and semaphore) modules for Python. I guess some > people have managed to hack something together using ctypes; > but I have

Re: Basic question

2007-05-12 Thread Kirk Job Sluder
"Cesar G. Miguel" <[EMAIL PROTECTED]> writes: > I've been studying python for 2 weeks now and got stucked in the > following problem: > > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not change the loop > co

Re: Simple Python REGEX Question

2007-05-12 Thread James T. Dennis
johnny <[EMAIL PROTECTED]> wrote: > I need to get the content inside the bracket. > eg. some characters before bracket (3.12345). > I need to get whatever inside the (), in this case 3.12345. > How do you do this with python regular expression? I'm going to presume that you mean something like:

ctree data

2007-05-12 Thread Carl K
A friend needs to convert c-tree plus data to MySql. I can to the "to MySql part, but need some help with the "from c-tree." If I just wanted to get this done, I would hunt down the ODBC driver and use some MSy thing. But I am trying to hone my Python skills, but right now I am in over my he

Bug? import cp1252

2007-05-12 Thread M�ta-MCI
Hi! I've a problem with these 2 scripts: file aaa.py (write in ANSI/cp1252): # -*- coding: cp1252 -*- compo={} compo['pxrtf']= { 'fichier': "pxrtf.py", 'description': "Génération de fichiers RTF" } file bbb.py (write in ANSI/cp1252): # -*- coding: cp1252 -*- import aaa With run

Optimizing numpy

2007-05-12 Thread Gerdus van Zyl
I have the following, that is used to convert pixel data and thus should be as fast as possible: b = numpy.ndarray (shape=(w,h,4), dtype=numpy.uint8) a = numpy.frombuffer(buf, numpy.uint8) a.shape = (w, h, 3) b[:,:,0] = a[:,:,2] b[:,:,1] = a[:,:,1] b[:,:,2] = a[:,:,0] b[:,:,3] = 255 Can anyone

How to cleanly pause/stop a long running function?

2007-05-12 Thread Basilisk96
Suppose I have a function that may run for a long time - perhaps from several minutes to several hours. An example would be this file processing function: import os def processFiles(startDir): for root, dirs, files in os.walk(startDir): for fname in files: if fname.lower().

Re: design question

2007-05-12 Thread idaku2
On May 12, 9:34 pm, Bjoern Schliessmann wrote: > In principle, this is legal. > > But OTOH, how could a ShoppingCart "buy" something? In my world, > Buyers "buy" when using ShoppingCarts. Yes, I don't know either. I got this assignment for my homework, and in UML diagram class ShoppingCart has

Re: package rating system for the Cheese Shop

2007-05-12 Thread cbtube03
On May 12, 2:49 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Is there a package rating system for the Cheese Shop, like how Perl > > has cpanratings (http://cpanratings.perl.org/)? > > I don't know CPAN, but maybe this is what you're looking for: > > http://www.

Re: Read from Windows Address Book (.wab file format) ?

2007-05-12 Thread rynt
On May 12, 11:30 am, 詹光耀 <[EMAIL PROTECTED]> wrote: > Hi all! > > I wonder if there's any Python module that could read from .wab file. > I googled but found nothing useful. Any idea? Thanks :) > > Rio Hi Rio, Don't know if there's a python module for this, but this link, http://msdn2.microsoft.

Re: Creating a function to make checkbutton with information from a list?

2007-05-12 Thread half . italian
On May 12, 11:04 am, Thomas Jansson <[EMAIL PROTECTED]> wrote: > Dear all > > I am writing a program with tkinter where I have to create a lot of > checkbuttons. They should have the same format but should have > different names. My intention is to run the functions and the create > all the buttons

Re: [Newbie] design question

2007-05-12 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Suppose I have class ShoppingCart which has one method called > buy(), and class Buyer who has one reference to ShoppingCart... > Can I also have method buy() in class Buyer, which will then > called ShoppingCard.buy(), and also do some other stuff? Is this > legal desi

Re: package rating system for the Cheese Shop

2007-05-12 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Is there a package rating system for the Cheese Shop, like how Perl > has cpanratings (http://cpanratings.perl.org/)? I don't know CPAN, but maybe this is what you're looking for: http://www.cheeserater.com/ ? STeVe -- http://mail.python.org/mailman/listinfo/pyt

Re: Basic question

2007-05-12 Thread Cesar G. Miguel
On May 12, 3:40 pm, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > > Actually I'm trying to convert a string to a list of float numbers: > > str = '53,20,4,2' to L = [53.0, 20.0, 4.0, 2.0] > > str="53,20,4,2" > map(lambda s: float(s), str.split(',')) > > Last expression returns: [53.0, 20.0, 4.0, 2.0] >

Re: Dynamic subclassing ?

2007-05-12 Thread Steven Bethard
manatlan wrote: > I've got an instance of a class, ex : > > b=gtk.Button() > > I'd like to add methods and attributes to my instance "b". > I know it's possible by hacking "b" with setattr() methods. But i'd > like to do it with inheritance, a kind of "dynamic subclassing", > without subclassing

Re: Basic question

2007-05-12 Thread Grant Edwards
On 2007-05-12, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > str="53,20,4,2" > map(lambda s: float(s), str.split(',')) There's no need for the lambda. map(float,str.split(',')) Does exactly the same thing. -- Grant Edwards grante Yow! I feel like I am

Re: Basic question

2007-05-12 Thread Grant Edwards
On 2007-05-12, Cesar G. Miguel <[EMAIL PROTECTED]> wrote: > Actually I'm trying to convert a string to a list of float numbers: > str = '53,20,4,2' to L = [53.0, 20.0, 4.0, 2.0] >>> str = '53,20,4,2' >>> [float(w) for w in str.split(',')] [53.0, 20.0, 4.0, 2.0] >>> map(float,str.split(',')) [

package rating system for the Cheese Shop

2007-05-12 Thread cbtube03
Is there a package rating system for the Cheese Shop, like how Perl has cpanratings (http://cpanratings.perl.org/)? Do you think it would be useful? I see that we already have Cheesecake (http://pycheesecake.org/) for rating a package's kwalitee (like Perl's CPANTS). But browsing the Cheese Shop,

Re: Basic question

2007-05-12 Thread Dmitry Dzhus
> Actually I'm trying to convert a string to a list of float numbers: > str = '53,20,4,2' to L = [53.0, 20.0, 4.0, 2.0] str="53,20,4,2" map(lambda s: float(s), str.split(',')) Last expression returns: [53.0, 20.0, 4.0, 2.0] -- Happy Hacking. Dmitry "Sphinx" Dzhus http://sphinx.net.ru -- http:

Read from Windows Address Book (.wab file format) ?

2007-05-12 Thread 詹光耀
Hi all! I wonder if there's any Python module that could read from .wab file. I googled but found nothing useful. Any idea? Thanks :) Rio -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic question

2007-05-12 Thread Cesar G. Miguel
On May 12, 3:09 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote: > Cesar G. Miguel wrote: > > - > > L = [] > > file = ['5,1378,1,9', '2,1,4,5'] > > str='' > > for item in file: > >j=0 > >while(j > while(item[j] != ','): > > str+=item[j] > >

Re: preferred windows text editor?

2007-05-12 Thread Josiah Carlson
T. Crane wrote: > Right now I'm using Notepad++. What are other people using? If you are looking for editors written in Python (that are generally multiplatform using wxPython), there are a few listed: http://wiki.wxpython.org/wxPythonPit_Apps . If you are looking for editors with Python suppo

Re: [Newbie] design question

2007-05-12 Thread Daniel Nogradi
> Suppose I have class ShoppingCart which has one method called buy(), > and class Buyer who has one reference to ShoppingCart... Can I also > have method buy() in class Buyer, which will then called > ShoppingCard.buy(), and also do some other stuff? Is this legal > design pattern, have methods

Re: Basic question

2007-05-12 Thread Karlo Lozovina
Cesar G. Miguel wrote: > - > L = [] > file = ['5,1378,1,9', '2,1,4,5'] > str='' > for item in file: >j=0 >while(j while(item[j] != ','): > str+=item[j] > j=j+1 >if(j>= len(item)): break > > if(str != ''): >L

Creating a function to make checkbutton with information from a list?

2007-05-12 Thread Thomas Jansson
Dear all I am writing a program with tkinter where I have to create a lot of checkbuttons. They should have the same format but should have different names. My intention is to run the functions and the create all the buttons with the names from the list. I now the lines below doesn't work, but th

[Newbie] design question

2007-05-12 Thread idaku2
Hi all Suppose I have class ShoppingCart which has one method called buy(), and class Buyer who has one reference to ShoppingCart... Can I also have method buy() in class Buyer, which will then called ShoppingCard.buy(), and also do some other stuff? Is this legal design pattern, have methods wi

Re: Basic question

2007-05-12 Thread Cesar G. Miguel
On May 12, 2:45 pm, Basilisk96 <[EMAIL PROTECTED]> wrote: > On May 12, 12:18 pm, "Cesar G. Miguel" <[EMAIL PROTECTED]> wrote: > > > > > I've been studying python for 2 weeks now and got stucked in the > > following problem: > > > for j in range(10): > > print j > > if(True): > >j=j+2 >

Re: searching algorithm

2007-05-12 Thread aaronwmail-usenet
On May 10, 1:26 pm, Gigs_ <[EMAIL PROTECTED]> wrote: > Hi all! > > I have text file (english-croatian dictionary) with words in it in > alphabetical > order. > This file contains 17 words in this format: > english word: croatian word Let's assume it's okay to have all the data in memory. In m

Re: Interesting list Validity (True/False)

2007-05-12 Thread Carsten Haese
On Fri, 2007-05-11 at 14:26 -0700, [EMAIL PROTECTED] wrote: > if arg==True: > > tests the type property (whether a list is a boolean). That sounds nonsensical and incorrect. Please explain what you mean. "if arg==True" tests whether the object known as arg is equal to the object known as True.

Re: Problems with grid() layout under tkinter

2007-05-12 Thread Thomas Jansson
I found the error - some of the widgets belonged to "master" and some to "frame". So glad I found that Error - that took forever! :D Kind regards Thomas Jansson On 11 Maj, 23:06, Thomas Jansson <[EMAIL PROTECTED]> wrote: > Dear all > > I am trying to make a small wrapper program for textbased pro

Re: Basic question

2007-05-12 Thread Basilisk96
On May 12, 12:18 pm, "Cesar G. Miguel" <[EMAIL PROTECTED]> wrote: > I've been studying python for 2 weeks now and got stucked in the > following problem: > > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not c

Re: Finally started on python..

2007-05-12 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Roger Gammans wrote: > I found myself using this sort of code a bit in one of my recent > scripts > class Something: > def Entries(self): >sort=self._data.keys() > sort.sort() > for i in sort: > yield i > > IS this prefe

Drawing Text on a Path

2007-05-12 Thread Hugo Ferreira
Hi everyone, I need to draw some curved text on an image. I've digged both PIL and aggdraw documentation for this kind of feature, but found nothing. However, AGG itself does support rendering text along a path, but I can't seem to figure out how to deal with the API/Wrapper differences... Could

Re: Basic question

2007-05-12 Thread Dmitry Dzhus
> "j=j+2" inside IF does not change the loop > counter ("j") You might be not truly catching the idea of Python `for` statements sequence nature. It seems that will make things quite clear. > The suite may assign to the variable(s) in the target list; this >

Finally started on python..

2007-05-12 Thread Roger Gammans
Hi, Having known about python since around the turn of the century , I finally found a (actually two) reason to learn it. Python seems to have moved on a little since the 1.5.2 release covered in the reference book (Essential Python) I bought way back when so I could learn it when the time cam

Re: Dynamic subclassing ?

2007-05-12 Thread Daniel Nogradi
> > > I've got an instance of a class, ex : > > > > > b=gtk.Button() > > > > > I'd like to add methods and attributes to my instance "b". > > > I know it's possible by hacking "b" with setattr() methods. But i'd > > > like to do it with inheritance, a kind of "dynamic subclassing", > > > without su

Re: Dynamic subclassing ?

2007-05-12 Thread Karlo Lozovina
manatlan wrote: > I can't find the trick, but i'm pretty sure it's possible in an easy > way. It's somewhat easy, boot looks ugly to me. Maybe someone has a more elegant solution: In [6]: import new In [13]: class Button: : def buttonFunc(self): : pass In [14]: cla

Re: need help with python

2007-05-12 Thread BartlebyScrivener
I'm not sure how you installed Python, or how you are using it, but I made something last year to help Windows XP users who are brand new to Python and can't get things to run, etc. You might try either jumping into somewhere midway, or if you keep having trouble, uninstall whatever you installed

Re: Dynamic subclassing ?

2007-05-12 Thread manatlan
On 12 mai, 18:38, "Daniel Nogradi" <[EMAIL PROTECTED]> wrote: > > I've got an instance of a class, ex : > > > b=gtk.Button() > > > I'd like to add methods and attributes to my instance "b". > > I know it's possible by hacking "b" with setattr() methods. But i'd > > like to do it with inheritance, a

Re: Basic question

2007-05-12 Thread Arnaud Delobelle
On May 12, 5:18 pm, "Cesar G. Miguel" <[EMAIL PROTECTED]> wrote: > I've been studying python for 2 weeks now and got stucked in the > following problem: > > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not ch

Re: Basic question

2007-05-12 Thread Karlo Lozovina
Cesar G. Miguel wrote: > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not change the loop > counter ("j") as it would in C or Java, for example. > Am I missing something? If you want that kind of behaviour

Re: Basic question

2007-05-12 Thread Gary Herron
Cesar G. Miguel wrote: > I've been studying python for 2 weeks now and got stucked in the > following problem: > > for j in range(10): > print j > if(True): >j=j+2 >print 'interno',j > > What happens is that "j=j+2" inside IF does not change the loop > counter ("j") as it would

Re: Dynamic subclassing ?

2007-05-12 Thread Daniel Nogradi
> I've got an instance of a class, ex : > > b=gtk.Button() > > I'd like to add methods and attributes to my instance "b". > I know it's possible by hacking "b" with setattr() methods. But i'd > like to do it with inheritance, a kind of "dynamic subclassing", > without subclassing the class, only th

Basic question

2007-05-12 Thread Cesar G. Miguel
I've been studying python for 2 weeks now and got stucked in the following problem: for j in range(10): print j if(True): j=j+2 print 'interno',j What happens is that "j=j+2" inside IF does not change the loop counter ("j") as it would in C or Java, for example. Am I missing so

Re: path stuff

2007-05-12 Thread BartlebyScrivener
On May 9, 1:11 pm, fscked <[EMAIL PROTECTED]> wrote: > I am walking some directories looking for a certain filename pattern. > This part works fine, but what if I want to exclude results from a > certain directory being printed? You might find this thread helpful http://tinyurl.com/2guk3l Note h

Re: Dynamic subclassing ?

2007-05-12 Thread manatlan
On 12 mai, 17:00, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > manatlan a écrit : > > > I've got an instance of a class, ex : > > > b=gtk.Button() > > > I'd like to add methods and attributes to my instance "b". > > I know it's possible by hacking "b" with setattr() methods. > > You don't even

Re: Dynamic subclassing ?

2007-05-12 Thread Bruno Desthuilliers
manatlan a écrit : > I've got an instance of a class, ex : > > b=gtk.Button() > > I'd like to add methods and attributes to my instance "b". > I know it's possible by hacking "b" with setattr() methods. You don't even need setattr() here, you can set the attributes directly. > But i'd > like t

Re: find out all threads?

2007-05-12 Thread Tim Williams
On 11/05/07, Sven Rech <[EMAIL PROTECTED]> wrote: > Hi, > > I have a written a C program which makes use of python embedding. > I want to find out all threads that a loaded module has started. > But I can't find anything about this in the docs. Is it possible? > Without details of your module, its

Dynamic subclassing ?

2007-05-12 Thread manatlan
I've got an instance of a class, ex : b=gtk.Button() I'd like to add methods and attributes to my instance "b". I know it's possible by hacking "b" with setattr() methods. But i'd like to do it with inheritance, a kind of "dynamic subclassing", without subclassing the class, only this instance "b

Re: Simulating simple electric circuits

2007-05-12 Thread Arnaud Delobelle
On May 11, 10:02 pm, Bjoern Schliessmann wrote: [...] > P.S.: If anyone happens to be interested in details, just ask, I'll > post some code. I'm interested! I was tempted to have a go at it after your initial post, it sounded like a nice little project :) -- Arnaud -- http://mail.python.org/m

Popen and wget, problems

2007-05-12 Thread Jesse
Hi all, I have a problem using wget and Popen. I hope someone can help. -- Problem -- I want to use the command: wget -nv -O "dir/cpan.txt" "http://search.cpan.org"; and capture all it's stdout+stderr. (Note that option -O requires 'dir' to be existing before wget is executed) Popen doesn't work

Re: Thread-safe dictionary

2007-05-12 Thread Martin v. Löwis
> - in __getitem__, does it release the lock after returning the item? Yes, it does. > - wouldn't it be better to use threading.RLock, mutex, ... instead? Better in what sense? Performance-wise? Semantically? Performance-wise, the best thing would be to do safe_dict = dict because the builtin

Re: stealth screen scraping with python?

2007-05-12 Thread Thomas Wittek
[EMAIL PROTECTED] schrieb: > I am screen scraping a large volume of data from Yahoo Finance each > evening, and parsing with Beautiful Soup. > > I was wondering if anyone could give me some pointers on how to make > it less obvious to Yahoo that this is what I am doing, as I fear that > they proba

Re: Python Binding

2007-05-12 Thread Georg Grabler
You are completely right wihtin this. It's some time i didn't reply, but i've taken a look on pyrex and swig now which did cost me some time, and they really make it easier. SWIG provides more possibilities and bindings for other languages too, though - i must say i've been faster with pyrex, for s

Re: logging module and threading

2007-05-12 Thread Vinay Sajip
On May 12, 1:53 am, Ross Boylan <[EMAIL PROTECTED]> wrote: > > I'm also puzzled by how the logger hierarchy works. The docs say that > everything that is logged by the kids is also logged by the parent. > That would seem to defeat what I'm trying to do above, since the > parent would get each logg

Re: matplotlib: howto set title of whole window?

2007-05-12 Thread dmitrey
No, it's just another one title it produces a figure with name "Figure 1" but I should somehow replace the string. It is possible in MATLAB via set(figureHandler, 'Name', 'my_string_here') D. On May 12, 2:52 am, [EMAIL PROTECTED] wrote: > On May 11, 3:44 pm, dmitrey <[EMAIL PROTECTED]> wrote: >