Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread W. Watson
Laszlo Nagy wrote: > W. Watson wrote: >> What do I download to use Python with MX XP Pro on an ASUS 4 year old >> motherboard? I would guess a good book source for starters would be >> the O'Reilly book. >> > You mean Microsoft XP Pro? > > For a beginner, the motherboard does not really matte

Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread W. Watson
Ah, I misread wiki as wikpedia. Nevertheless, wikipedia surprises me, as well as just wiki sites. -- http://mail.python.org/mailman/listinfo/python-list

Re: program deployment

2007-01-06 Thread Steven D'Aprano
On Fri, 05 Jan 2007 08:01:17 -0800, Michele Simionato wrote: > king kikapu wrote: >> > > Are they embarassed by their code? >> >> hehehe...no, just worried about stealing their ideas... > > I believe that shipping just the bytecode is a pretty effective way to > stop 99% of programmers from > rea

Re: program deployment

2007-01-06 Thread Steven D'Aprano
On Fri, 05 Jan 2007 07:19:37 -0800, king kikapu wrote: > > >> > Are they embarassed by their code? > > hehehe...no, just worried about stealing their ideas... I don't understand... how can they steal an idea? If somebody copies your idea, you've still got it, it's not gone. -- Steven. -- h

Re: Encoding / decoding strings

2007-01-06 Thread Steven D'Aprano
On Fri, 05 Jan 2007 09:39:17 -0800, [EMAIL PROTECTED] wrote: > Basically, what I am trying to do is display all comments by a > specified user on the website. As the only thing which has =always= > been used to identify users which never changes is their e-mail > addresses, What are you talking

Re: Newbie XML SAX Parsing: How do I ignore an invalid token?

2007-01-06 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: > My original posting has a funky line break character (it appears as an > ascii square) that blows up my program, but it may or may not show up > when you view my message. Looking at your document, it seems that this "funky line break character" is character \x1E, which

Re: attribute decorators

2007-01-06 Thread Steven D'Aprano
On Fri, 05 Jan 2007 20:34:54 -0800, gert wrote: > Would it not be nice if you could assign decorators to attributes too ? > for example > > class C: > @staticattribute > data='hello' You can. You just have to write it as: class C: data = staticattribute('hello') (Of course, writing th

python, zlib, and fedora 64bits

2007-01-06 Thread Tarek Ziadé
Hello, I am trying to compile Python on a Fedora 64bits, and I can't make zlib work. a python setup.py build leads to : ... building 'zlib' extension gcc -pthread -shared build/temp.linux-x86_64-2.4/usr/local/src/Python-2.4.4/Modules/zlibmodule.o -L/opt/python-2.4.4/lib -L/usr/local/lib -lz -o

Re: python, zlib, and fedora 64bits

2007-01-06 Thread Jonathan Curran
On Saturday 06 January 2007 03:47, Tarek Ziadé wrote: > Hello, > > I am trying to compile Python on a Fedora 64bits, and I can't make zlib > work. > > a python setup.py build leads to : > > ... > building 'zlib' extension > gcc -pthread -shared > build/temp.linux-x86_64-2.4/usr/local/src/Python-2.4

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-06 Thread Stef Mientki
Steven Bethard wrote: > Stef Mientki wrote: >> Not sure I wrote the subject line correct, >> but the examples might explain if not clear > [snip] >> class pin2: >> def __init__ (self, naam): >> self.Name = naam >> >> aap2 = pin2('aap2') # seems completely redundant to me. >> print aap2.

howto overload with a NOP (empty statement)

2007-01-06 Thread Stef Mientki
How should I overload / disable a method ? In the example below I have defined the class "Power_Supply", derived from baseclass "device". The baseclass has a method "execute", which will be implemented in most derived classes, but not in all. Now apparently it's not allowed to overload a method w

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Robert Kern
Stef Mientki wrote: > How should I overload / disable a method ? > In the example below I have defined the class "Power_Supply", derived > from baseclass "device". > The baseclass has a method "execute", which will be implemented in most > derived classes, but not in all. > Now apparently it's no

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Vasily Sulatskov
class Power_Supply (device): def execute (self): pass Stef Mientki wrote: > How should I overload / disable a method ? > In the example below I have defined the class "Power_Supply", derived > from baseclass "device". > The baseclass has a method "execute", which will be implemented in

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Bruno Desthuilliers
Stef Mientki a écrit : > How should I overload / disable a method ? > In the example below I have defined the class "Power_Supply", derived > from baseclass "device". Naming conventions are to use CamelCase for class names. So it would be better to name your classes 'PowerSupply' (no '_') and '

Re: PDF rendering toolkit?

2007-01-06 Thread Diez B. Roggisch
> I'm looking for a tool to take an actual .pdf file and display it in a > window (I'm using wxwidgets at the moment) No idea if there is a one-shot-kills-them-all solution out there - but if you have a way to go for windows, you might checkout PyQt and PyKDE to embed a kpfd-view in a window of

