Re: yield_all needed in Python

2005-03-02 Thread Skip Montanaro
Jeremy> At first I liked this, but the reason that is a syntax error is Jeremy> that it is "supposed" to be Jeremy> def f(): Jeremy> yield (x for x in gen1(arg)) Jeremy> which today on 2.4 returns a generator instance which will in Jeremy> turn yield one generator ins

Re: why is http://pysqlite.org down ?

2005-03-02 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: H! I'm trying things with databases and Python 2.4 for windows2000. And now I want to try pysqlite. but http://pysqlite.org/ is down It is in the process of being made an alias for the real new home: http://initd.org/projects/pysqlite and http://pysqlite.sourceforge

Re: Python - what is the fastest database ?

2005-03-02 Thread km
Hi all, Google has specially designed file system 'Goolgle File System' too. KM - On Mon, Feb 28, 2005 at 01:43:53PM -0500, Terry Reedy wrote: > > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> How is i

Re: Distributing applications

2005-03-02 Thread Serge Orlov
Jaime Wyant wrote: > This becomes especially hairy when someone is updating from 1.0 to > say 1.5. Then I have to keep track of all the deltas between > 1.0/1.5. My way is much simpler because I don't have to keep up with > *anything*. As long as I test my code against my custom built > distribut

passing lists

2005-03-02 Thread Earl Eiland
I have a program in which I'm passing a list to functions. When I reference an element in a function to which it is passed, I get the error message "unsubscriptable object". When printing the list contents in that same function, I get "xxx is ". How do I pass a list? Earl Eiland -- http://mai

Re: passing lists

2005-03-02 Thread Bill Mill
Earl, Please post the smallest snippet of code you can which illustrates your problem. No list is an unsubscriptable object, so you seem to be passing something that is not a list to your function. As it stands, you don't give enough information to give an actual answer. Peace Bill Mill bill.mil

Re: HELP: Python equivalent of UNIX command "touch"

2005-03-02 Thread Wolfgang Strobl
pekka niiranen <[EMAIL PROTECTED]>: >Does anybody know Python recipe for changing the date >of the directory or files in W2K to current date and time? >In UNIX shell command "touch" does it. See below. The key is using the FILE_FLAG_BACKUP_SEMANTICS flag. #---

Re: Distributing applications

2005-03-02 Thread Thomas Heller
"Serge Orlov" <[EMAIL PROTECTED]> writes: > Jaime Wyant wrote: > >> This becomes especially hairy when someone is updating from 1.0 to >> say 1.5. Then I have to keep track of all the deltas between >> 1.0/1.5. My way is much simpler because I don't have to keep up with >> *anything*. As long as

Re: Running Python Scripts With 'sudo'

2005-03-02 Thread Jeff Epler
Does "sudo" sanitize the environment? Imagine that the user can set PYTHONPATH, PYTHONINSPECT, etc. Beyond that, you have the same problems as with any code that runs with "extra privileges". Can the user supply any code that is fed to patently unsafe primitives (like the unpickler, eval() or th

UML modeling tools

2005-03-02 Thread Pete Brunet
What are your recommendations for a UML modeling tool with these requirements (or something that comes close): - low learning curve, easy to use, good performance, high quality - runs on Linux(FC3) and Win(XP) - or JVM - low in price <$500 - can export/print images in various formats including HTM

Re: Distributing applications

2005-03-02 Thread Jaime Wyant
Sneaky! I like it. Now if there was only a subversion python module... jw On Wed, 02 Mar 2005 22:08:45 +0100, Thomas Heller <[EMAIL PROTECTED]> wrote: > "Serge Orlov" <[EMAIL PROTECTED]> writes: > > > Jaime Wyant wrote: > > > >> This becomes especially hairy when someone is updating from 1.0 t

Re: Need help running external program

2005-03-02 Thread Rigga
Brian van den Broek wrote: > Rigga said unto the world upon 2005-02-27 15:04: >> Tim Jarman wrote: > > > >>>No, the r was the point - it's there to tell Python not to do any >>>escaping on the string. Try it again with the r and see what happens. >>> >> >> Brilliant!!! that works a treat than

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Mar 1)

2005-03-02 Thread Richard Jones
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wed, 2 Mar 2005 10:50 am, Cameron Laird wrote: > Also, has anyone indexed Python bloggers (that is, > webloggers of things Pythonic)? My page http://mechanicalcat.net/pyblagg.html (from the wiki http://lowlife.jp/cgi-bin/moin.cgi/PythonProgrammers

Re: yield_all needed in Python

2005-03-02 Thread Francis Girard
Le mercredi 2 Mars 2005 21:32, Skip Montanaro a écrit : > def f(): >     yield from (x for x in gen1(arg)) > > Skip This suggestion had been made in a previous posting and it has my preference : def f(): yield from gen1(arg) Regards Francis -- http://mail.python.org/mailman/listinfo/python

