ANN: ChiPy Thurs. September 14, 2006. 7pm @ Google, Chicago

2006-09-12 Thread bray
Chicago Python User Group = Come join us for our best meeting ever! Topics -- * Google Code (Brian Fitzpatrick and Ben Collins-Sussman) * Trac + Subversion + doctests (Garrett Smith) * Special method names for operator overloading (Brian Ray) Location

ANN: pyXSD 0.1 released

2006-09-12 Thread Karl Norby
pyXSD v.0.1 has been released! pyXSD is a tool to map XML and XSD (XML Schema) into Python. It can validate an XML file against an XSD file. It also contains a feature to allow users to easily transform an XML file, using small python classes that are easy to use and are easy and fast for users to

Re: wxPython, how to autoresize a frame?

2006-09-12 Thread David
Il Sun, 10 Sep 2006 19:15:40 +0200, David ha scritto: The problem is that, when sizer2 containig hidden controls collapses to zero dimensions, the panel resizes, but sizer1 and sizer0 don't! Consequently the frame does not want to autoresize. You con dowload the code here:

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread MonkeeSage
Licheng Fang wrote: Oh, please do have a look at the second link I've posted. There's a table comparing the regexp engines. The engines you've tested probably all use an NFA implementation. Sorry! *blush* I admit I skipped over your links. I'll have a look now. BTW, just an idea that may or

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Licheng Fang
Thank you very much, Tim and Monkee. In fact, what I'm doing is handle a lot of regular expressions. I wanted to build VERY LONG regexps part by part and put them all into a file for easy modification and maintenance. The idea is like this: (*INT) = \d+ (*DECIMAL) = (*INT)\.(*INT) (*FACTION) =

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread MonkeeSage
Or mabye something like this is better: def matcher(string, pattern): out = '' for match in re.findall(r'\S*%s\S*' % pattern, string): if (len(match) = len(out)): out = match return out p1 = 'dodad donkeykong dolittle dodaday' p2 = 'oneself self-serving selfsufficient

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], metaperl wrote: # Of course I could cheat and pass it, but I don't want to: directories = data.storage.logic(__file__) Why do you consider a plain and simple solution cheating? Ciao, Marc 'BlackJack' Rintsch --

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: At Tuesday 5/9/2006 16:23, [EMAIL PROTECTED] wrote: I would be surprised if they had never used ANY database. A little thing like dynamic field typing will simply make it impossible to migrate your Sqlite data to a *real* database. Why not? Because it breaks the

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread Miki
I am looking for something like the caller() routine in Perl: http://perldoc.perl.org/functions/caller.html Look at the inspect module in Python's standard library. Or is you're feeling lazy, have a look at the here function found in

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Tim Peters
[Licheng Fang[ ... In fact, what I'm doing is handle a lot of regular expressions. I wanted to build VERY LONG regexps part by part and put them all into a file for easy modification and maintenance. The idea is like this: (*INT) = \d+ (*DECIMAL) = (*INT)\.(*INT) (*FACTION) =

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Bryan Olson
Licheng Fang wrote: Oh, please do have a look at the second link I've posted. There's a table comparing the regexp engines. The engines you've tested probably all use an NFA implementation. Unfortunately, the stuff about NFA's is wrong. Friedl's awful book was the first time I saw this

A Comparison of Python Class Objects and Init Files for Program Configuration

2006-09-12 Thread metaperl
A Comparison of Python Class Objects and Init Files for Program Configuration = Terrence Brannon [EMAIL PROTECTED]

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Tim Peters
[Licheng Fang] Oh, please do have a look at the second link I've posted. There's a table comparing the regexp engines. The engines you've tested probably all use an NFA implementation. [Bryan Olson] Unfortunately, the stuff about NFA's is wrong. Friedl's awful book Strongly disagree: it's

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread [EMAIL PROTECTED]
Mike Owens wrote: And if you say SQLite misrepresents itself, then what do you say about MySQL, which until version 5 didn't have views or triggers? In fact, it didn't even have subselects until version 4. For a period of years, SQLite had more mainstream SQL features than MySQL. Yet you

Re: auto upgrade scripts?

2006-09-12 Thread stefaan . himpe
Auto-upgrade from what to what? -Larry Bates Interesting question. In my case I want my program to check for (e.g.) bug-fix releases on some location (network drive or ftp), and if available, allow to automatically download and install them. Kind of like the AutoUpgrade functionality in .net

Re: 4 Simple Questions About Python/IDLE

2006-09-12 Thread Gabriel Genellina
At Thursday 7/9/2006 13:44, Omar wrote: I'm working through a tutorial, http://swaroopch.info/text/Byte_of_Python:Control_Flow, and I sorta can't get through the tutorial without overcoming these little speedbumps. This is why I'm asking these questions. Have you read the Python tutorial

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread MonkeeSage
[EMAIL PROTECTED] wrote: But it was stated in the sqlite docs that ALL SQL databases use static types implying that sqlite will be incompatible with any heavy database should the need arise to migrate upwards. The issue is not that there will be compatibilty problems with any data migration

Re: PILGraph Upgrade or Alternative Suggestion

2006-09-12 Thread Gabriel Genellina
At Thursday 7/9/2006 22:35, Roger wrote: Anyone have an updated version of PILGraph beyond 0.1a7 or a suggestion for a light-weight alternative? pychart Gabriel Genellina Softlab SRL __ Preguntá.

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread MonkeeSage
Oops! Sorry for the top-post! -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyserial problem. script stops reading.

2006-09-12 Thread Hendrik van Rooyen
"Frederic Wenzel" [EMAIL PROTECTED] Wrote:On 9/9/06, Frederic Wenzel [EMAIL PROTECTED] wrote: On 9/9/06, Hendrik van Rooyen [EMAIL PROTECTED] wrote: | I wrote a script on Linux that uses pyserial to read status messages | from a serial line using readlines(). For now, it just displays

Re: Problems with email.Generator.Generator

2006-09-12 Thread Max M
Chris Withers wrote: Chris Withers wrote: print msg.as_string() MIME-Version: 1.0 Content-Type: text/plain; charset; charset=utf-8 ^^^ Actually, even this isn't correct as you can see above... charset = Charset('utf-8') msg = MIMEText('','plain',None)

Re: egg and modpython

2006-09-12 Thread Bruno Desthuilliers
Paul Boddie wrote: Bruno Desthuilliers wrote: Wensheng a écrit : I installed pysqlite2 using easy_install. and got this when using it from modpython: -- Mod_python error: PythonHandler

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
Tim Golden [EMAIL PROTECTED] wrote: if os.path.isfile (filepath): print filepath You might get a more accurate result using os.access(filepath, os.X_OK) instead of os.path.isfile(filepath) Which checks the file is executable -- Nick Craig-Wood [EMAIL PROTECTED] --

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread gatti
kondal wrote: This is the way the regexp works python doesn't has anything to do with it. It starts parsing the data with the pattern given. It returns the matched string acording the pattern and doesn't go back to find the other combinations. I've recently had the same problem in Java,

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread Bruno Desthuilliers
Marty wrote: On 9/11/06, Mike Owens [EMAIL PROTECTED] wrote: I coworker pointed me to this thread. Joy for us. snipped good information In all seriousness, the information you present here is great, and much appreciated. Your sarcastic, condescending tone kind of gets in the way of

RE: best way of testing a program exists before using it?

2006-09-12 Thread Tim Golden
[Nick Craig-Wood] | Tim Golden [EMAIL PROTECTED] wrote: | if os.path.isfile (filepath): | print filepath | | You might get a more accurate result using | | os.access(filepath, os.X_OK) | | instead of | | os.path.isfile(filepath) | | Which checks the file is

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Licheng Fang
Bryan Olson wrote: Licheng Fang wrote: Oh, please do have a look at the second link I've posted. There's a table comparing the regexp engines. The engines you've tested probably all use an NFA implementation. Unfortunately, the stuff about NFA's is wrong. Friedl's awful book was the

Re: BaseHTTPServer weirdness

2006-09-12 Thread Steve Holden
Ron Garret wrote: In article [EMAIL PROTECTED], Kent Johnson [EMAIL PROTECTED] wrote: Steve Holden wrote: Ron Garret wrote: In article [EMAIL PROTECTED], Steve Holden [EMAIL PROTECTED] wrote: But basically, you aren't providing a CGI environment, and that's why cgi.parse() isn't

Re: Problems with email.Generator.Generator

2006-09-12 Thread Peter Otten
Chris Withers wrote: Okay, more out of desperation than anything else, lets try this: from email.Charset import Charset,QP from email.MIMEText import MIMEText from StringIO import StringIO from email import Generator,Message Generator.StringIO = Message.StringIO = StringIO charset =

Re: Problems with email.Generator.Generator

2006-09-12 Thread Chris Withers
Max M wrote: From the docs: The payload is either a string in the case of simple message objects or a list of Message objects for MIME container documents (e.g. multipart/* and message/rfc822) Where'd you find that? I must have missed it in my digging :-S Message objects are always

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Licheng Fang
[EMAIL PROTECTED] wrote: kondal wrote: This is the way the regexp works python doesn't has anything to do with it. It starts parsing the data with the pattern given. It returns the matched string acording the pattern and doesn't go back to find the other combinations. I've recently

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Paul Rubin
Licheng Fang [EMAIL PROTECTED] writes: I think if the backtrack is carried out in an exaustive way, we may say the engine trys every possibility on the NFA, though it's not an NFA itself. The backtracking engine really can recognize languages that are not describable by classical regexps, by

Re: Get CPU usage of a single process in Windows

2006-09-12 Thread Gerrit Muller
Tim Golden wrote: ...snip... This should be possible as Taskmanager tracks CPU usage for every process... Anyone know how this can be done? WMI can probably do the trick. If you can find something on Google for wmi cpu usage (or something similar) then translation to Python's usually quite

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread gatti
Licheng Fang wrote: Another question: my task is to find in a given string the substrings that satisfies a particular pattern. That's why the first tool that came to my mind is regular expression. Parsers, however, only give a yes/no answer to a given string. To find all substrings with a

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Paul Rubin
Mike Owens [EMAIL PROTECTED] writes: No it doesn't. If you don't like SQLite's design decisions, write your own embedded relational database, and stop yapping about something you didn't lift a finger to create, but are clearly trying to benefit from. That's silly. The sqlite developers are

Re: How to get the longest possible match with Python's RE module?

2006-09-12 Thread Fredrik Lundh
Licheng Fang wrote: The idea is like this: (*INT) = \d+ (*DECIMAL) = (*INT)\.(*INT) (*FACTION) = (*DECIMAL)/(*DECIMAL) (*NUMERALS) = (*FACTION)|(*DECIMAL)|(*INT) ... ... What's inside the sytactically wrong (* and ) is something to be replaced, and then I wrote a little script to do

deprecated python 2.5

2006-09-12 Thread bussiere maillist
DeprecationWarning: struct integer overflow masking is deprecated return struct.pack('H', ~value) i didn't understand if someone have some explanation and what uses instead. -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] markup.py 1.5 - a lightweight HTML/XML generator

2006-09-12 Thread Gerhard Häring
Daniel Nogradi wrote: A new release of markup.py is available at http://markup.sourceforge.net/ The markup module is an intuitive, lightweight, easy-to-use, customizable and pythonic HTML/XML generator. [...] It's more than only a bit confusing that there's also Markup: A toolkit for

Re: deprecated python 2.5

2006-09-12 Thread John Machin
bussiere maillist wrote: DeprecationWarning: struct integer overflow masking is deprecated return struct.pack('H', ~value) i didn't understand if someone have some explanation and what uses instead. Which 2.5 are you using? Mine (2.5c1, win32) gives me *TWO* messages, the second of which

Re: deprecated python 2.5

2006-09-12 Thread Fredrik Lundh
bussiere maillist wrote: DeprecationWarning: struct integer overflow masking is deprecated return struct.pack('H', ~value) i didn't understand if someone have some explanation and what uses instead. the value doesn't fit in 16 bits. try masking off the extra bits on the way in:

RE: Get CPU usage of a single process in Windows

2006-09-12 Thread Tim Golden
[Gerrit Muller] | | Tim Golden wrote: | WMI can probably do the trick. I'm fairly sure I've got an example | somewhere, but I can't lay my hands on it at the mo. | If you have a working example of CPU usage could you post the | result? I | would be interested. I haven't time to revisit it

Re: egg and modpython

2006-09-12 Thread Paul Boddie
Bruno Desthuilliers wrote: eggs are the Python's equivalent to Java's JAR, not a RPM-like. I said it was not an egg-specific issue (which is not totally accurate) because it mostly have to do with loading dynamic libs (.so, .dll etc) from zipped files. True. It is notable that various Java

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Fredrik Lundh
Mike Owens wrote: Crackpot? And now we get to why I took the flamebait -- wonderfully constructive comments such as this. I know SQLite's author. Besides being a nice and clearly very intelligent person, he also holds a master's degree in electrical engineering from Georgia Tech and a PhD

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Fredrik Lundh
Steve Holden wrote: Sure. But if you go back to the start of the thread you'll remember the OP was originally complaining that SQLite was being promoted in the Python docs as SQL compliant. It clearly isn't if its response to the insertion of a data value that conflicts with the declared

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Steve Holden
Paul Rubin wrote: Mike Owens [EMAIL PROTECTED] writes: No it doesn't. If you don't like SQLite's design decisions, write your own embedded relational database, and stop yapping about something you didn't lift a finger to create, but are clearly trying to benefit from. That's silly. The

Re: Problems with email.Generator.Generator

2006-09-12 Thread Max M
Chris Withers wrote: Max M wrote: From the docs: The payload is either a string in the case of simple message objects or a list of Message objects for MIME container documents (e.g. multipart/* and message/rfc822) Where'd you find that? I must have missed it in my digging :-S End

Re: deprecated python 2.5

2006-09-12 Thread bussiere maillist
thks Regards Bussiere On 9/12/06, Fredrik Lundh [EMAIL PROTECTED] wrote: bussiere maillist wrote: DeprecationWarning: struct integer overflow masking is deprecated return struct.pack('H', ~value) i didn't understand if someone have some explanation and what uses instead. the value

filtered view upon lists?

2006-09-12 Thread Wildemar Wildenburger
Hi there :) I don't know how else to call what I'm currently implementing: An object that behaves like a list but doesn't store it's own items but rather pulls them from a larger list (if they match a certain criterion). Changes to the filter are instantly reflected in the underlying list.

FW: Re: [Spambayes] How to create a valid RPM?

2006-09-12 Thread Edgar Matzinger
ls, On 09/12/2006 11:48:10 AM, [EMAIL PROTECTED] wrote: when I download python-spambayes-1.0rc2-2.src.rpm, install it and run rpmbuild -ba ../SPECS/python-spambayes.spec, I get a lot of error messages. It complains about a lot of installed but unpackaged files. How can I create a valid

Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
After may frustrated attempts I came to know that match function in python re package actually start the matchs at the begining of the subject, where search will find the given pattern any where in the subject. My Problem is, I want to know how can I force match functions to match the pattern

Re: Running python from a usb drive

2006-09-12 Thread cjl
Jason: Thanks! That worked...in fact, almost everything is now working as expected (so far). Here is my batch file: echo Making changes to path and file associations... path = %PATH%;%CD%Python24;%CD%Python24\libs;%CD%Python24\Scripts;%CD%Python24\Lib\site-packages;%CD%Python24\DLLs set

RE: Get CPU usage of a single process in Windows

2006-09-12 Thread Tim Golden
[Gerrit Muller] | If you have a working example of CPU usage could you post the | result? I would be interested. OK. Here's a workingish example, cut down from the link I posted earlier. This one was designed to work with Win2K which I was using at the time. For WinXP and later, there's a new

RE: Running python from a usb drive

2006-09-12 Thread Tim Golden
[cjl] [... snip ...] | set PATHTEXT=.py;%PATHTEXT% | I'm still having a problem with setting PATHTEXT... That would be because it's PATHEXT not PATHTEXT (it's sort of like a PATH but for EXTensions). TJG This e-mail has

Re: Clarify Regex in Python.

2006-09-12 Thread A.M. Kuchling
On 12 Sep 2006 05:07:03 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: My Problem is, I want to know how can I force match functions to match the pattern any location in the subject. i.e I want to turn off before said behaviour. Use search() instead; that's why the method is there.

Re: Clarify Regex in Python.

2006-09-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: After may frustrated attempts I came to know that match function in python re package actually start the matchs at the begining of the subject, where search will find the given pattern any where in the subject. My Problem is, I want to know how can I force match

variable update

2006-09-12 Thread km
Hi all Is there any handy untility for checking if a variable is populated at runtime ? regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Help me use my Dual Core CPU!

2006-09-12 Thread Simon Wittber
I've just bought a new notebook, which has a dual core CPU. I write cross platform games in Python, and I'd really like to be able to use this second core (on my machine, and on user's machines) for any new games I might write. I know threads won't help (in CPython at least) so I'm investigating

Re: best way of testing a program exists before using it?

2006-09-12 Thread Hari Sekhon
Tim Williams wrote: Alternatively there is os.path.exists which works for files or directories, but calling it every time you use the wrapper is probably more expensive than using the try statement when the program *does* exist. import os.path if not os.path.exists('/dir1/dir2/filename'):

Re: Running python from a usb drive

2006-09-12 Thread cjl
Tim: That would be because it's PATHEXT not PATHTEXT (it's sort of like a PATH but for EXTensions). Doh. Me fail English? That's unpossible. Thanks, I think everything is working with my poor man's movable python. Last on my todo list is to restore the assoc and ftype settings when I'm done,

Re: markup.py 1.5 - a lightweight HTML/XML generator

2006-09-12 Thread Daniel Nogradi
A new release of markup.py is available at http://markup.sourceforge.net/ The markup module is an intuitive, lightweight, easy-to-use, customizable and pythonic HTML/XML generator. [...] It's more than only a bit confusing that there's also Markup: A toolkit for stream-based

Re: Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
Erm, is there some specific reason why you can't just use the search method? Why does it *have* to be match()? regards Steve I know there r many more methods to do the job, I just wonder can we turnoff the default behaviour of match method. Thanks. --

error

2006-09-12 Thread prashant.burghate
Hi, Today is my first day of working on python. I want to execute python script through C++ program. I found one very good article with example at http://docs.python.org/ext/pure-embedding.html. I followed the procedure as given, the code is compiled but while running it is giving error like:

Re: Get CPU usage of a single process in Windows

2006-09-12 Thread Gerrit Muller
[Tim Golden] nice answer snipped now I only have to find some time to play around... thanks, Gerrit -- Gaudi systems architecting: http://www.gaudisite.nl/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarify Regex in Python.

2006-09-12 Thread John Machin
[EMAIL PROTECTED] wrote: Erm, is there some specific reason why you can't just use the search method? Why does it *have* to be match()? regards Steve I know there r many more methods to do the job, I just wonder can we turnoff the default behaviour of match method. Don't wonder.

Re: Running python from a usb drive

2006-09-12 Thread John Machin
cjl wrote: Tim: That would be because it's PATHEXT not PATHTEXT (it's sort of like a PATH but for EXTensions). Doh. Me fail English? That's unpossible. Thanks, I think everything is working with my poor man's movable python. Last on my todo list is to restore the assoc and ftype

Re: filtered view upon lists?

2006-09-12 Thread Jorge Godoy
Wildemar Wildenburger [EMAIL PROTECTED] writes: I don't know how else to call what I'm currently implementing: An object that behaves like a list but doesn't store it's own items but rather pulls them from a larger list (if they match a certain criterion). Changes to the filter are instantly

Re: Clarify Regex in Python.

2006-09-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I know there r many more methods to do the job, I just wonder can we turnoff the default behaviour of match method. that's not the default behaviour, that's how match works. if you want search, use search instead. /F --

Re: variable update

2006-09-12 Thread Fredrik Lundh
km wrote: Is there any handy untility for checking if a variable is populated at runtime ? access it, and catch the NameError: try: variable except NameError: print not defined else: print defined leaving variables undefined is usually bad style, though;

RE: Help me use my Dual Core CPU!

2006-09-12 Thread Tim Golden
[Simon Wittber] | I write cross platform games in Python, and I'd really like to be able | to use this second core (on my machine, and on user's | machines) for any new games I might write. | I know threads won't help (in CPython at least) so I'm investigating | other types of concurrency which

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], metaperl wrote: # Of course I could cheat and pass it, but I don't want to: directories = data.storage.logic(__file__) Why do you consider a plain and simple solution cheating? Hmm, I dont know the proper software engineering term,

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Miki wrote: I am looking for something like the caller() routine in Perl: http://perldoc.perl.org/functions/caller.html Look at the inspect module in Python's standard library. Or is you're feeling lazy, have a look at the here function found in

Re: error

2006-09-12 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: Hi, [...] Step 3: Wrote the given script of multipication in a file named as multiply (using vi editor) The name of module should be multiply.py HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

I wish I could add docstrings to vars.

2006-09-12 Thread Matthew Wilson
I build a lot of elaborate dictionaries in my interpreter, and then I forget exactly how they work. It would be really nice to be able to add notes to the dictionary. Is there some way to do this now? Matt -- A better way of running series of SAS programs:

Re: Help me use my Dual Core CPU!

2006-09-12 Thread Paul Rubin
Simon Wittber [EMAIL PROTECTED] writes: Are there any other concurrency options I've not discovered yet? I've been wondering about the different Python MPI bindings that are out there, and whether they might make sense for general purpose concurrency when they were designed mostly for parallel

Re: Parsing String, Dictionary Lookups, Writing to Database Table

2006-09-12 Thread Rich Shepard
On Mon, 11 Sep 2006, [EMAIL PROTECTED] wrote: No, if you're going to insert into sqlite3, you don't want a csv string, you want a list of values (see example code below). Thank you very much. It makes solid sense and I can see the differences and where I was not on track. I greatly

Re: error

2006-09-12 Thread John Machin
[EMAIL PROTECTED] wrote: Hi, Today is my first day of working on python. I want to execute python script through C++ program. I found one very good article with example at http://docs.python.org/ext/pure-embedding.html. I followed the procedure as given, the code is compiled but while

Re: error

2006-09-12 Thread John Machin
Rob Wolfe wrote: [EMAIL PROTECTED] wrote: Hi, [...] Step 3: Wrote the given script of multipication in a file named as multiply (using vi editor) The name of module should be multiply.py module != source_file module don't have no ferschlugginer dots in its name --

Re: Help me use my Dual Core CPU!

2006-09-12 Thread Simon Wittber
Tim Golden wrote: + Pyro - http://pyro.sf.net + Corba - eg omniorb http://omniorb.sourceforge.net/ + SPyRO - http://lsc.fie.umich.mx/~sadit/spyro/spyro.html + mmap - (built-in module) http://docs.python.org/lib/module-mmap.html + twisted - (because it can do everything), esp.

RE: Help me use my Dual Core CPU!

2006-09-12 Thread Tim Golden
| But I have the feeling I'm teaching my grandmother... Is that | the kind of thing you were after? Or not? | | I'm not familiar with the expression 'teaching my grandmother'. What | exactly does it mean? Teaching my grandmother to suck eggs (and probably several variants with other

Re: error

2006-09-12 Thread Rob Wolfe
John Machin wrote: Rob Wolfe wrote: [EMAIL PROTECTED] wrote: Hi, [...] Step 3: Wrote the given script of multipication in a file named as multiply (using vi editor) The name of module should be multiply.py module != source_file module don't have no ferschlugginer dots in

Validation of email

2006-09-12 Thread Norman Khine
Hello, What is the best way to generate a long authentication string and email this so that the user can reply and verify that the email address they have provided is authentic, similar I guess to the way Bugzilla works? Should this be server side or client? How would one tackle an expiry limit

Re: How to get the package, file, and line of a method/function invocant?

2006-09-12 Thread metaperl
Marc 'BlackJack' Rintsch wrote: In [EMAIL PROTECTED], metaperl wrote: # Of course I could cheat and pass it, but I don't want to: directories = data.storage.logic(__file__) Why do you consider a plain and simple solution cheating? Ok now I figured it out. The reason is that this

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread Mike Owens
On 12 Sep 2006 00:15:41 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Just to be fair... You do hear many people claiming exactly that, and the primary complaint is often exactly the same one that's being levelled against sqlite here (it's incredibly lax with types and does sometimes

Re: question about including something like sqlite in python

2006-09-12 Thread John Salerno
Dan Sommers wrote: It's difficult to imagine any one developer (or development shop) using the entire library, so at least one module must be extraneous. That's a good point. I guess I am just trying to figure out why I'm a little surprised sqlite was included, but at the same time I'm

Re: Running python from a usb drive

2006-09-12 Thread cjl
John: Congratulations. Now: how much time have you spent, and how much per hour are you worth? hours * dollars_per_hour GBP_to_USD(4.99) ??? Since you mention it, I am currently earning about $200 an hour (when I'm working), and I spent about 3 hours on this, so this cost me about $600. I

RE: Running python from a usb drive

2006-09-12 Thread Tim Golden
[cjl] | Any ideas about how to set file type associations without writing to | the registry? Well, yes. Just the same as was in the article you pointed to... or have I missed something? assoc .py=python.file ftype python.file=c:\python24\python.exe %1 %* (or whatever version of Python).

Re: Secure XMLRPC Server / PEM Files

2006-09-12 Thread Laszlo Nagy
Daniel Crespo írta: Hi Laszlo, I have read that. It's the wrapper for the usage of OpenSSL, so I have to install it. I have downloaded the Borland C++ compiler, and I'm doing so right now, but I'm not getting good results yet. You do not need any compiler. You just need to install the

Re: I wish I could add docstrings to vars.

2006-09-12 Thread Neil Cerutti
On 2006-09-12, Matthew Wilson [EMAIL PROTECTED] wrote: I build a lot of elaborate dictionaries in my interpreter, and then I forget exactly how they work. It would be really nice to be able to add notes to the dictionary. Is there some way to do this now? Writing a thin wrapper around the

Re: filtered view upon lists?

2006-09-12 Thread Paul McGuire
Jorge Godoy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Wildemar Wildenburger [EMAIL PROTECTED] writes: I don't know how else to call what I'm currently implementing: An object that behaves like a list but doesn't store it's own items but rather pulls them from a larger

Re: SQLwaterheadretard3 (Was: Is it just me, or is Sqlite3 goofy?)

2006-09-12 Thread Fredrik Lundh
Mike Owens wrote: The bottom line: to use *any* database effectively, big or small, one has to read its documentation, not the SQL standard. note that the SQL standard tells you to read the documentation for the database you're using, in at least 149 places (*). /F *) See Annex B. I only

RE: Running python from a usb drive

2006-09-12 Thread Tim Golden
| [cjl] | | | Any ideas about how to set file type associations without writing to | | the registry? | [Tim Golden] | Well, yes. Just the same as was in the article you pointed | to... or have I missed something? Ah, I see. Presumably the FTYPE / ASSOC commands write things to the registry

Re: Help me use my Dual Core CPU!

2006-09-12 Thread Paul Rubin
Simon Wittber [EMAIL PROTECTED] writes: For game programming purposes, I was hoping someone could point me to a technique for sharing objects across Python processes, preferably without any kind of marshal/unmarshal steps. It's a long shot, I know. To be viable, I'll need to be able to pass

Re: Is it just me, or is Sqlite3 goofy?

2006-09-12 Thread Mike Owens
On 11 Sep 2006 21:35:28 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Mike Owens wrote: On 11 Sep 2006 18:23:50 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can you run your car on diesel fuel? Why not? Because your car's specification says to use gasoline? If

Re: variable update

2006-09-12 Thread Steve Holden
Fredrik Lundh wrote: km wrote: Is there any handy untility for checking if a variable is populated at runtime ? access it, and catch the NameError: try: variable except NameError: In a function when accessing a not-yet-bound local variable you may also (as

Re: best way of testing a program exists before using it?

2006-09-12 Thread Nick Craig-Wood
Tim Golden [EMAIL PROTECTED] wrote: [Nick Craig-Wood] | Tim Golden [EMAIL PROTECTED] wrote: | if os.path.isfile (filepath): | print filepath | | You might get a more accurate result using | | os.access(filepath, os.X_OK) | | instead of | |

From bags to default dicts

2006-09-12 Thread Mark E. Fenner
Hello all, I was curious if anyone has transitioned some code from using Raymond Hettinger's bag class: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/259174 to using 2.5's collections.defaultdict. Any pitfalls to watch out for? It seems we should be able to do slightly better than

Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread metaperl
-- python -i class = algebra File stdin, line 1 class = algebra ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class definition but class followed by equals is a simple assignment? Also, I had a bug

RE: best way of testing a program exists before using it?

2006-09-12 Thread Tim Golden
| Tim Golden [EMAIL PROTECTED] wrote: | [Nick Craig-Wood] | | | Tim Golden [EMAIL PROTECTED] wrote: | | if os.path.isfile (filepath): | | print filepath | | | | You might get a more accurate result using | | | | os.access(filepath, os.X_OK) | | | | instead

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread Diez B. Roggisch
metaperl schrieb: -- python -i class = algebra File stdin, line 1 class = algebra ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class definition but class followed by equals is a simple

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-12 Thread Richard Brodie
metaperl [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Why isn' t the parser smart enough to see that class followed by an identifier is used for class definition but class followed by equals is a simple assignment? Because it's simpler to reserve words than worry about possible

  1   2   3   >