Re: What is proper way to require a method to be overridden?

2007-01-06 Thread Bruno Desthuilliers
Patrick Down a écrit : > jeremito wrote: > >>I am writing a class that is intended to be subclassed. What is the >>proper way to indicate that a sub class must override a method? >> (snip) > Decorators to the rescue? (snip convoluted code) What a strange idea... -- http://mail.python.org/mail

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread robert
Stef Mientki wrote: > How should I overload / disable a method ? > In the example below I have defined the class "Power_Supply", derived > from baseclass "device". > The baseclass has a method "execute", which will be implemented in most > derived classes, but not in all. > Now apparently it's no

Re: Using sax libxml2 html parser

2007-01-06 Thread Stefan Behnel
[EMAIL PROTECTED] wrote: > I have created an example using libxml2 based in the code that appears > in http://xmlsoft.org/python.html. > My example processes an enough amount of html files to see that the > memory consumption rises till the process ends (I check it with the > 'top' command). Try

Re: Pausing for Python Interpreter error messages...

2007-01-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > I've written a few classes that I have been testing in IDLE. However, > every time I make a change to the classes based on the testing I have > to walk through all he steps of preparing the classes for testing > again. > > So I wrote a script that does all the set-up

Re: howto overload with a NOP (empty statement)

2007-01-06 Thread Jussi Salmela
Bruno Desthuilliers kirjoitti: > Stef Mientki a écrit : >> How should I overload / disable a method ? >> In the example below I have defined the class "Power_Supply", derived >> from baseclass "device". > > > Naming conventions are to use CamelCase for class names. So it would be > better to na

Python re expr from Perl to Python

2007-01-06 Thread Michael M.
In Perl, it was: ## Example: "Abc | def | ghi | jkl" ## -> "Abc ghi jkl" ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st pipe). $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; ## -- remove [ and ] in text $na =~ s/\[//g; $na =~ s/\]//g; # print "DEB: \"

Re: Python re expr from Perl to Python

2007-01-06 Thread Jorge Godoy
"Michael M." <[EMAIL PROTECTED]> writes: > In Perl, it was: > > > ## Example: "Abc | def | ghi | jkl" > ## -> "Abc ghi jkl" > ## Take only the text betewwn the 2nd pipe (=cut the text in the 1st pipe). > $na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; > > ## -- remove [ and ] in text > $na

Re: How do I add users using Python scripts on a Linux machine

2007-01-06 Thread Piet van Oostrum
> Lawrence D'Oliveiro <[EMAIL PROTECTED]> (LD) wrote: >LD> No it wouldn't. This security hole was fixed years ago. How? -- Piet van Oostrum <[EMAIL PROTECTED]> URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/p

Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread W. Watson
The wiki site lead to a link to download pythonwin, but the download is broken. Googling invariably leads back to that link. I found , which has two files listed: oadist.exe and win32dbg.exe. Do I need both or is just the latter o

Re: Anyone persuaded by "merits of Lisp vs Python"?

2007-01-06 Thread Aahz
In article <[EMAIL PROTECTED]>, Ant <[EMAIL PROTECTED]> wrote: > >So far? After a bit of pain getting started and finding decent docs >(while waiting for the books to arrive) I've found the language quite >easy to use. I haven't got into closures or macros yet - I need to get >more familiar with th

Re: Python re expr from Perl to Python