substring matching

2005-03-02 Thread M.N.A.Smadi
hi; say i have the following variable data="""XYZ dflsjdfkl sdfsdhfl jdsflkdsjf sldjfsldjf """ i need to make sure that the first part is actually XYZ, is there an easy way of doing that? thanks m.smadi -- http://mail.python.org/mailman/listinfo/python-list

Re: substring matching

2005-03-02 Thread Bill Mill
On Wed, 02 Mar 2005 16:43:29 -0500, M.N.A.Smadi <[EMAIL PROTECTED]> wrote: > hi; > > say i have the following variable > > data="""XYZ dflsjdfkl sdfsdhfl > jdsflkdsjf > sldjfsldjf > """ > > i need to make sure that the first part is actually XYZ, is there an > easy way of doing that? > d

Re: substring matching

2005-03-02 Thread Roel Schroeven
M.N.A.Smadi wrote: > hi; > > say i have the following variable > > data="""XYZ dflsjdfkl sdfsdhfl > jdsflkdsjf > sldjfsldjf > """ > > i need to make sure that the first part is actually XYZ, is there an > easy way of doing that? data.startswith("XYZ") -- "Codito ergo sum" Roel Schroeven

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: > Brian van den Broek wrote: > >> Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) > Thanks for all your help with this it is appreciated, one further question > though, how do I pass a variable to the external program while using the > r""" > > Than

Re: Distributing applications

2005-03-02 Thread Tim Jarman
Jaime Wyant wrote: > Sneaky! I like it. Now if there was only a subversion python module... > > jw > GIYF: http://pysvn.tigris.org/ -- Website: www DOT jarmania FULLSTOP com -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help running external program

2005-03-02 Thread Rigga
Tim Jarman wrote: > Rigga wrote: > >> Brian van den Broek wrote: >> >>> Rigga said unto the world upon 2005-02-27 15:04: > > (snip stuff about raw strings) > >> Thanks for all your help with this it is appreciated, one further >> question though, how do I pass a variable to the external progra

Net.ObjectDays 2005 Ð Call for Papers

2005-03-02 Thread Eliot Miranda
Net.ObjectDays 2005 Ð Call for Papers Erfurt, Germany, September 19-22 www.netobjectdays.org Net.ObjectDays is one of the major international conferences on object-oriented and Internet-based technologies, concepts, and applications. Based on its strong focus on research and innovation, Net.Obje

Re: bsddb for k, v in db.items(): do order the numbers ?

2005-03-02 Thread Christopher De Vries
On Wed, Mar 02, 2005 at 01:31:04PM +0300, Denis S. Otkidach wrote: > You are not right, records in BTree (btopen) are certainly sorted. For > positive integers you can pack keys with struct.pack('>I', value). You're right... I missed the btopen (rather a key thing to miss I know, but when you hav

Re: passing lists

2005-03-02 Thread Earl Eiland
def Match(..., Raw_packet_queue, ...): ... print 'in Match, Raw_Packet_queue is', Raw_packet_queue # this returns 'Reader object at 0xaaa' ... return [Last_Passed, Last_Dropped, Raw_packet_queue] # this causes 'unsubscriptable object'error message #*

Re: passing lists

2005-03-02 Thread Steven Bethard
Earl Eiland wrote: def Match(..., Raw_packet_queue, ...): ... print 'in Match, Raw_Packet_queue is', Raw_packet_queue # this returns 'Reader object at 0xaaa' ... return [Last_Passed, Last_Dropped, Raw_packet_queue] # this causes 'unsubscriptable object'error message

automating assignment of class variables

2005-03-02 Thread Martin MOKREJŠ
Hi, I need to build 3 classes for my work, but each have dozens or hundreds of variables, self bound. I have about 250 columns in about 10 mysql tables. I can squeeze everything into 10 classes, each representing single table. I happily utilize the argument checks when a class is instantiated, so t

Re: passing lists

2005-03-02 Thread Steve Holden
Earl Eiland wrote: def Match(..., Raw_packet_queue, ...): ... print 'in Match, Raw_Packet_queue is', Raw_packet_queue # this returns 'Reader object at 0xaaa' ... return [Last_Passed, Last_Dropped, Raw_packet_queue] # this causes 'unsubscriptable object'error message

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: (snip) >> > This is the command I am trying to run: > > feed is a list of web addresses > > output, input = popen2("wget -q %s -O - | tr '\r' '\n' | tr \' \" | sed -n > 's/.*url="\([^"]*\)".*/\1/p'" % feed[counter]) > > But it does not work, if I escape the string using r""" and

Re: Need help running external program

