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] http://www.livingcosmos.org/Members/sundevil/python/articles/a-comparison-of-python-class-objects-and-init-

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:

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 whic

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 migra

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á. Respondé

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 ju

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('',

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: "PythonHand

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 get

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 execu

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 wa

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 envir

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 objec

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

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

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 > usua

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 developer

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

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 fo

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 whi

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 Ja

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

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 declare

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'

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 i

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.

"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. Clear

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 v

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 PYTHON

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 co

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 th

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

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/filenam

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 stre

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. -- http://mail.python.org/mailman

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: Im

Re: Get CPU usage of a single process in Windows

2006-09-12 Thread Gerrit Muller
[Tim Golden] now I only have to find some time to play around... thanks, Gerrit -- Gaudi systems architecting: -- 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. >

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

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 insta

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. -- http://mail.python.org/mailman/listinfo/pyt

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, th

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 enginee

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 > http://www.unixreview.c

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: http://overlook.homelinux.net/wilso

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 parall

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 appreci

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 -- http://m

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. > http://twi

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 relatives

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 fer

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 o

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 tha

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 sometim

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 exc

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 t

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). Ob

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 th

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

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 >>

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 (*). *) See Annex B. I only ha

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 beh

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

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 us

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 als

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 cr

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

2006-09-12 Thread metaperl
--> python -i >>> class = "algebra" File "", 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

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) | > |

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 "", 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 >

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 po

Code to add docstrings to classes

2006-09-12 Thread Matthew Wilson
On Tue 12 Sep 2006 10:06:27 AM EDT, Neil Cerutti wrote: > Writing a thin wrapper around the dictionary might be beneficial, > and would also furnish a place for the docstrings. I wrote a function that hopefully does just that. I'm not very savvy at doing this class-factory stuff, so any advice w

Re: question about including something like sqlite in python

2006-09-12 Thread skip
John> I guess I am just trying to figure out why I'm a little surprised John> sqlite was included, but at the same time I'm excited to use it John> and the fact that it will now be standard has caused me to look John> into more than otherwise. :) You might find some of the discuss

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

2006-09-12 Thread skip
Nick> 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 >> | >> | o

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

2006-09-12 Thread Istvan Albert
metaperl wrote: > --> python -i > >>> class = "algebra" > File "", line 1 > class = "algebra" > ^ > SyntaxError: invalid syntax Designing a syntax to avoid all possible newbie errors is impractical because as soon as you are finished with one iteration the new newbies will start m

Re: Looking for the Perfect Editor

2006-09-12 Thread Omar
thanks for all the responses... I'm liking the way ulipad and scite work I'd switch to ulipad entirely if I canget to recognize the python interpreter in the preferences menu. I can't seem to figure that out. Also, I'm highly interested in getting the snippets manager working. any ideas? --

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

2006-09-12 Thread Tim Golden
[EMAIL PROTECTED] | Sent: 12 September 2006 16:04 | To: python-list@python.org | Subject: Re: best way of testing a program exists before using it? | | Nick> Tim Golden <[EMAIL PROTECTED]> wrote: | >> [Nick Craig-Wood] | >> | >> | Tim Golden <[EMAIL PROTECTED]> wrote: | >> | >

Re: Clarify Regex in Python.

2006-09-12 Thread [EMAIL PROTECTED]
k, people, thanks for ur replys. -- http://mail.python.org/mailman/listinfo/python-list

Re: variable update

2006-09-12 Thread Bruno Desthuilliers
Fredrik Lundh wrote: (snip) > >variable = None > >... lots of code that may assign to variable ... > >if variable is not None: >print "not defined" Shouldn't that be: if variable is None: print "not defined" ?-) Note to the OP: if None is a valid value for th

Re: egg and modpython

2006-09-12 Thread Bruno Desthuilliers
Paul Boddie wrote: > 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

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

2006-09-12 Thread Paul Rubin
"Mike Owens" <[EMAIL PROTECTED]> writes: > > It's not the job of the System Test Engineer to design things. > > It's his job to find fault with everything. I just happen to be very > > good at finding faults with things. > > And apparently not very good at providing any constructive solutions. As

Re: "filtered view" upon lists?

2006-09-12 Thread Wildemar Wildenburger
Jorge Godoy wrote: > 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).

  1   2   3   >