2007-01-06 Thread Carsten Haese
On Sat, 2007-01-06 at 15:43 +0100, Michael M. wrote: > In Perl, it was: > > >## Example: "Abc | def | ghi | jkl" >## -> "Abc ghi jkl" >## Take only the text betewwn the 2nd pipe (=cut the text in the 1st > pipe). >$na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; > >## -- remove [

Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread Thomas Ploch
W. Watson schrieb: > The wiki site lead to a link to download pythonwin, but the download is > broken. Googling invariably leads back to that link. I found > , which has > two files listed: oadist.exe and win32dbg.exe. Do I need bo

Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread rzed
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: > Wise choice + welcome to the club. Seconded. > The only real XP drawback is that Python is not bundled on > Windows, while it is included with OS X and most (all?) Linux > distros. > My computer does, in fact, include a Python 2.2.1 instal

C++/Python programmers for a MUD's gamedriver wanted.

2007-01-06 Thread Rythin
Hi everyone. We are looking for a volunteer co-programmers for a MUD's gamedriver project. As of now, a gamedriver is divided into two separate but tightly interconnected systems - C++ driver and Python lib. C++ Driver is supposed to be managing memory, proccesses and communication between them (t

Re: Python re expr from Perl to Python

2007-01-06 Thread Paddy
Michael M. wrote: > In Perl, it was: > > >## Example: "Abc | def | ghi | jkl" >## -> "Abc ghi jkl" >## Take only the text betewwn the 2nd pipe (=cut the text in the 1st > pipe). >$na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; > >## -- remove [ and ] in text >$na =~ s/\[//g; >

Re: Python re expr from Perl to Python

2007-01-06 Thread Paddy
Paddy wrote: > Michael M. wrote: > > > In Perl, it was: > > > > > >## Example: "Abc | def | ghi | jkl" > >## -> "Abc ghi jkl" > >## Take only the text betewwn the 2nd pipe (=cut the text in the 1st > > pipe). > >$na =~ s/\ \|(.*?)\ \|(.*?)\ \|/$2/g; > > > >## -- remove [

Re: C++/Python programmers for a MUD's gamedriver wanted.

2007-01-06 Thread Paul McGuire
"Rythin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi everyone. > We are looking for a volunteer co-programmers for a MUD's gamedriver > project. As of now, a gamedriver is divided into two separate but > tightly interconnected systems - C++ driver and Python lib. > > C++ Drive

Re: python, zlib, and fedora 64bits

2007-01-06 Thread Tarek Ziadé
On 1/6/07, Tarek Ziadé <[EMAIL PROTECTED]> wrote: I am answering to myself, if it can help someone else. zlib has to be recompiled with CFLAGS set to -fPIC. So before launching ./configure do a: export CFLAGS="-fPIC" Python then will build properly zlib.so Tarek -- Tarek Ziadé | Assoc

c# application calling Scipy

2007-01-06 Thread dongarbage
Hi, Novice here. :) I'm building a c# application and I want to call functions in SciPy from that application. What's the best way to call SciPy methods from a C# program? Is there a best Python implementation for this? Ironython? Python for .NET? Enthought? Thanks in advance, Don -- http://

A problem in embedding Python in a plug-in

2007-01-06 Thread Koichi
Hi, I'm now making a plug-in for a CG software. I embed Python in a plugin and it works. The problem is that it conflicts with other plugins that also embeds Python because it runs in the same thread. I don't know when Py_Initialize() and Py_Finalize() are executed because I don't know when user lo