2005-03-02 Thread Steve Holden
Rigga wrote: Tim Jarman wrote: Rigga wrote: Brian van den Broek wrote: Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) Thanks for all your help with this it is appreciated, one further question though, how do I pass a variable to the external program while using

Python COM API binding job offer

2005-03-02 Thread Guy Robinson
Hello, I have an API I have tried to create a python binding to. It involves creating com server functions which are then registered with the parent application. I am not a professional programmer nor do I have much win programming knowledge. As such what I am wanting to do is pay someone to dow

Gordon McMillan installer and Python 2.4

2005-03-02 Thread Svein Brekke
Hi. Thank you Gordon McMillan for a very nice freeze tool for python. (I use it on Windows XP SP2 for creating a single-file self-extracting wxPython based installation script for a non-python application.) Recently I upgraded to python 2.4, and on my system any .exe file generated by the install

Re: Distributing applications

2005-03-02 Thread Robert Kern
Jaime Wyant wrote: Sneaky! I like it. Now if there was only a subversion python module... Google, and you shall find. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman

What is the best way to handle a command line argument that includes an escape sequence like \n?

2005-03-02 Thread Joe
I'm using Python 2.4 on Windows XP SP2. I'm trying to receive a command line argument that is a newline (\n) Here is the command line to use sample.py "\n" Here is a sample.py script import sys c = sys.argv[1] # when run c is set to \\n instead of \n. I created a test batch file echo %1 t

Re: looking for expertise

2005-03-02 Thread Neil Hodgson
Michael: > Like I said, it's only supposed to run on linux; anyway, is it likely > that problems will arise when filenames I have to handle have > basically three sources: > ... > 3. filenames created by user input Have you worked out how you want to handle user input that is not representable

Re: Distributing applications

2005-03-02 Thread Stephen Thorne
On Wed, 2 Mar 2005 13:07:25 -0600, Jaime Wyant <[EMAIL PROTECTED]> wrote: > However, if you have an idea on updating py2exe bundled apps, I'm all ears... I'm working on a little project that requires remote updating. What I basically came up with is two nested applications. program/program.exe r

Re: how to control a USB DISK?

2005-03-02 Thread Greg Fischer
I actually tried this last summer on linux and I think in order to make it work right I had to use the hotplug features AND udev. I had to use udev because I needed a specific mount path, otherwise it just picked the next in the list if there was more than one drive. I ended up skipping that proj

Re: What is the best way to handle a command line argument that includes an escape sequence like \n?

2005-03-02 Thread Steven Bethard
Joe wrote: It appears that Python treats the comand line string as a raw string. what is the best way to work around the issue? You probably want to use str.decode with the encoding 'string_escape'[1] py> s = r'\n\t' py> s '\\n\\t' py> s.decode('string_escape') '\n\t' STeVe [1]http://docs.python.or

Suscribe

2005-03-02 Thread dvd
-- http://mail.python.org/mailman/listinfo/python-list

mx.ODBC 2.0.7 bug?

2005-03-02 Thread Joe
Python 2.4 Windows XP SP2 MS Access 2000 mx.ODBC 2.0.7 Problem data truncation occuring (here's the actual error message): mxODBC.Warning: ('01004', 5, '[Microsoft][ODBC Microsoft Access Driver] String data, right truncated on column number 3 (Expr1002)', 3326) I believe that have found a bug

Re: What is the best way to handle a command line argument that includes an escape sequence like \n?

2005-03-02 Thread Joe
Steve, THANKS! That is exactly what I was looking for but unable to find. Joe "Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Joe wrote: >> It appears that Python treats the comand line string as a raw string. >> >> what is the best way to work around the issue?

Re: Need direction to kill a virus

2005-03-02 Thread James Stroud
Four steps, meant to help, really. 1. shut down your computer 2. erase your hard drive 3. install linux with a firewall 4. reboot You can always run your beloved window$ under vmware. Alternately, get a Mac. You will never have another problem like this again. The real virus is your operating

Subscription donations to PSF

2005-03-02 Thread Alan McIntyre
Hi all, I asked the PSF folks if they plan on offering a subscription donation option, and they do eventually, if there's enough interest. If you have any interest in donating a small amount (preferably >= US$5) to the PSF on a regular basis (monthly?), then please respond here in the newsgroup

Re: Gordon McMillan installer and Python 2.4

2005-03-02 Thread Simon John
Seriously, if you're only interested in Windows, just use py2exe, or if you want Linux+Windows, try cx_Freeze. -- http://mail.python.org/mailman/listinfo/python-list

Re: Closing dialog window in Tkinter

2005-03-02 Thread Harlin Seritt
Do you need this toplevel window to not be iconified--where it shows up as a separate window? You can also do this: def new_window(self, master): t = Toplevel() t.transient(master) etc... Svennglen, I put this in here because most likely you're next question may be, how in the world do

Re: urllib2 meta-refresh

2005-03-02 Thread JanC
Artificial Life schreef: > urllib2 does not seem to be able to handle META-REFRESH in an html > document. I just get back the html to the page that is supposed to > forward me to the intended page. Any way around this? Have a look at the HTTPRefreshProcessor in ClientCookie:

Re: Need direction to kill a virus

2005-03-02 Thread Sean Blakey
On Wed, 2 Mar 2005 17:46:44 -0800, James Stroud <[EMAIL PROTECTED]> wrote: > Four steps, meant to help, really. > > 1. shut down your computer > 2. erase your hard drive > 3. install linux with a firewall > 4. reboot > > You can always run your beloved window$ under vmware. > > Alternately, get

RE: How would you program this?

2005-03-02 Thread engsol
When I posted the puzzle, I typo'd the first row. It should read *5* + B + C + D = 22 instead of 3. Thanks to all with suggestions so far. Norm B -- http://mail.python.org/mailman/listinfo/python-list

TiVo HME + Jython: package access constructor

2005-03-02 Thread rt lange
I'm trying to compile a file that subclasses a Class in the TiVo HME SDK that has a package access constructor. The error I get is: 1 .\jpywork\TL.java:109: BView(com.tivo.hme.sdk.View) is not public in com.tivo .hme.bananas.BView; cannot be accessed from outside package super(arg0);

Re: Identify and perform actions to data within stated limits

2005-03-02 Thread Peter Hansen
Mike Meyer wrote: Peter Hansen <[EMAIL PROTECTED]> writes: It may look like an array to you, but it's a list. Python doesn't have arrays Huh? guru% pydoc array ... You got me :-), although you did prune a somewhat relevant part of my above comment, which continued "unless you count something like

Re: os.stat('')[stat.ST_INO] on Windows

2005-03-02 Thread Tim Roberts
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >Tim Roberts wrote: >>>Are inodes supported on Windows NTFS, FAT, FAT32? >> >> No. Inodes are strictly a Unix filesystem concept. > >I disagree. NTFS MFT records are so similar to inodes >that their numbers could well be used in st_ino (except >that

How to write python plug-ins for your own python program?

2005-03-02 Thread Tian
I am writing an audio game using Python. in this game you can apply some sound effects for the clips you have recorded. I want to make this function extensible. I want user to be able to add new sound effect plug-ins in the future. I want the plug-in to be a simple python code (text file) and a de

get textual content of a Xml element using 4DOM

2005-03-02 Thread frankabel
Hi all! I have the following xml file: " hi hello " and need to read all the content between and tags and saved in a string, in this case: " hi hello " Working with "xml.dom.minidom" I can use the "xml.dom.minidom.Node.toxml()" to obtain the string inside one nod

Re: [Python-Dev] Re: OK, time to retire

2005-03-02 Thread Brett C.
[taking python-dev off of the Cc: list] Scott David Daniels wrote: Brett C. wrote: I have decided that I am going to stop doing the python-dev Summaries > after PyCon; the Summary covering the last half of March 2005 will be > it for me. I (as well as most, I'd guess) have enjoyed your voice in t

Re: windows bat file question

2005-03-02 Thread Tim Roberts
Tom Willis <[EMAIL PROTECTED]> wrote: >I'm trying to get pylint running on windows and the bat file for it >seems a little screwy. I'm hoping someone may have figured this out >already. > >rem = """-*-Python-*- script >@echo off >rem DOS section >rem You c

Re: mx.ODBC 2.0.7 bug?

2005-03-02 Thread Steve Holden
Joe wrote: Python 2.4 Windows XP SP2 MS Access 2000 mx.ODBC 2.0.7 Problem data truncation occuring (here's the actual error message): mxODBC.Warning: ('01004', 5, '[Microsoft][ODBC Microsoft Access Driver] String data, right truncated on column number 3 (Expr1002)', 3326) I believe that have fou

Re: How to write python plug-ins for your own python program?

2005-03-02 Thread alex23
Tian wrote: > Is there any good method to > read in python code and test availability and invoke the functions > inside? You mean like 'import'? :) - alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to handle a command line argument that includes an escape sequence like \n?

2005-03-02 Thread Steve Holden
Joe wrote: I'm using Python 2.4 on Windows XP SP2. I'm trying to receive a command line argument that is a newline (\n) Here is the command line to use sample.py "\n" Here is a sample.py script import sys c = sys.argv[1] # when run c is set to \\n instead of \n. I created a test batch file echo %1

PYGTK, Google Suggest-like GUI

2005-03-02 Thread Ali
Hi there, I am using pygtk, and i am implementing a "find as you type" in a text entry. I intend for it to behave like the 'google suggest' box. So, that as you type, a list of values appear below the text box as in a list and you can use arrow keys to select a value. I can't think of a straight-

<    1   2