Deploying an app with Embedded Python

2006-08-30 Thread [EMAIL PROTECTED]
I've got a large C++ application that we're adding web integration to, XMLRPC and HTTP GET/POST stuff. I'm jumping at the chance to use embedded python to handle this aspect of the application as its so much quicker to handle all the SSL, XML, and HTTP stuff with python and, when the web servic

Re: GC and security

2006-08-30 Thread Tim Peters
[Aahz] >> Assuming you're talking about CPython, strings don't really participate >> in garbage collection. Keep in mind that the primary mechanism for >> reaping memory is reference counting, and generally as soon as the >> refcount for an object goes to zero, it gets deleted from memory. [Les S

Re: Large LCD/Plasma TV Output

2006-08-30 Thread simonwittber
[EMAIL PROTECTED] wrote: > I'm soon going to be starting on a little program that needs to output > tabular information to a large LCD or Plasma screen. Python is, of > course, my preferred language. > > My first instinct is PyGame, which I have programming for a PC monitor > before. If all you wa

Possible problem in compiler/transformer.py of Python2.4...

2006-08-30 Thread venkatbo
Hi all, I have python2.4 running on ppc-linux 2.6.17. I'm attempting to get a TurboGears 0.9a9 (using CherryPy 2.2.1) based app running on it. During the TG-app startup sequence, it reaches the point where it imports cherrypy, which eventually causes py2.4's system file, compiler/transformer.py,

Re: py2exe for programs with excel COM objects

2006-08-30 Thread [EMAIL PROTECTED]
Thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe for programs with excel COM objects

2006-08-30 Thread [EMAIL PROTECTED]
Thanks a loy -- http://mail.python.org/mailman/listinfo/python-list

Re: Truly platform-independent DB access in Python?

2006-08-30 Thread Jorge Vargas
On 28 Aug 2006 00:01:06 -0700, bobrik <[EMAIL PROTECTED]> wrote: > Hello, > > I am using the Python DB API for access to MySQL. But it is not > platform-independent - I need a module not included in Python by > default - python-mysql, and it uses a compiled binary _mysql.so. So it > is not platform

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Jack Diederich
On Wed, Aug 30, 2006 at 08:01:02PM -0700, Aahz wrote: > In article <[EMAIL PROTECTED]>, > Neil Schemenauer <[EMAIL PROTECTED]> wrote: > >Aahz <[EMAIL PROTECTED]> wrote: > >> > >> My company uses 2.2 and 2.3; we hope to drop 2.2 Real Soon Now. > > > >This has been an interesting thread. There has

Re: python equivalent for fputc

2006-08-30 Thread Fredrik Lundh
Putty wrote: > I'm porting a program a friend wrote in C over to Python and I've run > into a little hang-up. The C program writes characters out to a file. > I'm 99% sure that a conversion is going on here as well. I know for a > fact that it's taking a number and turning it into a character.

Re: The lib email parse problem...

2006-08-30 Thread Fredrik Lundh
"" wrote: > i have use a temp method to overcome it . > > i still think the email lib should give the boundary border to parse > mail. the email lib you're using is a PARSER, and it's already PARSING the mail for you. (if you have trouble structuring your program when someone else is doing t

Re: GC and security

2006-08-30 Thread Paul Rubin
Les Schaffer <[EMAIL PROTECTED]> writes: > understood, i meant best practice in terms of the less rigorous garbage > collection. if the collect() function hastens garbage collection for > unreferenced strings like a passphrase, it costs us nothing and buys us > a wee bit. GC simply releases the me

Re: GC and security

2006-08-30 Thread Les Schaffer
Aahz wrote: > Assuming you're talking about CPython, strings don't really participate > in garbage collection. Keep in mind that the primary mechanism for > reaping memory is reference counting, and generally as soon as the > refcount for an object goes to zero, it gets deleted from memory. ok s

Re: python equivalent for fputc

2006-08-30 Thread Putty
Thanks, John. That's exactly what I was looking for! John Machin wrote: > Putty wrote: > > I'm porting a program a friend wrote in C over to Python and I've run > > into a little hang-up. The C program writes characters out to a file. > > I'm 99% sure that a conversion is going on here as well.

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Aahz
In article <[EMAIL PROTECTED]>, Neil Schemenauer <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: >> >> My company uses 2.2 and 2.3; we hope to drop 2.2 Real Soon Now. > >This has been an interesting thread. There has been some discussion >on python-dev about doing another 2.3 bugfix r

Re: GC and security

2006-08-30 Thread Aahz
In article <[EMAIL PROTECTED]>, Les Schaffer <[EMAIL PROTECTED]> wrote: > >so i am curious. so long as i drop all reference to the passphrase >string(s), eventually it gets garbage collected and the memory recycled. >so "before long" the phrase is gone from memory. Assuming you're talking about C

Re: Allowing ref counting to close file items bad style?

2006-08-30 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I disagree strongly with this assertion. It's not as efficient overall > as other GC implementations, but it's not a case of "less efficient to > do the same task". Reference counting buys you deterministic GC in the > pretty common case where you

Re: The lib email parse problem...

2006-08-30 Thread 叮叮当当
thanks. i have use a temp method to overcome it . i still think the email lib should give the boundary border to parse mail. code is as following: def parse_mail_content(self, mail): content ='' alter =False subty ='' html ='' plain =

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Neil Schemenauer
Aahz <[EMAIL PROTECTED]> wrote: > My company uses 2.2 and 2.3; we hope to drop 2.2 Real Soon Now. This has been an interesting thread. There has been some discussion on python-dev about doing another 2.3 bugfix release. Based on the number of people still using 2.3, it looks to me like there wou

Re: The lib email parse problem...

2006-08-30 Thread neoedmund
myself wrote a multipart parser in java(i customise it because i need get information of "upload progress"). and i think it's also easy to implement in python, i've not have time done it, or i'll post it. but if you're no other special needs, just use email lib, it's quick to program and if you rea

Re: M$ windows python libs installed in arbitrary directories forcustomized python distributions

2006-08-30 Thread alf
Robert Kern wrote: > alf wrote: > >> Fredrik Lundh wrote: >> >>> http://www.catb.org/~esr/faqs/smart-questions.html#writewell >>> >>> >> >> >> and means? > > > It's his signature. > The sig is delimited by '-- \n' -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Egg problem (~/.python-eggs)

2006-08-30 Thread Damjan
>> I'm trying to install a program that uses Durus on a server. It >> appears that if a Python program uses eggs, it creates a >> ~/.python-eggs/ directory, so the home directory must be writeable. >> This conflicts with server environments where you want to run a daemon >> with minimum privilege

Re: A Sort Optimization Technique: decorate-sort-dedecorate

2006-08-30 Thread neoedmund
yeah, java also have 2 interface, Comparator and Comparable, which equal to python's compareTo() and __cmp__() Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Tom Cole wrote: > > > In Java, classes can implement the Comparable interface. This interface > > contains only one method, a com

Re: Persistent Session in CGI

2006-08-30 Thread Damjan
> But.. WSGI is the new CGI Let me give you a minimal example using RhubarbTart (it depends on Paste) from rhubarbtart import request, response, expose from rhubarbtart import TartRootController class Root(TartRootController): @expose def index(self, msg="Hello world!"): response

Re: python equivalent for fputc

2006-08-30 Thread John Machin
Putty wrote: > I'm porting a program a friend wrote in C over to Python and I've run > into a little hang-up. The C program writes characters out to a file. > I'm 99% sure that a conversion is going on here as well. I know for a > fact that it's taking a number and turning it into a character.

Re: python equivalent for fputc

2006-08-30 Thread bearophileHUGS
Putty wrote: > I'm porting a program a friend wrote in C over to Python and I've run > into a little hang-up. The C program writes characters out to a file. > I'm 99% sure that a conversion is going on here as well. I know for a > fact that it's taking a number and turning it into a character. >

python equivalent for fputc

2006-08-30 Thread Putty
I'm porting a program a friend wrote in C over to Python and I've run into a little hang-up. The C program writes characters out to a file. I'm 99% sure that a conversion is going on here as well. I know for a fact that it's taking a number and turning it into a character. So what kind of call c

Re: Persistent Session in CGI

2006-08-30 Thread Damjan
> I have started a new small web project, and was wondering if there are > any good guides on how to do Persistent Sessions and Authentication > using python and CGI. I don't really want too use Zope, because It's > probably overkill for my tiny project. Since you only mention Zope... Why not use

Re: Truly platform-independent DB access in Python?

2006-08-30 Thread Boris Dušek
[EMAIL PROTECTED] wrote: ... snip ... > So, if what you were really asking was "what SQL databases can I access > without installing any software other than Python?", then the answer is "No > SQL databases were distributed with Python prior to 2.5. Starting with > Python 2.5, access to sqlite

Re: GC and security

2006-08-30 Thread Les Schaffer
Paul Rubin wrote: > You can't rely on anything like that, either on the Python GC side or > from the OS (which might have long since written the passphrase out to > the swap disk) without special arrangement. we offered to disable swap for this app (its not memory intensive) but this level of p

Re: all ip addresses of machines in the local network

2006-08-30 Thread damacy
Amit Khemka wrote: > On 8/24/06, Amit Khemka <[EMAIL PROTECTED]> wrote: > > On 23 Aug 2006 21:46:21 -0700, damacy <[EMAIL PROTECTED]> wrote: > > > hi, sandra. > > > > > > no, it's not as complicated as that. all i want to do is to load a > > > database onto different machines residing in the same n

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Jorge Godoy
"Tim Golden" <[EMAIL PROTECTED]> writes: > Well, one answer would be: because it's really quite hard to > work out if there are, in fact, no changes which would break > existing code. Obviously, if everything's nicely tied up with > tests etc. it should be plain-sailing. But if it's not... Even w

Re: Egg problem (~/.python-eggs)

2006-08-30 Thread Mike Orr
Mike Orr wrote: > I'm trying to install a program that uses Durus on a server. It > appears that if a Python program uses eggs, it creates a > ~/.python-eggs/ directory, so the home directory must be writeable. > This conflicts with server environments where you want to run a daemon > with minimum

Egg problem (~/.python-eggs)

2006-08-30 Thread Mike Orr
I'm trying to install a program that uses Durus on a server. It appears that if a Python program uses eggs, it creates a ~/.python-eggs/ directory, so the home directory must be writeable. This conflicts with server environments where you want to run a daemon with minimum privileges. Second, it a

Re: newbe question about removing items from one file to another file

2006-08-30 Thread [EMAIL PROTECTED]
Anthra Norell wrote: > Dexter, > > Here's a function that screens out all instrument blocks and puts them into a > dictionary keyed on the instrument number: > > > > def get_instruments (file_name): > >INSIDE = 1 >OUTSIDE = 0 > >f = file (

Re: GC and security

2006-08-30 Thread Paul Rubin
Les Schaffer <[EMAIL PROTECTED]> writes: > so i am curious. so long as i drop all reference to the passphrase > string(s), eventually it gets garbage collected and the memory recycled. > so "before long" the phrase is gone from memory. > > is there a best practice way to do this? You can't rely o

Re: question about SOAPpy

2006-08-30 Thread Daniel O'Brien
For my purposes I'm not particularly satisfied. Though there's always a possibility that it's operator error on my part. To name off a few issues: - I've yet to find a good way to force data to be consistently untyped. Setting the "typed" configuration option doesn't seem to untype data consistent

Re: inet_aton and struct issue

2006-08-30 Thread David Bear
David Bear wrote: > Diez B. Roggisch wrote: > >> David Bear schrieb: >>> I found this simple recipe for converting a dotted quad ip address to a >>> string of a long int. >>> >>> struct.unpack('L',socket.inet_aton(ip))[0] >>> >>> trouble is when I use this, I get >>> >>> struct.error: unpack s

Re: TNEF decoder

2006-08-30 Thread Simon Forman
Hendrik van Rooyen wrote: > "Simon Forman" <[EMAIL PROTECTED]> wrote: > > 8<- > > > | A place I once worked at had a project that included some TNEF > | handling. There was one developer assigned fulltime to it. He was the > | one who sat at his desk hurling curses at

Re: inet_aton and struct issue

2006-08-30 Thread David Bear
Diez B. Roggisch wrote: > David Bear schrieb: >> I found this simple recipe for converting a dotted quad ip address to a >> string of a long int. >> >> struct.unpack('L',socket.inet_aton(ip))[0] >> >> trouble is when I use this, I get >> >> struct.error: unpack str size does not match format >>

Large LCD/Plasma TV Output

2006-08-30 Thread [EMAIL PROTECTED]
I'm soon going to be starting on a little program that needs to output tabular information to a large LCD or Plasma screen. Python is, of course, my preferred language. My first instinct is PyGame, which I have programming for a PC monitor before. Has anyone else had any experience with any Pytho

Re: GC and security

2006-08-30 Thread Felipe Almeida Lessa
2006/8/30, Les Schaffer <[EMAIL PROTECTED]>: > is there a best practice way to do this? I'm not a cryptographer, but you should really try the function collect() inside the gc module. -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list

GC and security

2006-08-30 Thread Les Schaffer
i am working on a python application that uses encryption as part of its security features. so then at some point someone has to enter a passphrase into the system and passed into a decryption functions (we are using gpg via subprocess). so i am curious. so long as i drop all reference to the pass

Re: Coding style and else statements

2006-08-30 Thread Ben Finney
"Carl Banks" <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > "Carl Banks" <[EMAIL PROTECTED]> writes: > > > def foo(thing): > > > if thing: > > > return thing+1 > > > else: > > > return -1 > > > assert False > > > > To my eyes, that's less readable than, and has no

Re: refering to base classes

2006-08-30 Thread Jan Niklas Fingerle
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > I suppose "this" refers to the use of super() ? If so, I wouldn't say > it's "superior", but it can be helpful with complex inheritence scheme ... which aren't anywhere in sight. Don't start using super() until you need diamond shape inheritance (n

Re: What make a great community

2006-08-30 Thread Ben Finney
"flit" <[EMAIL PROTECTED]> writes: > Results: > > No response from microsoft, and always 3 responses for posts on this > lists. > I just want to say thank you for all. > And notice that this is a great community.. Great people make a great community, of course. However, the dynamics of free softw

Re: Python for Windows

2006-08-30 Thread Larry Bates
mistral wrote: > hg писал(а): > >> Grant Edwards wrote: >> Will the msi installer modify registry or other system files? Does it possible install Python not touching registry and system files? >> You can make your own installer to install Python, and make sure the >> registry is not

Re: Name of the file associated with sys.std*

2006-08-30 Thread Matthew Woodcraft
Henryk Modzelewski <[EMAIL PROTECTED]> wrote: >It might be a trivial question, but I seem to be lost. > >Is there a way to get names of the files associated with stdin/out/ >err if those are redirected to the files at the shell command-line? I doubt there is a portable way. On most linux-based s

Re: csv module strangeness.

2006-08-30 Thread John Machin
tobiah wrote: > > However, more generally, the docs also clearly state that "In addition > > to, or instead of, the dialect parameter, the programmer can also > > specify individual formatting parameters, which have the same names as > > the attributes defined below for the Dialect class." > > I d

Re: csv module strangeness.

2006-08-30 Thread tobiah
> However, more generally, the docs also clearly state that "In addition > to, or instead of, the dialect parameter, the programmer can also > specify individual formatting parameters, which have the same names as > the attributes defined below for the Dialect class." I definitely missed that. Kn

Re: models & editors in PyQt4

2006-08-30 Thread David Boddie
Skink wrote: > David Boddie wrote: > > I find it strange that you have to triple-click to edit any of the > > items in your example. Do you see the same behaviour? > oh, this is default Qt behavoiur: first click selects row, second select > editor (for ColorProperty, IntProperty & StringProperty

Re: csv module strangeness.

2006-08-30 Thread John Machin
tobiah wrote: > > The docs clearly state what the defaults are, but they are not > in the code. It seems so clumsy to have to specify every one > of these, just to change the delimiter from comma to tab. > That particular case is handled by the built-in (but cunningly concealed) 'excel-tab' clas

Re: unit testing failure makes no sense

2006-08-30 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I have some unit testing code in one of my modules that appears to > run without an error, but the unit test fails anyhow. Have a look at > the output below -- the TestResult seems to have no errors and no > failures, yet I get a system exit. sys.exit(0) is just a norma

Re: csv module strangeness.

2006-08-30 Thread tobiah
for row in csv.reader(instream, delimiter="\t"): Awesome. Thanks. -- Posted via a free Usenet account from http://www.teranews.com -- http://mail.python.org/mailman/listinfo/python-list

Re: csv module strangeness.

2006-08-30 Thread Peter Otten
tobiah wrote: >> you may be misreading the docs; the Dialect has no values at all, and >> must be subclassed (and the subclass must provide settings). > > The docs clearly state what the defaults are, but they are not > in the code. It seems so clumsy to have to specify every one > of these, jus

Re: csv module strangeness.

2006-08-30 Thread skip
tobiah> So now it works, but it is still strange about the absent tobiah> defaults. The csv.Dialect class is essentially pure abstract. Most of the time I subclass csv.excel and just change the one or two things I need. Skip -- http://mail.python.org/mailman/listinfo/python-list

unit testing failure makes no sense

2006-08-30 Thread listservs
I have some unit testing code in one of my modules that appears to run without an error, but the unit test fails anyhow. Have a look at the output below -- the TestResult seems to have no errors and no failures, yet I get a system exit. ---

Re: Split with python

2006-08-30 Thread John Machin
tobiah wrote: > John Machin wrote: > > tobiah wrote: > > > >> Of course, fixing the csv file takes a little more work. It sounds like > >> the > >> test lines given were just one of the fields, and there are > >> the quotes to worry about. > >> > > [snip] > >> But then this fails if there are co

Re: Allowing ref counting to close file items bad style?

2006-08-30 Thread Matthew Woodcraft
Dan <[EMAIL PROTECTED]> wrote: > Is this discouraged?: > > for line in open(filename): > > > That is, should I do this instead?: > > fileptr = open(filename) > for line in fileptr: > > fileptr.close() One reason to use close() explicitly is to make sure tha

Re: inet_aton and struct issue

2006-08-30 Thread Diez B. Roggisch
David Bear schrieb: > I found this simple recipe for converting a dotted quad ip address to a > string of a long int. > > struct.unpack('L',socket.inet_aton(ip))[0] > > trouble is when I use this, I get > > struct.error: unpack str size does not match format > > I thought ip addresses were unsi

Debugging reference counts in python/C

2006-08-30 Thread karmadharma
Hello everybody I am trying to make sure that my (non trivial) C module is cleaning up properly after itself, and consequently I've built python with --py-debug which, besides allowing me to use certain functions, it also prints the reference count at the end. I am finding, however, that the refe

Re: csv module strangeness.

2006-08-30 Thread tobiah
> you may be misreading the docs; the Dialect has no values at all, and > must be subclassed (and the subclass must provide settings). The docs clearly state what the defaults are, but they are not in the code. It seems so clumsy to have to specify every one of these, just to change the delim

Name of the file associated with sys.std*

2006-08-30 Thread Henryk Modzelewski
Hi, It might be a trivial question, but I seem to be lost. Is there a way to get names of the files associated with stdin/out/ err if those are redirected to the files at the shell command-line? Thanks, Henryk -- http://mail.python.org/mailman/listinfo/python-list

inet_aton and struct issue

2006-08-30 Thread David Bear
I found this simple recipe for converting a dotted quad ip address to a string of a long int. struct.unpack('L',socket.inet_aton(ip))[0] trouble is when I use this, I get struct.error: unpack str size does not match format I thought ip addresses were unsigned 32 bit integers. Is there a better

Re: Duck typing alows true polymorfisim

2006-08-30 Thread The Ghost In The Machine
In comp.lang.java.advocacy, Jeroen Wenting wrote on Wed, 30 Aug 2006 20:18:52 +0200 <[EMAIL PROTECTED]>: > > "Simon Forman" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> [EMAIL PROTECTED] wrote: >>> lets say you want a generic numerical algorithom like sum >>> > >> What's your

Re: Managing database tables through web-forms (automatically)

2006-08-30 Thread Steve Holden
Antal Rutz wrote: > Hi, > > I want to manage database(sql) tables through the web: actions like > insert/edit/list/delete. > An application often needs just a database table to be easily managable > through the web by the users. > > Now I realized that everytime I write a new app > I need to rew

Re: csv module strangeness.

2006-08-30 Thread tobiah
> > That's possible but why didn't you follow the way `csv.Dialect` set the > class attributes? > > class MyDialect(csv.Dialect): > delimiter = '\t' > lineterminator = '\n' > # and so on… Because I'm hung over. -- Posted via a free Usenet account from http://www.teranews.com --

Re: csv module strangeness.

2006-08-30 Thread Fredrik Lundh
tobiah wrote: > The docs are a little terse, but I gather that I am supposed > to subclass cvs.Dialect: > > class dialect(csv.Dialect): > pass > > Now, the docs say that all of the attributes have reasonable > defaults, but instantiating the above gives: you may be misreading the docs;

Re: csv module strangeness.

2006-08-30 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, tobiah wrote: > I'm trying to create a cvs.reader object using a custom dialect. > > The docs are a little terse, but I gather that I am supposed > to subclass cvs.Dialect: > > class dialect(csv.Dialect): > pass > > Now, the docs say that all of the attributes ha

Re: py2exe for programs with excel COM objects

2006-08-30 Thread implicate_order
[EMAIL PROTECTED] wrote: > Is it possible to create a executable of a python program that refers > to Excel COM objects with the help of py2exe. Hi, I just used py2exe to create an executable. If you want to deliver the package with an installation wizard, just use Inno Setup tools (http://www.jr

Re: csv module strangeness.

2006-08-30 Thread tobiah
Ok, I'm an idiot. I didn't even pass my dialect object to the reader() call. So now it works, but it is still strange about the absent defaults. Tobiah > This runs, but the delimiter is still the comma. > When list.csv is comma delim, it works correctly, > but when list.csv has tab separated v

csv module strangeness.

2006-08-30 Thread tobiah
I'm trying to create a cvs.reader object using a custom dialect. The docs are a little terse, but I gather that I am supposed to subclass cvs.Dialect: class dialect(csv.Dialect): pass Now, the docs say that all of the attributes have reasonable defaults, but instantiating the above gives

Managing database tables through web-forms (automatically)

2006-08-30 Thread Antal Rutz
Hi, I want to manage database(sql) tables through the web: actions like insert/edit/list/delete. An application often needs just a database table to be easily managable through the web by the users. Now I realized that everytime I write a new app I need to rewrite the whole thing according to th

Re: audio with graphics

2006-08-30 Thread Terry Hancock
[EMAIL PROTECTED] wrote: > How do I make audio play when the graphics window is opened and then > loop so it repeats until the graphics window is closed? I'm not even > sure how to make ANY audio file play in using Python. This only makes sense in the context of some kind of multimedia library

Dr. Dobb's Python-URL! - weekly Python news and links (Aug 30)

2006-08-30 Thread Jack Diederich
QOTW: "The best working hypothesis is that upgrading will break things." - Grant Edwards "Should I take this to mean: "Don't go near TNEF because your underwear will become carnivorous and consume your genitalia?" - Hendrik van Rooyen Which is better, Turbogears or Rails? Flame on.

Re: sys.argv[0] doesn't always contain the full path of running script.

2006-08-30 Thread Ivan Zuzak
gmax2006 wrote: > Hi, > > I use RedHat linux. > > How can I find where exactly the current python script is running? Hi, Doesnt __file__ attribute of each module contain the full filepath of the module? So, try this: filepath = __file__ print filepath Works for me :) Cheers, i. zuzak -- htt

Callbacks

2006-08-30 Thread Gheorghe Postelnicu
Hi, I am using Python to develop a GUI for some underlying C++ computation. I wrap my Cpp code using SWIG. As my computation takes some time, I am considering ways to provide the user with some feedback on the state of the Cpp code. Unfortunately, it seems I cannot use directly a Python procedur

Re: Coding style and else statements

2006-08-30 Thread Carl Banks
Steve Holden wrote: > Carl Banks wrote: > [...] > > However, I have rare cases where I do choose to use the else (ususally > > in the midst of a complicated piece of logic, where it's be more > > distracting than concise). In that case, I'd do something like this: > > > > def foo(thing): > >

Re: Coding style and else statements

2006-08-30 Thread Carl Banks
Ben Finney wrote: > "Carl Banks" <[EMAIL PROTECTED]> writes: > > > However, I have rare cases where I do choose to use the else > > (ususally in the midst of a complicated piece of logic, where it's > > be more distracting than concise). In that case, I'd do something > > like this: > > > > def f

Re: win32com.client & OS X

2006-08-30 Thread has
> I'd like to know if it is possible to call the win32com.client > component using Python on MAC OS X (or maybe Linux) and, if so, how? OS X doesn't really do COM; it's mostly Apple events at the desktop level. See for a Python-AE bridge. If you want more detaile

Re: Split with python

2006-08-30 Thread tobiah
John Machin wrote: > tobiah wrote: > >> Of course, fixing the csv file takes a little more work. It sounds like the >> test lines given were just one of the fields, and there are >> the quotes to worry about. >> > [snip] >> But then this fails if there are commas in the >> data. I could split an

Re: ANN: Templayer 1.3 - HTML templating library

2006-08-30 Thread Jarek Zgoda
Ian Ward napisał(a): > Templayer was created to offer an alternative to the more common ways of > generating dynamic HTML: embedding code within the HTML or embedding > HTML within code. Instead of mixing HTML and Python, two rich and > extremely expressive languages, Templayer adds a small amount

Re: Duck typing alows true polymorfisim

2006-08-30 Thread Jeroen Wenting
"Simon Forman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > [EMAIL PROTECTED] wrote: >> lets say you want a generic numerical algorithom like sum >> > What's your question? (Or, if no question, point?) :-) > Reads like the weekly "Ruby is better than Java because X" post.

Re: dictionary with object's method as thier items

2006-08-30 Thread Bruno Desthuilliers
noro wrote: > great that is what i looked for. Hmmm... Not quite sure class C: >> ... def function(self, arg): >> ... print arg >> ... >> >>> obj = C() >> >>> d = C.__dict__ >> >>> d['function'](obj, 42) >> 42 > > this allows me the access the same method in a range of object

Re: audio with graphics

2006-08-30 Thread Pontus Ekberg
On Wed, 30 Aug 2006 17:00:56 +, [EMAIL PROTECTED] wrote: > How do I make audio play when the graphics window is opened and then > loop so it repeats until the graphics window is closed? I'm not even > sure how to make ANY audio file play in using Python. > Please give us more information, we

Re: py2exe for programs with excel COM objects

2006-08-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is it possible to create a executable of a python program that refers > to Excel COM objects with the help of py2exe. the py2exe site is full of nice howto articles; this one might help in your case: http://www.py2exe.org/index.cgi/IncludingTypelibs -- http:/

Re: How ahead are you guys in the (Python) real world?

2006-08-30 Thread Aahz
In article <[EMAIL PROTECTED]>, Ray <[EMAIL PROTECTED]> wrote: > >Since I haven't used Python at work, I am using Python 2.5 right now. >However I wonder, how fast are you guys moving from version to version >at work? As an illustration my ex-company just moved to Java 5, which >was released around

Re: active python windows

2006-08-30 Thread hg
[EMAIL PROTECTED] wrote: > When I test my program the graphics window opens over the top of the > command line, but for some odd reason the command line remains the > active window, so I have to click on the grphics window to make it the > active window. I was just curious as to why this might be h

Re: Coding style and else statements

2006-08-30 Thread [EMAIL PROTECTED]
Tal Einat wrote: > I meant to say that: > > (thing and [thing+1] or [-1])[0] > > is more readable (IMO) than: > > thing != -1 and (thing and thing+1 or -1) or 0 Neither is particularly readable, though I agree that the latter is worse since it has to have the third option ("0") on the end. But I'

Re: Syntax suggestion.

2006-08-30 Thread George Sakkis
samir wrote: > Saluton! > > Being a fond of Python, I had this idea: Why not making Python a Unix > shell? It's been done; it's called "IPython": http://ipython.scipy.org/doc/manual/manual.html George -- http://mail.python.org/mailman/listinfo/python-list

win32com.client & OS X

2006-08-30 Thread n3llyb0y
Hi All, I'd like to know if it is possible to call the win32com.client component using Python on MAC OS X (or maybe Linux) and, if so, how? Cheers, Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing ref counting to close file items bad style?

2006-08-30 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > > (And personally I think the benefits to programmers of guaranteeing > > > > ref-counting semantics would outweigh the additional headaches for > > > > Jython and other alternative implementations). > > Ref counting is a rat

active python windows

2006-08-30 Thread [EMAIL PROTECTED]
When I test my program the graphics window opens over the top of the command line, but for some odd reason the command line remains the active window, so I have to click on the grphics window to make it the active window. I was just curious as to why this might be happening and if it was possible t

py2exe for programs with excel COM objects

2006-08-30 Thread [EMAIL PROTECTED]
Is it possible to create a executable of a python program that refers to Excel COM objects with the help of py2exe. -- http://mail.python.org/mailman/listinfo/python-list

audio with graphics

2006-08-30 Thread [EMAIL PROTECTED]
How do I make audio play when the graphics window is opened and then loop so it repeats until the graphics window is closed? I'm not even sure how to make ANY audio file play in using Python. _ PrivatePhone - FREE telephone numbe

code for the graphics window?

2006-08-30 Thread [EMAIL PROTECTED]
Hi. I'm new to Python . . .very new. I was just wondering, once I've written a program that opens the graphics window and I've got some things going on in the grahics window, how do I display text in the grahics window? I need to be able to display changeable text, so that the words and numbers can

ANN: Templayer 1.3 - HTML templating library

2006-08-30 Thread Ian Ward
Announcing Templayer 1.3 Templayer home page: http://excess.org/templayer/ Tarball: http://excess.org/templayer/templayer-1.3.tar.gz About this release: === This release includes new documentation and a new auto-reload feature useful for mod_pyth

Re: wait for keystoke

2006-08-30 Thread John Purser
On Wed, 30 Aug 2006 12:45:41 -0400 "david brochu jr" <[EMAIL PROTECTED]> wrote: > I want to add a "press any key to continue" option to my script, > where the script pauses until the users presses any key. Does anyone > know how I would do this without having to add in an if statement in > the mid

wait for keystoke

2006-08-30 Thread david brochu jr
I want to add a "press any key to continue" option to my script, where the script pauses until the users presses any key. Does anyone know how I would do this without having to add in an if statement in the middle of my existing script? Is there a method already to accomplish this? -- http://mail

Re: windows pagfile utilization

2006-08-30 Thread Richard Brodie
"Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Thanks for putting 4 gigs of ram in your machine. How about I let you use 2 > of 'em > while I underutilize the other 2 gigs?" > > Sounds silly, IMHO. Well, for a lot of scenarios, it's going to be the 2GB limit on sy

Re: windows pagfile utilization

2006-08-30 Thread djoefish
I guess that means that I shouldn't waste my money bumping my RAM up from 1g to 2g? What about Linux? Are there constraints there too? djoefish -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >