Re: Newbie Program

2005-08-04 Thread Devan L
Eric wrote: > I am reading a book on Python and ran across and exercise that I just > can't seem to figure out. Its pretty simple, but I just can't get > past a certain point. > > The task is to create a program that flips a coin 100 times and keeps > track of the total of heads and tails which is

PEP-343 - Context Managment variant

2005-08-04 Thread falcon
Sorry. I was wrong about "global" statement. Then examples seems to be even more intricate: def Synhronised(lock,func): lock.acquire() try: func() finally: lock.release() lock=Lock() def Here_I_work(*a): return 1 # Stub def asd(a): retur

Re: Advanced concurrancy

2005-08-04 Thread Stefan Rank
on 04.08.2005 11:15 Matt Hammond said the following: > Hi Stefan, > >>It seems as though all components basically have to do busy waiting now. > > You are right - components are, for the most part, busy-waiting. Which > is not a good thing! > >>So do you plan on including a kind of scheduler-awa

Re: IronPython 0.9 Released

2005-08-04 Thread EP
Oops. Nevermind. [like the old Saturday Night Live] > Original Message > From: "EP" <[EMAIL PROTECTED]> > To: python-list@python.org > Date: Thu, Aug-4-2005 10:09 PM > Subject: Re: IronPython 0.9 Released > > "Luis M. Gonzalez" Announced: > > > IronPython 0.9 Released(

Re: IronPython 0.9 Released

2005-08-04 Thread EP
"Luis M. Gonzalez" Announced: > IronPython 0.9 Released(8/2/2005 10:28:41 AM) > > http://www.microsoft.com/downloads/details.aspx?familyid=cf5ae627-5df1-4f8a-ba8b-d64f0676f43f&displaylang=en > MS website says: """System Requirements * Supported Operating Systems: Windows Server 2003; Win

Re: >time.strftime %T missing in 2.3

2005-08-04 Thread Andy Leszczynski
Robert Kern wrote: > Andy Leszczynski wrote: > >> Python 2.2/Unix >> >> >>time.strftime("%T") >> '22:12:15' >> >>time.strftime("%X") >> '22:12:17' >> >> Python 2.3/Windows >> >> >>time.strftime("%X") >> '22:12:47' >> >> time.strftime("%T") >> '' > > > From http://docs.python.org/lib/node252

Mail System Error - Returned Mail

2005-08-04 Thread MAILER-DAEMON
The original message was received at Fri, 5 Aug 2005 08:53:02 +0300 from python.org [182.250.185.89] - The following addresses had permanent fatal errors - python-list@python.org -- http://mail.python.org/mailman/listinfo/python-list

Re: >time.strftime %T missing in 2.3

2005-08-04 Thread Robert Kern
Andy Leszczynski wrote: > Python 2.2/Unix > > >>time.strftime("%T") > '22:12:15' > >>time.strftime("%X") > '22:12:17' > > Python 2.3/Windows > > >>time.strftime("%X") > '22:12:47' > >> time.strftime("%T") > '' From http://docs.python.org/lib/node252.html """The full set of format codes su

Re: Idiots guide to fonts with tKinter

2005-08-04 Thread James Stroud
No doubt you have found Fredrik Lundh's intro: http://www.pythonware.com/library/tkinter/introduction/ You can get a long way with that and experimenting. Also, check out Tk: http://www.astro.princeton.edu/~rhl/Tcl-Tk_docs/tk8.0a1/contents.html If you can figure out how to translate the Tk doc

>time.strftime %T missing in 2.3

2005-08-04 Thread Andy Leszczynski
Python 2.2/Unix >>time.strftime("%T") '22:12:15' >>time.strftime("%X") '22:12:17' Python 2.3/Windows >>time.strftime("%X") '22:12:47' >> time.strftime("%T") '' Any clues? A. -- http://mail.python.org/mailman/listinfo/python-list

Newbie Program

2005-08-04 Thread Eric
I am reading a book on Python and ran across and exercise that I just can't seem to figure out. Its pretty simple, but I just can't get past a certain point. The task is to create a program that flips a coin 100 times and keeps track of the total of heads and tails which is printed to the screen.

Re: Idiots guide to fonts with tKinter

2005-08-04 Thread RangerElf
Well, all text classes in Tkinter can take a " font=(...) " argument to specify the face with which to display, for example: from tkinter import * label = Label(root, font=("Helvetica", "bold", 13), ...) It's been a while since I've played with Tkinter, so I might be a little off on the exa

Re: Euclid's Algorithm in Python?

2005-08-04 Thread Jordan Rastrick
Raising an assertion error for a < b is a bit of overkill, since its not really a case of bad input. So normally you see Euclid done like this: def gcd(a,b): # All lowercase for a function is a bit more conventional. if a < b: a, b = b, a # Ensures a >= b by swapping a and b if nessec

Re: Euclid's Algorithm in Python?

2005-08-04 Thread jepler
Well, this article http://pythonjournal.cognizor.com/pyj1/AMKuchling_algorithms-V1.html was the first hit on google for '"euclid's algorithm" python'. It contains this function: def GCD(a,b): assert a >= b # a must be the larger number while (b != 0): re

Re: Py: a very dangerous language

2005-08-04 Thread Luis M. Gonzalez
This is great! It's absolutely useless, like a real therapist, but it's free! -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a drive's volume label

2005-08-04 Thread Bob Greschke
"Reinhold Birkenfeld" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Bob Greschke wrote: >> Looks like the "label" system command will do it in Windows. That's good >> enough for this exercise. So, in Linux...??? > > "mlabel" in the "mtools" package will do what you need. "mkfs.vf

Euclid's Algorithm in Python?

2005-08-04 Thread Erik the Red
In Fundamental Algorithms (The Art of Computer Programming), the first algorithm discussed is Euclid's Algorithm. The only idea I have of writing this in python is that it must involve usage of the modulo % sign. How do I write this in python? -- http://mail.python.org/mailman/listinfo/python-l

Re: Parallel arithmetic?

2005-08-04 Thread Robert Kern
Terrance N. Phillip wrote: > Thank-you very much for all the excellent replies. I'm thinking of using > this to determine if a sequence is a "run" (as in a card game). If I've > got a sorted hand [3, 4, 5, 6, 7], then I know I've got a 5-card run > because [4, 5, 6, 7] - [3, 4, 5, 6] == [1, 1, 1

Re: Parallel arithmetic?

2005-08-04 Thread Terrance N. Phillip
Thank-you very much for all the excellent replies. I'm thinking of using this to determine if a sequence is a "run" (as in a card game). If I've got a sorted hand [3, 4, 5, 6, 7], then I know I've got a 5-card run because [4, 5, 6, 7] - [3, 4, 5, 6] == [1, 1, 1, 1]. I want to avoid something li

Re: Wheel-reinvention with Python

2005-08-04 Thread Mike Meyer
Torsten Bronger <[EMAIL PROTECTED]> writes: > Hallöchen! > Mike Meyer <[EMAIL PROTECTED]> writes: >> Torsten Bronger <[EMAIL PROTECTED]> writes: >>> Mike Meyer <[EMAIL PROTECTED]> writes: Torsten Bronger <[EMAIL PROTECTED]> writes: [...] You didn't answer the question about how you

Re: Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name?

2005-08-04 Thread Peter Hansen
Casey Hawthorne wrote: > Is there a way to determine -- when parsing -- if a word contains a > builtin name or other imported system module name? As David pointed out, the keys in sys.modules are the names of all imported modules throughout the interpreter (but not just those in the current scop

Re: pain

2005-08-04 Thread Mike Meyer
Grant Edwards <[EMAIL PROTECTED]> writes: > On 2005-08-03, Mage <[EMAIL PROTECTED]> wrote: > >> Isn't jython slower (I mean performance) than java? As well as >> I understand jython code will be interpreted twice. > > Jython gets compiled into Java byte code just like Java gets > compiled into Jav

Re: cut & paste text between tkinter widgets

2005-08-04 Thread Christopher Subich
Repton wrote: >>This poses a small problem. I'm not sure whether this is a >>Win32-related issue, or it's because the PRIMARY selection isn't fully >>configured. > > > You need to select something first :-) > That doesn't work for inter-process communication, though, at least not with win32 n

Re: Python IDE's

2005-08-04 Thread Mike Meyer
bruno modulix <[EMAIL PROTECTED]> writes: > Jon Hewer wrote: >> I do use Vim a lot. I am currently using it for some PHP development >> i'm doing. I'm been using it so much recently that i keep pressing >> ESC and typing vi commands out of vi. >> >> But, if i use Vi, then whenever i want to tes

Re: Wheel-reinvention with Python

2005-08-04 Thread Mike Meyer
In <[EMAIL PROTECTED]>, Cliff Wells <[EMAIL PROTECTED]> typed: > On Thu, 2005-08-04 at 01:04 -0400, Mike Meyer wrote: > > Right. Let's go back to the original question: What's the app I use on > > Unix that acts like py2exe on Windows and py2app on Unix? > > Here's where I ask *you* to stop being

Re: Metaclasses and class variables

2005-08-04 Thread Bengt Richter
On Thu, 4 Aug 2005 17:53:28 +0200, Jan-Ole Esleben <[EMAIL PROTECTED]> wrote: >Thanks! It's a bit icky, yes, but I've been so wrapped up in >complicated thinking that I didn't see this. It's actually quite an >OK solution (I need it because I have an internal representation for >method interfaces

Re: cut & paste text between tkinter widgets

2005-08-04 Thread Repton
Christopher Subich wrote: > In experimenting with this, I found a slight... fun issue involved in > this. Selection_get is the correct method to call, but it doesn't quite > work out of the box. > >>> g.selection_get() > Traceback (most recent call last): >File "", line 1, in ? >File "C:\

Re: Parallel arithmetic?

2005-08-04 Thread Terry Reedy
>"#"map" will be removed from the next versions of python. The next version will be 2.5. Map will not go away then. In 3.0, in the indefinite future, it might go away, it might just be moved. tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel arithmetic?

2005-08-04 Thread jepler
If you use numarray, you *can* write c = a-b >>> import numarray >>> a = numarray.array([1,2,3]) >>> b = numarray.array([5,0,2]) >>> c = a-b >>> c array([-4, 2, 1]) numarray is packaged separately from Python. http://www.stsci.edu/resources/software_hardware/numarray Jeff pgp25gtINPi

Re: Parallel arithmetic?

2005-08-04 Thread Robert Kern
Terrance N. Phillip wrote: > Given a and b, two equal length lists of integers, I want c to be > [a1-b1, a2-b2, ... , an-bn]. I can do something like: > > c = [0] * len(a) > for ndx, item in enumerate(a): > c[ndx] = item - b[ndx] > > But I'm wondering if there's a better way, perhaps that a

Re: Parallel arithmetic?

2005-08-04 Thread Lonnie Princehouse
There are many ways to do this. None of them avoids looping, technically, although you can easily avoid the "for" syntax. -- Simple but wastes some memory c = [i-j for i,j in zip(a,b)] -- Using itertools.izip (python 2.3) c = [i-j for i,j in itertools.izip(a,b) ] -- Generator expression

Re: Parallel arithmetic?

2005-08-04 Thread Cyril Bazin
Hello, I propose 3 solutions. If someone have time to waste, he can make a benchmark to know which is the fastest and give us the results on the list. Solution 1: import itertools c = [a_i-b_i for a_i, b_i in itertools.izip(a, b)] Solution 2: c = map(operator.sub, a, b) #"map" will be removed

Re: Parallel arithmetic?

2005-08-04 Thread Michael Hoffman
Terrance N. Phillip wrote: > Given a and b, two equal length lists of integers, I want c to be > [a1-b1, a2-b2, ... , an-bn]. I can do something like: > > c = [0] * len(a) > for ndx, item in enumerate(a): > c[ndx] = item - b[ndx] > > But I'm wondering if there's a better way, perhaps that av

Re: 2.3 or 2.4 on linux

2005-08-04 Thread Lonnie Princehouse
> I assume some system tools must use them, even if I don't. I don't know if > I can just copy all this into the 2.4 site-packages (deleting .pyc and .pyo) > and get what I need. Copying pure python site-packages from python23 to python24 should be safe, but the binaries (.so) will not work becau

Re: Parallel arithmetic?

2005-08-04 Thread Paul Rubin
"Terrance N. Phillip" <[EMAIL PROTECTED]> writes: > Given a and b, two equal length lists of integers, I want c to be > [a1-b1, a2-b2, ... , an-bn]. c = [a[i] - b[i] for i in xrange(len(a))] -- http://mail.python.org/mailman/listinfo/python-list

Parallel arithmetic?

2005-08-04 Thread Terrance N. Phillip
Given a and b, two equal length lists of integers, I want c to be [a1-b1, a2-b2, ... , an-bn]. I can do something like: c = [0] * len(a) for ndx, item in enumerate(a): c[ndx] = item - b[ndx] But I'm wondering if there's a better way, perhaps that avoids a loop? Nick. (I seem to recall fro

Re: 2.3 or 2.4 on linux

2005-08-04 Thread Paul Watson
Sells, Fred wrote: > We are in the process of standardizing ~10 Linux servers on Lineox 4.x, > which is a variant of RedHat Enterprise server I'm told. Part of that > process is to standardize python. > > The baseline install includes python 2.3 which is adequate, but I would like > to standardiz

wxPython ListCtrl_edit and TextEditMixin on mac OS X 10.4

2005-08-04 Thread Sven Tissot
Hello, I am trying to build an editable ListCtrl_edit via TextEditMixin. It displays o.k. and I can edit the first field with this is the code piece: class VokabelListCtrl(wxListCtrl, listmix.ListCtrlAutoWidthMixin, listmix.TextEditMixin): def __init_

Re: Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name?

2005-08-04 Thread David M. Cooke
Casey Hawthorne <[EMAIL PROTECTED]> writes: > Is there a way to determine -- when parsing -- if a word contains a > builtin name or other imported system module name? > > Like "iskeyword" determines if a word is a keyword! Look in the keyword module; there is actually an "iskeyword" function ther

Re: SciPy and NetCDF

2005-08-04 Thread Scott Kilpatrick
Thanks for your help guys! That cleared some stuff up for me. Now I just have to wait for the sysadmin to get back from his vacation, bah. Scott -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-08-04 Thread Cliff Wells
On Thu, 2005-08-04 at 01:04 -0400, Mike Meyer wrote: > Right. Let's go back to the original question: What's the app I use on > Unix that acts like py2exe on Windows and py2app on Unix? > > Any archiving system can be coerced into collecting all the parts > together. None of them do it automatica

Re: installing python2.4.1

2005-08-04 Thread Grig Gheorghiu
I had a similar problem when trying to compile Python 2.4.1 on AIX. The configure script complained about not finding 'cc_r'. I simply did 'ln -s /usr/bin/gcc /usr/bin/cc_r' and that solved my problem. You may consider doing the same for cclplus. Grig -- http://mail.python.org/mailman/listinfo/p

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread Kent Johnson
yaffa wrote: > does anyone have sample code for parsting an html file to get contents > of a td field to write to a mysql db? even if you have everything but > the mysql db part ill take it. http://www.crummy.com/software/BeautifulSoup/examples.html -- http://mail.python.org/mailman/listinfo/pyt

2.3 or 2.4 on linux

2005-08-04 Thread Sells, Fred
We are in the process of standardizing ~10 Linux servers on Lineox 4.x, which is a variant of RedHat Enterprise server I'm told. Part of that process is to standardize python. The baseline install includes python 2.3 which is adequate, but I would like to standardize on 2.4.1, because it is the l

Tough Tkinter Scrollregion vs Window Size Problem

2005-08-04 Thread syed_saqib_ali
Below is a simple code snippet showing a Tkinter Window bearing a canvas and 2 connected scrollbars (Vertical & Horizontal). Works fine. When you shrink/resize the window the scrollbars adjust accordingly. However, what I really want to happen is that the area of the canvas that the scrollbars

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread Bill Mill
On 4 Aug 2005 11:54:38 -0700, yaffa <[EMAIL PROTECTED]> wrote: > does anyone have sample code for parsting an html file to get contents > of a td field to write to a mysql db? even if you have everything but > the mysql db part ill take it. > Do you want something like this? In [1]: x = "someth

Re: sample code for parsing html file to get contents of td fields

2005-08-04 Thread William Park
yaffa <[EMAIL PROTECTED]> wrote: > does anyone have sample code for parsting an html file to get contents > of a td field to write to a mysql db? even if you have everything but > the mysql db part ill take it. I usually use Expat XML parser to extract the field. http://home.eol.ca/~parkw/ind

sample code for parsing html file to get contents of td fields

2005-08-04 Thread yaffa
does anyone have sample code for parsting an html file to get contents of a td field to write to a mysql db? even if you have everything but the mysql db part ill take it. thanks yaffa -- http://mail.python.org/mailman/listinfo/python-list

Re: substring and regular expression

2005-08-04 Thread Diez B.Roggisch
borges2003xx yahoo.it yahoo.it> writes: > > but in general is there a way to include in a re, in this example > something like...matches iff p , and q in which p==q[::-1] ? A way to > putting a small part of code of python in re? Thanx for your many helps What you are after is a parser - there

Re: [ANN] pylint 0.7

2005-08-04 Thread François Pinard
[Sylvain Thénault] > I'm pleased to announce a new release of PyLint. Bonjour Sylvain. J'ai la compulsion de dire bonjour, et merci! (On peut me tutoyer sans problème.) Ce logiciel `pylint', que je viens d'installer et d'essayer pour la première fois ce matin (donc, j'écris encore sur l'effet

Re: PEP-343 - Context Managment variant

2005-08-04 Thread Terry Reedy
"falcon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > def Synhronised(lock,func): >lock.acquire() >try: >func() >finally: >lock.release() > > lock=Lock() > def Some(): >local_var1=x >local_var2=y >local_var3

Re: Reliable destruction

2005-08-04 Thread Raymond Hettinger
[EMAIL PROTECTED] > My questions are: > 1) under normal conditions (no exceptions) is there a guarantee, that > __del__ of > all instruments is called at the end of measurement()? > > 2) if an exception is thrown, will all instruments be deleted if the > error > occurs in run() ? > (only the instru

Re: python ETL

2005-08-04 Thread Jorgen Grahn
On Mon, 01 Aug 2005 10:49:36 -0500, Paul Watson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> Hi, >> My company is involved in the development of many data marts and >> data-warehouses, and I currently looking into migrating our old set of >> tools (written in Korn) to a new, more dynami

Re: Getting HTML from a loaded page in Firefox

2005-08-04 Thread [EMAIL PROTECTED]
Please explain in more detail exactly what your problem was using the method you described. We can help you, but most would be hard pressed to write your code for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: listing users in Plone

2005-08-04 Thread [EMAIL PROTECTED]
Can't help you with #1 as I don't use Plone anymore. I prefer using plain Zope and building my site around that. There's not much that Plone adds for me, besides a skin. As for 2, I do have some experience doing that. First, create a ZSQL statement that does something like this: select * from da

Re: Windows command line problem

2005-08-04 Thread [EMAIL PROTECTED]
Here's an example... BEGIN TEST.PY import sys print "Original:", sys.argv for arg in sys.argv: arg = arg.strip('-\x93\x96') # add chars here you want to strip print "Stripped:", arg END TEST.PY -- http://mail.python.org/mailman/listinfo/python-list

Re: Reliable destruction

2005-08-04 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > Hello Benjamin, > > What would happen if an exception was thrown in the middle of setup()? > tearDown could not handle this case without having a list of the > objects already constructed (Or I would have to rely on the automatic > call to __del__, if it is reliable).

Re: Secure email

2005-08-04 Thread Martin P. Hellwig
Michael Ströder wrote: >>>This would require an additional PGP-plugin for Outlook. Outlook can >>>decrypt S/MIME messages out-of-the-box. >> >>Yes indeed, although I personaly find pgp a bit more elegant your >>solution would be the best for the OP. > Whether S/MIME or PGP is used depends very mu

Re: Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread jepler
On Thu, Aug 04, 2005 at 03:59:01PM +0100, Richard Brodie wrote: > I suppose, for consistency, it should ideally raise LookupError, though Maybe so. If that was the poster's point, then I completely missed it. Jeff pgpUjJySHoMrY.pgp Description: PGP signature -- http://mail.python.org/mailman/

Re: ANN: Kamaelia 0.2.0 released!

2005-08-04 Thread Michael Sparks
Terry Reedy wrote: > "Michael Sparks" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> def updater(interval, message): >> t = time.time(): >> while 1: >> if time.time() - t > interval: >> print message > >yield None # add this Yes. (I can't beli

Re: cut & paste text between tkinter widgets

2005-08-04 Thread William Gill
handy. Thanks, Bill [EMAIL PROTECTED] wrote: > Here's some code that gives a cut-copy-paste pop-up window on all Entry > widgets > in an application. > > This code is released into the public domain. > > Jeff Epler > # >

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread rh0dium
Peter Otten wrote: > rh0dium wrote: > > > for mod in modules: > > a = mod.mod() > > a.run() > > Puzzle: If mod.mod did what you expect, what would a.run have to do to > maintain consistency? I thought that once a = example.example the class is then loaded. Since my framework defines a pyt

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Thanks! It's a bit icky, yes, but I've been so wrapped up in complicated thinking that I didn't see this. It's actually quite an OK solution (I need it because I have an internal representation for method interfaces that needs to be saved somewhere without the user having to worry about it, and wi

Re: Python's CSV reader

2005-08-04 Thread Peter Otten
Stephan wrote: > Thank you all for these interesting examples and methods! You're welcome. > Supposing I want to use DictReader to bring in the CSV lines and tie > them to field names, (again, with alternating lines having different > fields), should I use two two DictReaders as in Christopher's

Re: Python's CSV reader

2005-08-04 Thread Stephan
Thank you all for these interesting examples and methods! Supposing I want to use DictReader to bring in the CSV lines and tie them to field names, (again, with alternating lines having different fields), should I use two two DictReaders as in Christopher's example or is there a better way? -- St

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread Peter Otten
rh0dium wrote: > for mod in modules: > a = mod.mod() > a.run() Puzzle: If mod.mod did what you expect, what would a.run have to do to maintain consistency? There would be no way to determine the name of the module bound to the mod variable, but fortunately the Python developers foresaw y

Re: installing python2.4.1

2005-08-04 Thread Belyh G.P.
Belyh G.P. wrote: >Belyh G.P. wrote: > >OS - Debian GNU/Linux 3.1 > > Sorry forgor "Hi all!" :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I don't know what 'tactis' is, but 'mbcs' is not a portable character set > name. > It's a special character set name on win32, which refers to some > system-specific > multibyte character set. > > I don't think these "failures" are

Re: installing python2.4.1

2005-08-04 Thread Belyh G.P.
Belyh G.P. wrote: OS - Debian GNU/Linux 3.1 >While I try to install python arise an error: > >I type > ./configure >... >... >checking for g++ ... no >checking for gcc ... gcc >checking for C++ compiler default output file name ... configure: error: >C++ compiler cannot create executables >See

installing python2.4.1

2005-08-04 Thread Belyh G.P.
While I try to install python arise an error: I type ./configure ... ... checking for g++ ... no checking for gcc ... gcc checking for C++ compiler default output file name ... configure: error: C++ compiler cannot create executables See 'config.log' for more details. config.log is This file

Re: Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread jepler
I don't know what 'tactis' is, but 'mbcs' is not a portable character set name. It's a special character set name on win32, which refers to some system-specific multibyte character set. I don't think these "failures" are a Python bug. Jeff pgp1JQQPcwk0q.pgp Description: PGP signature -- http:/

Re: pain

2005-08-04 Thread projecktzero
"a manager telling me what tools to use to do my job is a bad manager by definition because he should realize that the people who best know what tools to use are the peope who use the tools*." I'm sorry, this doesn't make much sense to me. In an ideal world where all developers are all knowing and

Re: substring and regular expression

2005-08-04 Thread [EMAIL PROTECTED]
but in general is there a way to include in a re, in this example something like...matches iff p , and q in which p==q[::-1] ? A way to putting a small part of code of python in re? Thanx for your many helps -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedded python

2005-08-04 Thread nico
Chris Johns a écrit : > nico wrote: > >> >> Does anyone have embedded a python interpreter on a proprietary >> hardware ? > > > Yes, http://www.cybertec.com.au/microcore.htm > >> I have a home made hardware running a home made OS. C is used as >> programming >> language. I'd like to add a pyt

Re: Passing a log handle to a module? Help needed with logging module and

2005-08-04 Thread rh0dium
I found my problem it wasn't this piece of the problem it was another... Thanks. However if you want a working example go here.. http://www.onlamp.com/pub/a/python/2005/06/02/logging.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Mass importing of a template based system.. Trouble with name substitutions

2005-08-04 Thread rh0dium
Hi again, No you're right there isn't a mod.mod I want this to be evaluated from this for mod in modules: a = mod.mod() a.run() to this. for mod in modules: a = example1.example1() a.run() then for mod in modules: a = example2.example2() a

Re: Embedded python

2005-08-04 Thread Chris Johns
nico wrote: > > Does anyone have embedded a python interpreter on a proprietary hardware ? Yes, http://www.cybertec.com.au/microcore.htm > I have a home made hardware running a home made OS. C is used as programming > language. I'd like to add a python interpreter to my system. > Any guidelines

Re: Metaclasses and class variables

2005-08-04 Thread Mike C. Fletcher
Jan-Ole Esleben wrote: >Yes, that works, but it is unfortunately not an option (at least not a >good one). > >Is there no way to create a class variable that exists during >definition of the class? (I cannot imagine there isn't, since >technically it's possible and manually it can be done...) > >O

Getting HTML from a loaded page in Firefox

2005-08-04 Thread joe_public34
How can I use Python to get the HTML source for a webpage that is already loaded into Firefox? So far, all I've seen is reference to building Mozilla and XPCOM, but if there's any other way, I want to know. I already tried import win32com.client mb = win32com.client.Dispatch('MOZILLACONTROLLib.App

Fail codecs.lookup() on 'mbcs' and 'tactis'

2005-08-04 Thread Paul Watson
$ python Python 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import codecs >>> codecs.lookup('ascii') (, , , ) >>> codecs.lookup('mbcs') Traceback (most recent call last): File ""

listing users in Plone

2005-08-04 Thread Somesh
Hi, 1.I have installed and running a plone Intranet site, I have registerd users on it. I want to get list of all registerd users on a page. how I should move towards getting it / scripting it in my index_html page ? I am just a frontend user of plone. 2.How to start creating small database drive

Re: pain

2005-08-04 Thread Greg Lindstrom
Mage Wrote: I would be surprised if there were more than five python jobs in my country but have to look around. I Reply: It's not quite that bad in Arkansas (USA), but when I was hired to help start a new IT department I insisted on using Python and my employer agreed to try it. I now have over

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Yes, that works, but it is unfortunately not an option (at least not a good one). Is there no way to create a class variable that exists during definition of the class? (I cannot imagine there isn't, since technically it's possible and manually it can be done...) Ole > classvar is defined AFTER

Re: Metaclasses and class variables

2005-08-04 Thread Kent Johnson
Christopher Subich wrote: > Jan-Ole Esleben wrote: > >> class Meta(type): >> def __new__(cls, name, bases, d): >> d['classvar'] = [] >> return type.__new__(cls, name, bases, d) > > > The problem is that __new__ is called upon object construction, not > class definition, but you're try

Re: Metaclasses and class variables

2005-08-04 Thread Thomas Heller
Jan-Ole Esleben <[EMAIL PROTECTED]> writes: > Hi! > > I am new to this list, and maybe this is a stupid question, but I > can't seem to find _any_ kind of answer anywhere. > > What I want to do is the following: > I want to insert a class variable into a class upon definition and > actually use it

Re: Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
I thought __new__ was called upon construction of the _class_ object that "Meta" is the type of. Then it would be available at the time of the definition of my class. Or am I mistaken? Ole 2005/8/4, Christopher Subich <[EMAIL PROTECTED]>: > Jan-Ole Esleben wrote: > > class Meta(type): > > def _

Re: substring and regular expression

2005-08-04 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > i have read > finding sublist > http://groups.google.it/group/comp.lang.python/browse_thread/thread/50b09a0aca285256/5156ada81fc9358a?hl=it#5156ada81fc9358a > > > the problem was in a string to find if we have two substring non > overlapping of lenght al least 4 > > it

jython: PythonInterpreter runs script, wrong classpath

2005-08-04 Thread HK
Hi, I am using ant to run junit to run a java class that uses a PythonInterpreter to execute a script. The script complains about a "ImportError: cannot import name ..." despite the fact that junit, on behalf of ant -v pretends to be using exactly the right classpath. Obviously the classpath does

Re: Metaclasses and class variables

2005-08-04 Thread Christopher Subich
Jan-Ole Esleben wrote: > class Meta(type): > def __new__(cls, name, bases, d): > d['classvar'] = [] > return type.__new__(cls, name, bases, d) The problem is that __new__ is called upon object construction, not class definition, but you're trying to set the class variables at definitio

QFileDialog

2005-08-04 Thread manojkumar_net
I am using windows Qt3.3.4 and want to verify the selected file path on pressing the OK button of File Dialog. After checking I don't want to close the QFileDialog. Can anyone tell me how to stop closing the FileDialog after checking the file path on pressing ok button. -- http://mail.python.org

Re: PyGTK or wxPython (not a flame war) on Windows

2005-08-04 Thread TPJ
I have encountered some problems with PyGTK only when I was trying to install a PyGTK version that was different from the installed GTK+ version. When those both versions were the same, I had no problems at all. (Another problem with PyGTK is that it's installation is somewhat more complicated tha

Metaclasses and class variables

2005-08-04 Thread Jan-Ole Esleben
Hi! I am new to this list, and maybe this is a stupid question, but I can't seem to find _any_ kind of answer anywhere. What I want to do is the following: I want to insert a class variable into a class upon definition and actually use it during definition. Manually, that is possible, e.g.: cla

Re: Python's CSV reader

2005-08-04 Thread Andrew McLean
In article <[EMAIL PROTECTED]>, Stephan <[EMAIL PROTECTED]> writes >I'm fairly new to python and am working on parsing some delimited text >files. I noticed that there's a nice CSV reading/writing module >included in the libraries. > >My data files however, are odd in that they are composed of lin

Re: Art of Unit Testing

2005-08-04 Thread Christoph Zwerschke
> Your own feature request for setUpOnce() and tearDownOnce() is > trivially coded using a global or class variable to restrict running to > a single occasion. If that seems unpleasant, then encapsulate the > logic in a subclass of TestCase, in a decorator, or in a metaclass. Ok, you can have a s

Re: Reliable destruction

2005-08-04 Thread Pierre-Eric . Melchy
Hello Benjamin, What would happen if an exception was thrown in the middle of setup()? tearDown could not handle this case without having a list of the objects already constructed (Or I would have to rely on the automatic call to __del__, if it is reliable). There is still some problem: Imagine

Embedded python

2005-08-04 Thread nico
Hi, Does anyone have embedded a python interpreter on a proprietary hardware ? I have a home made hardware running a home made OS. C is used as programming language. I'd like to add a python interpreter to my system. Any guidelines ? Nicolas -- http://mail.python.org/mailman/listinfo/python-lis

Re: COM makepy problem

2005-08-04 Thread Alexander Eisenhuth
James Kew schrieb: > "Alexander Eisenhuth" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>ActivePython 2.4.1 >>Windows XP >> >>I write a COM Server in VC++ 6.0 using ATL. So far so good. While I >>develop I got sometimes strange behaviour with makepy utility. Today >>again. :-(

Re: Reliable destruction

2005-08-04 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > Hello, > > I have a class measurement representing a physical measurement. > Different objects in this class represent laboratory equipment, which > might raise an exception (e.g. overtemperature). > > In any case the equipment has to be switched off after the experime

Pythoncard - gauge component.

2005-08-04 Thread fiddlehead
Hello. I'd to use gauge component in the code below. I want to show Queue.quantity in gauge (during running thread, every time when it changed). I don't know which event i must use. I find some info about Time event for gauge but don't understand how it works. Any suggestions? #---gauge.rcrc.py

Re: Secure email

2005-08-04 Thread Michael Ströder
Martin P. Hellwig wrote: > Michael Ströder wrote: > >> Martin P. Hellwig wrote: >> >>> I think you want this more common approach for mail encryption: >>> >>> server: >>> https CGI form --> mail wrapper --> PGP encryption/signing --> send >>> >>> client: >>> recieve mail --> pgp decryption/verific

  1   2   >