still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
In the example below, "pin" is an object with a number of properties. Now I want 1- an easy way to create objects that contains a number of these "pin" 2- an multiple way to access these "pin", i.e. device.pin[some_index] device.some_logical_name ad 1: a dictionary (as "pinlist" in

Python and SDK5.1 are just terrific!!!

2007-01-06 Thread Siggi
Thanks, Jussi, for your post, but I found that PythonWin's SDK5.0 option works well with MS SDk5.1. Just had an Email read for me using a small Python program: correct English, even the date such as 12/06/06 was correctly transformed into the names of the month and year. Python is great1 Siggi

nntplib downloads content with extra linebreaks

2007-01-06 Thread rweth
I am using nntplib to download archived xml messages from our internal newsgroup. This is working fine except the download of files to the connected server, has extra embedded lines in them (all over the place), from the s.body(id,afile) # body method Is there any way to employ this library

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Patrick Mullen
You would use setattr to bind a name that you don't know: for pin in self.pin: setattr(self,pin.Name,pin.Value) However, I'm not sure why you're using a dictionary in this way. I don't totally understand the context, so I may be wrong, but I would code it more like this: class Power_Supply(d

Re: Adding a directory to the Python System Path - Edit the registry?

2007-01-06 Thread rweth
[EMAIL PROTECTED] wrote: > Thanks Martin. > > I'll take a look at the documentation you pointed out. > > Scott > > Martin P. Hellwig wrote: >> [EMAIL PROTECTED] wrote: >>> I have been trying to find a way to add a directory to Python's sytem >>> path on my MS Windows XP computer. I did some sear

Re: nntplib downloads content with extra linebreaks

2007-01-06 Thread Klaus Alexander Seistrup
Rweth wrote: > I am using nntplib to download archived xml messages from our > internal newsgroup. This is working fine except the download > of files to the connected server, has extra embedded lines in > them (all over the place), from the >s.body(id,afile) # body method The 'linebreak

Re: python, zlib, and fedora 64bits

2007-01-06 Thread Tarek Ziadé
I am answering to myself, if it can help someone else. zlib has to be recompiled with CFLAGS set to -fPIC. So before launching ./configure do a: export CFLAGS="-fPIC" Python then will build properly zlib.so Tarek -- http://mail.python.org/mailman/listinfo/python-list

search mail by date with imaplib

2007-01-06 Thread csselo
Hi I am looking for a code sample which searches mail by date with imaplib example: get email from 01.01.2007 to now how can I change imaplib search parameters? -- http://mail.python.org/mailman/listinfo/python-list

Re: nntplib downloads content with extra linebreaks

2007-01-06 Thread rweth
Klaus Alexander Seistrup wrote: > Rweth wrote: > >> I am using nntplib to download archived xml messages from our >> internal newsgroup. This is working fine except the download >> of files to the connected server, has extra embedded lines in >> them (all over the place), from the >>s.body

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread rzed
Stef Mientki <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In the example below, "pin" is an object with a number of > properties. Now I want > 1- an easy way to create objects that contains a number of these > "pin" 2- an multiple way to access these "pin", i.e. > device.pin[so

Re: search mail by date with imaplib

2007-01-06 Thread rweth
[EMAIL PROTECTED] wrote: > Hi > I am looking for a code sample which searches mail by date with imaplib > > example: > get email from 01.01.2007 to now > > how can I change imaplib search parameters? > So I had to do the same thing a few years back. I love python but seriously every author spend

Re: nntplib downloads content with extra linebreaks

2007-01-06 Thread Klaus Alexander Seistrup
Rweth wrote: >for aline in buf: > bufHeal.append(aline.replace('\r\n', '\n')) What does one single aline look like? > s.body(id,afile) Does the 'afile' contain a filename or a filepointer? Cheers, -- Klaus Alexander Seistrup http://klaus.seistrup.dk/ -- http://mail.python.org/mai

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
>> class Power_Supply(device): >> pinlist = { >> 0: ('GND', _DIG_OUT, _par2), >> 1: ('VCC', _DIG_OUT, _par33) >> } > > I may be confused about what you're after, but wouldn't something > like this work? (I don't know what a _par2 object is; I've named > it somethi

Re: Dividing integers...Convert to float first?

2007-01-06 Thread Thomas Ploch
Beliavsky schrieb: > If the C or Fortran committees tried to change > the meaning of int/int, they would be shot. Or hanged... > If you want to be confident that your code will run, unchanged, 10 > years from now on the hardware and OS that will then be common, Python > 2.x is not the language to

Re: nntplib downloads content with extra linebreaks

2007-01-06 Thread rweth
Klaus Alexander Seistrup wrote: > Rweth wrote: > >>for aline in buf: >> bufHeal.append(aline.replace('\r\n', '\n')) > > What does one single aline look like? > >> s.body(id,afile) > > Does the 'afile' contain a filename or a filepointer? > > Cheers, > so afile contains a filename. O

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-06 Thread rweth
Martin v. Löwis wrote: > Carroll, Barry schrieb: >> What I want to know is: >> >> * has anyone else encountered a problem like this, * how was the >> problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? > > From your description, I suspect an error in your code. Your description > indi

Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
I have a python (2.5) program with number of worker threads, and I want to make sure that each of these does a context switch at appropriate times, to avoid starvation. I know that I can do a time.sleep(0.001) to force such a switch, but I'm wondering if this is the recommended method. Thanks in

Re: nntplib downloads content with extra linebreaks

2007-01-06 Thread Klaus Alexander Seistrup
Rweth wrote: > so afile contains a filename. > One single aline looks like so: >'' Beats me where those empty lines come from, it doesn't seem to happen in nntplib. Does the same thing happen if you pass .body() a filepointer? Cheers, -- Klaus Alexander Seistrup http://klaus.seistrup.dk/

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Duncan Booth
Lloyd Zusman <[EMAIL PROTECTED]> wrote: > I have a python (2.5) program with number of worker threads, and I want > to make sure that each of these does a context switch at appropriate > times, to avoid starvation. I know that I can do a time.sleep(0.001) to > force such a switch, but I'm wonderi

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Bruno Desthuilliers
Stef Mientki a écrit : > In the example below, "pin" is an object with a number of properties. > Now I want > 1- an easy way to create objects that contains a number of these "pin" > 2- an multiple way to access these "pin", i.e. > device.pin[some_index] > device.some_logical_name > ad

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
Duncan Booth <[EMAIL PROTECTED]> writes: > Lloyd Zusman <[EMAIL PROTECTED]> wrote: > >> I have a python (2.5) program with number of worker threads, and I want >> to make sure that each of these does a context switch at appropriate >> times, to avoid starvation. I know that I can do a time.sleep(

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread rzed
Stef Mientki <[EMAIL PROTECTED]> wrote in news:182cf [EMAIL PROTECTED]: >>> class Power_Supply(device): >>> pinlist = { >>> 0: ('GND', _DIG_OUT, _par2), >>> 1: ('VCC', _DIG_OUT, _par33) >>> } >> >> I may be confused about what you're after, but wouldn't something

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Bruno Desthuilliers
Stef Mientki a écrit : > rzed wrote: (snip) >> class Power_Supply(device): >> def __init__(self): >> self.pin = { >> 0:dict(Name='GND',Value=_DIG_OUT,something=_par2), >> 1:dict(Name='VCC',Value=_DIG_OUT,something=_par33), >> } > > Why so complex, I ne

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Bruno Desthuilliers
rzed a écrit : (snip) > for k in self.pin.keys(): > self.__dict__[self.pin[k]['Name']] = self.pin[k] for pin self.pin.values(): self.__dict__[pin['name']] = pin -- http://mail.python.org/mailman/listinfo/python-list

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Jussi Salmela
Bruno Desthuilliers kirjoitti: > Stef Mientki a écrit : >> In the example below, "pin" is an object with a number of properties. >> Now I want >> 1- an easy way to create objects that contains a number of these "pin" >> 2- an multiple way to access these "pin", i.e. >> device.pin[some_index

Re: search mail by date with imaplib

2007-01-06 Thread Jean-Paul Calderone
On Sat, 06 Jan 2007 11:49:17 -0800, rweth <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> Hi >> I am looking for a code sample which searches mail by date with imaplib >> >> example: >> get email from 01.01.2007 to now >> >> how can I change imaplib search parameters? >> >So I had to do the

WoC - A web of code

2007-01-06 Thread aliptah
Web Of Code http://idiki.dyne.org/wiki/WoC WoC stands for Web Of Code. The basic idea is to add hyperlink capacities to source code documents, creating, in this way, a new Web, of code. The Idiki article describes the idea and shows how it can be implemented using existi

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread Stef Mientki
Jussi Salmela wrote: > Bruno Desthuilliers kirjoitti: >> Stef Mientki a écrit : >>> In the example below, "pin" is an object with a number of properties. >>> Now I want >>> 1- an easy way to create objects that contains a number of these "pin" >>> 2- an multiple way to access these "pin", i.e. >>>

Re: search mail by date with imaplib

2007-01-06 Thread rweth
Jean-Paul Calderone wrote: > On Sat, 06 Jan 2007 11:49:17 -0800, rweth <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Hi >>> I am looking for a code sample which searches mail by date with imaplib >>> >>> example: >>> get email from 01.01.2007 to now >>> >>> how can I change imaplib sea

Crash on

2007-01-06 Thread John Pye
Hi all I have a unittest test suite that's testing a fairly large SWIG-wrapped application via Python. All my tests are passing at the moment, but when Python exits, I get the following (shown below). Could anyone please help me to understand what precisely this message means (other than that obv

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Duncan Booth
Lloyd Zusman <[EMAIL PROTECTED]> wrote: >> Why do you think that just letting the threads run won't have the >> effect you desire? Leave it to the system to schedule the threads. > > I can already see that they don't have the effect I desire. They are > long numerical calculations in tight loops

sheeps be carefull of Python

2007-01-06 Thread GHUM
sometimes Python is more dangerous than documented: http://news.nationalgeographic.com/news/2006/09/060915-python-ewe.html Harald -- http://mail.python.org/mailman/listinfo/python-list

Re: Doing date/time + TZ math in python

2007-01-06 Thread [EMAIL PROTECTED]
Joshua J. Kugler wrote: > I've read docs (datetime, time, pytz, mx.DateTime), googled, and > experimented. I still don't know how to accomplish what I want to > accomplish. > > I'm loading up a bunch of date/time data that I then need to do math on to > compare it to the current date/time. I can

Re: still struggling, howto use a list-element as a name ? Sory, hit send button to early

2007-01-06 Thread Stef Mientki
Stef Mientki wrote: > Jussi Salmela wrote: >> Bruno Desthuilliers kirjoitti: >>> Stef Mientki a écrit : In the example below, "pin" is an object with a number of properties. Now I want 1- an easy way to create objects that contains a number of these "pin" 2- an multiple way to a

Re: Recommended way to force a thread context switch?

2007-01-06 Thread Lloyd Zusman
Duncan Booth <[EMAIL PROTECTED]> writes: > [ ... ] > > If the context isn't switching enough for you then try calling > sys.setcheckinterval(n) with varying values of n until you find one which > is suitable. Calling it with a lower value of n will increase the frequency > that you switch threa

Traceback of hanged process

2007-01-06 Thread Hynek Hanke
Hello, please, how do I create a pythonic traceback from a python process that hangs and is not running in an interpreter that I executed manually or it is but doesn't react on CTRL-C etc? I'm trying to debug a server implemented in Python, so I need some analog of 'gdb attach' for C. Unfortuna

Re: Traceback of hanged process

2007-01-06 Thread Jonathan Curran
On Saturday 06 January 2007 16:45, Hynek Hanke wrote: > Hello, > > please, how do I create a pythonic traceback from a python process that > hangs and is not running in an interpreter that I executed manually > or it is but doesn't react on CTRL-C etc? I'm trying to debug a server > implemented in

Re: Traceback of hanged process

2007-01-06 Thread Jonathan Curran
Heh, I kinda messed up the code there. It should be: import sys log_file = open('errors.log', 'w') sys.stderr = log_file log_file.close() As for the Ctrl-C, you can catch that when KeyboardInterrupt exception is raised. - Jonathan -- http://mail.python.org/mailman/listinfo/python-list

Re: c# application calling Scipy

2007-01-06 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Hi, > > Novice here. :) > > I'm building a c# application and I want to call functions in SciPy > from that application. > > What's the best way to call SciPy methods from a C# program? > > Is there a best Python implementation for this? Ironython? Python for > .NET?

Parallel Python

2007-01-06 Thread parallelpython
Has anybody tried to run parallel python applications? It appears that if your application is computation-bound using 'thread' or 'threading' modules will not get you any speedup. That is because python interpreter uses GIL(Global Interpreter Lock) for internal bookkeeping. The later allows only on

Why less emphasis on private data?

2007-01-06 Thread [EMAIL PROTECTED]
Coming from a C++ / C# background, the lack of emphasis on private data seems weird to me. I've often found wrapping private data useful to prevent bugs and enforce error checking.. It appears to me (perhaps wrongly) that Python prefers to leave class data public. What is the logic behind that ch

Re: Why less emphasis on private data?

2007-01-06 Thread Thomas Ploch
[EMAIL PROTECTED] schrieb: > Coming from a C++ / C# background, the lack of emphasis on private data > seems weird to me. I've often found wrapping private data useful to > prevent bugs and enforce error checking.. > It appears to me (perhaps wrongly) that Python prefers to leave class > data publi

Re: Why less emphasis on private data?

2007-01-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Coming from a C++ / C# background, the lack of emphasis on private data > seems weird to me. I've often found wrapping private data useful to > prevent bugs and enforce error checking.. > > It appears to me (perhaps wrongly) that Python prefers to leave class > data pu

Re: (newbie) Is there a way to prevent "name redundancy" in OOP ?

2007-01-06 Thread Martin Miller
Carl Banks wrote: > Martin Miller wrote: > > ### non-redundant example ### > > import sys > > > > class Pin: > > def __init__(self, name, namespace=None): > > self.name = name > > if namespace == None: > > # default to caller's globals > > namespace = sy

Re: Why less emphasis on private data?

2007-01-06 Thread skip
time> Coming from a C++ / C# background, the lack of emphasis on private time> data seems weird to me. Python doesn't try to protect you from the authors of the code you use. You should be intelligent enough to use it wisely. On the flip side, the lack of truly private data and methods

Re: Why less emphasis on private data?

2007-01-06 Thread BJörn Lindqvist
On 6 Jan 2007 16:07:05 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Coming from a C++ / C# background, the lack of emphasis on private data > seems weird to me. I've often found wrapping private data useful to > prevent bugs and enforce error checking.. > > It appears to me (perhaps wrongl

Re: Why less emphasis on private data?

2007-01-06 Thread Stefan Schwarzer
On 2007-01-07 01:54, BJörn Lindqvist wrote: > Google for "python for consenting adults" > > Or ask yourself the opposite question. Why does C++ and C# prefer more > private data? It is given that emphasizing private data > (encapsulation) leads to more internal complexity and more lines of > code b

Re: Why less emphasis on private data?

2007-01-06 Thread Paul Rubin
"BJörn Lindqvist" <[EMAIL PROTECTED]> writes: > It is given that emphasizing private data (encapsulation) leads to > more internal complexity and more lines of code because you have to > write getters and setters and stuff. You can have public variables in Java if you choose to. Writing private v

Re: clarification on open file modes

2007-01-06 Thread Stefan Schwarzer
On 2007-01-05 03:46, tubby wrote: > Is this the safest, most portable way to open files on any platform: > > fp = open(file_name, 'rb') > fp.close() > > I understand that doing the following on Windows to a binary file (a > jpeg or exe files for example) can cause file corruption, is that correct?

AES256 in PyCrypto

2007-01-06 Thread mirandacascade
Attempting to determine whether the PyCrypto package has the capability to perform AES256 encryption. I received the following C# snippet: CryptoProvider provider = new CryptoProvider(); Encrypted_Type password = new Encrypted_Type(); password.EncryptedData = new EncryptedDataType(); password.Enc

How to invoke parent's method?

2007-01-06 Thread many_years_after
Hi, pythoners: My wxPython program includes a panel whose parent is a frame. The panel has a button. When I click the button , I want to let the frame destroy. How to implement it? Could the panel invoke the frame's method? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: still struggling, howto use a list-element as a name ?

2007-01-06 Thread rzed
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > rzed a écrit : > (snip) >> for k in self.pin.keys(): >> self.__dict__[self.pin[k]['Name']] = self.pin[k] > > for pin self.pin.values(): >self.__dict__[pin['name']] = pin > D'oh! Of course! Thank

How to write code to get focuse the application which is open from server

2007-01-06 Thread vinthan
hi, I am new to python. I have to write test cases in python. An application is open in the desk top ( application writen in .Net) I have to write code to get focuse the application and click on the link which in the one side and it will load the map on the other and I have to check map is loaded.

Re: Just Getting Started with Python on MS XP Pro

2007-01-06 Thread W. Watson
Thomas Ploch wrote: > W. Watson schrieb: >> The wiki site lead to a link to download pythonwin, but the download is >> broken. Googling invariably leads back to that link. I found >> , which has >> two files listed: oadist.exe and

Re: File Closing Problem in 2.3 and 2.4, Not in 2.5

2007-01-06 Thread John Machin
Martin v. Löwis wrote: > Carroll, Barry schrieb: > > What I want to know is: > > > > * has anyone else encountered a problem like this, * how was the > > problem corrected, * can the fix be retro-fitted to 2.5 and 2.4? > > From your description, I suspect an error in your code. Your description > i