ANN: Naja 1.2.1 is now available

2005-05-20 Thread webmaster
Naja is a download manager and a website grabber written in Python/wxPython.You can add some plugins (newsreader, FTP - FTPS - SFTP client,WebDAV client) and take control of your downloads from your office. Naja supports proxy (HTTP, HTTPS, FTP,SOCKS v4a, SOCKSv5), and use some authentication

ReleaseForge 0.7.1 - A SourceForge release tool

2005-05-20 Thread [EMAIL PROTECTED]
ReleaseForge 0.7.1 is now available for download. This is a minor bugfix release. This version corrects a formatting bug when submitting project news. Additionally, auto-generated PyQt files were re-generated with pyuic version 3.14 (which fixes a QSizePolicy problem).

dllimporter -- import dlls for zip archived or frozen applications

2005-05-20 Thread Dieter Maurer
'Dllimporter' is a package to facilitate the import of shared libraries (aka dlls or extension modules) for Python applications running from a zip archive or an executable (a frozen application). The standard Python import mechanism cannot import extension modules being part of a zip archived or

ZODB 3.4 beta 1 released

2005-05-20 Thread Tim Peters
I'm pleased to announce the release of ZODB 3.4 beta 1. This corresponds to the ZODB that will ship in Zope 2.8b2. You can download a source tarball or Windows installer from: http://zope.org/Products/ZODB3.4 Note that there are two Windows installers, for Python 2.3 (2.3.5 is recommended)

Announcing : pyglfw

2005-05-20 Thread Sylvain Hellegouarch
Hello folks, I am please to announce the first release of pyglfw, a python binding for GLFW written as an extension module. GLFW is simple framework acting like a glue between OpenGL and the system. The aim of pyglfw is simply for me to get my hands on writing an extension for Python, so this

first release of PyPy

2005-05-20 Thread holger krekel
The PyPy 0.6 release *The PyPy Development Team is happy to announce the first public release of PyPy after two years of spare-time and half a year of EU funded development. The 0.6 release is eminently a preview release.* What it is and where to start

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Kay Schluehr
Dave Brueck wrote: Overall it's been such a positive experience for us that nobody in the company - from grunt testers up to the CTO - has any reservations about using Python in production anymore (even though initially they all did). All of the developers have previous experience with using

[pysqlite] How do I use pysqlite in a multi-threading env.?

2005-05-20 Thread F. GEIGER
In my wxPython-app a part of it gathers data, when a button is pressed, and stores it into a db. The GUI part should display the stuff being stored in the db. When both parts work on the same connection, I get SQL statements in progress errors. Seems ok to me, you can't do that. So, next step:

PyGame and Rotozoom (Sorry if OT)

2005-05-20 Thread J. W. McCall
I'm not sure if this is off-topic, since it doesn't deal with Python itself, but here goes: I'm messing around with writing a simple game where the player (a crudely drawn smiley face) moves by rotating and moving back or forward (think Resident Evil, but from an always-above view). After

Re: readline module and white-space

2005-05-20 Thread Simon Percivall
Take a look at readline.get_completer_delims() and readline.set_completer_delims(). -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Fredrik Lundh
Paul Rubin wrote: Send e-mail to [EMAIL PROTECTED] -- actually, you can have commit privs if you want. I think I'm going to enter an SF bug on the issue if there isn't already one. It's not obvious to me whether a reasonable fix is possible, but at least it should be tracked. The current

Re: [pysqlite] How do I use pysqlite in a multi-threading env.?

2005-05-20 Thread Gerhard Haering
On Fri, May 20, 2005 at 08:42:54AM +0200, F. GEIGER wrote: In my wxPython-app a part of it gathers data, when a button is pressed, and stores it into a db. The GUI part should display the stuff being stored in the db. When both parts work on the same connection, I get SQL statements in

Mail System Error - Returned Mail

2005-05-20 Thread ani
*** WARNING ** This message has been scanned by MDaemon AntiVirus and was found to contain infected attachment(s). Please review the list below. AttachmentVirus name Action taken

Re: SSL (HTTPS) with 2.4

2005-05-20 Thread Andrew Bushnell
That would be nice if something could be added to the distribution. In general, what needs to be done is as follows: #1: Connect to proxy host:port #2: Send CONNECT request with host:443 of secure url you want to tunnel to. Additional headers can be added depending on authorization needed for

Re: XML Newbie needing some serious help..

2005-05-20 Thread Simon Brunning
On 19 May 2005 17:27:05 -0700, rh0dium [EMAIL PROTECTED] wrote: HI all, I am looking to parse a unix tool called lshw ( http://ezix.sourceforge.net/software/lshw.html ). Now this provides a nice XML output which looks similar to the bottom of this message.. That doesn't appear to be

Re: XML Newbie needing some serious help..

2005-05-20 Thread Adriano Ferreira
That doesn't appear to be well-formed XML, which isn't a good start... Indeed. rh0dium, you can't have two nodes elements at root level. If you use an enclosing element around the two nodes, your XML becomes well formed. Like this: ?xml version=1.0 standalone=yes ? root !-- generated by

Re: PIL and line drawing

2005-05-20 Thread Fredrik Lundh
Leonard J. Reder wrote: I am using PIL to annotate some images with lines. I could not find anyway to make the line that is drawn from the ImageDraw object thicker. Does anyone have a suggestion or solution for solving this without to much hacking? if you have 1.1.5, you can use the width

Re: Shift-JIS to UTF-8 conversion

2005-05-20 Thread rbsharp
Hello, I think the answer is basically correct but shift-jis is not a standard part of Python 2.3. You will either need to use Python 2.4 where the cjkcodes are integrated or install them under Python 2.3. The link is http://cjkpython.i18n.org/ You then also need: import cjkcodecs.aliases

Re: Shift-JIS to UTF-8 conversion

2005-05-20 Thread George Yoshida
PyTJ wrote: I need to convert a Japanese Shift-JIS CSV file to Unicode UTF-8. My machine is a Windows 98 english computer with Python 2.3.4 Any hints?. First, you need to install codecs to support japanese encodings. Python 2.3.* does not support SJIS by default. I'll give you two

MySQLdb and Unicode

2005-05-20 Thread Achim Domma (Procoders)
Hi, I try to write unicode strings to a MySQL database via MySQLdb. According to the documentation I should pass 'utf-8' as keyword parameter to the connect method. But then I get the following error: Traceback (most recent call last): File C:\develop\SyynX\unicode_test.py, line 7, in ?

Re: MySQLdb and Unicode

2005-05-20 Thread deelan
Achim Domma (Procoders) wrote: Hi, I try to write unicode strings to a MySQL database via MySQLdb. According to the documentation I should pass 'utf-8' as keyword parameter to the connect method. But then I get the following error: (...) I'm using version 1.2 of MySQLdb. Any hint

Re: PyGame and Rotozoom (Sorry if OT)

2005-05-20 Thread Will McGugan
J. W. McCall wrote: I'm not sure if this is off-topic, since it doesn't deal with Python itself, but here goes: I'm messing around with writing a simple game where the player (a crudely drawn smiley face) moves by rotating and moving back or forward (think Resident Evil, but from an

Cascading menus with Tk

2005-05-20 Thread michelle
Hi all, I am new to Tk, or Python GUI programming and I seem to be stuck. I have looked about for help with Tk GUIs, but everything seems so terse or incomplete?? I have been mostly using the Introduction to Tkinter by Fredrik Lundh

Re: cddb and mci produce an ImportError

2005-05-20 Thread flupke
flupke wrote: snip I finally succeeded in making a proper mci.dll that works. I will document what i did in the coming days and place it here. I developed the dll with DevC++. Anyway, it all works :) Benedict -- http://mail.python.org/mailman/listinfo/python-list

Re: OO design question / Transform object in place?

2005-05-20 Thread andy2O
Dave Benjamin wrote: [EMAIL PROTECTED] wrote: Now suppose I set expression2 = Sum([a,-a]) and Sum.simplify() recognises that the two terms cancel and the Sum has value 0. Can I make expression2.simplify() transform expression2 from an instance of Sum to an instance of Number(0) **in

string formatting quirk?

2005-05-20 Thread [EMAIL PROTECTED]
Hi, ''%([]) doesn't raise exception but ''%('') does Can anyone explain me why?? rgds Anurag -- http://mail.python.org/mailman/listinfo/python-list

Re: pyvm -- faster python

2005-05-20 Thread Susan A. Smith
I have read about parrot. How is that progressing? Stelios Xanthakis wrote: Hi. pyvm is a program which can run python 2.4 bytecode (the .pyc files). A demo pre-release is available at: http://students.ceid.upatras.gr/~sxanth/pyvm/ Facts about pyvm: - It's FAST. According to the

Re: Comparing 2 similar strings?

2005-05-20 Thread John Machin
On 20 May 2005 04:09:26 GMT, [EMAIL PROTECTED] (Patrick TJ McPhee) wrote: In article [EMAIL PROTECTED], John Machin [EMAIL PROTECTED] wrote: % None of the other approaches make the mistake of preserving the first % letter -- this alone is almost enough reason for jettisoning soundex. Metaphone

Re: Cascading menus with Tk

2005-05-20 Thread Peter Otten
michelle wrote: What I am trying to do is add cascading menus to a Tk menu widget like: File New... --- Router --- Firewall Open Exit Just add the submenu with the Router and Firewall entries to the filemenu in the same way you added the submenu with the New, Open, and Exit

Re: string formatting quirk?

2005-05-20 Thread Peter Otten
[EMAIL PROTECTED] wrote: ''%([]) doesn't raise exception but ''%('') does Can anyone explain me why?? That is a side-effect of duck-typing. The duck-type of an empty list is indistinguishable from that of an empty dictionary. Not testing the exact type here achieves consistency with the

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Sorry, scratch that P.S.! The act of hitting Send seems to be a great way of realising one's mistakes. Of course you need colnr - m for those times when m is set to 26. Remembered that when I wrote it, forgot it 2 paragraphs later! -- http://mail.python.org/mailman/listinfo/python-list

a re problem

2005-05-20 Thread cheng
p.sub('','a\nbc') 'abc' p.sub('','%s') % a\nbc 'a\nbc' is it anyone got some idea why it happen? -- http://mail.python.org/mailman/listinfo/python-list

Re: a re problem

2005-05-20 Thread Mikael Olofsson
cheng wrote: p.sub('','%s') % a\nbc 'a\nbc' is it anyone got some idea why it happen? Make that p.sub('','%s' % a\nbc) Regards /Mikael Olofsson Universitetslektor (Senior Lecturer [BrE], Associate Professor [AmE]) Linköpings universitet

Re: a re problem

2005-05-20 Thread Fredrik Lundh
cheng [EMAIL PROTECTED] wrote: p.sub('','a\nbc') 'abc' p.sub('','%s') % a\nbc 'a\nbc' is it anyone got some idea why it happen? p.sub('', 'a\nbc') Traceback (most recent call last): File stdin, line 1, in ? NameError: name 'p' is not defined import re p = re.compile(\n*) p.sub(,

Re: a re problem

2005-05-20 Thread cheng
thx for help :) -- http://mail.python.org/mailman/listinfo/python-list

circular imports

2005-05-20 Thread qhfgva
I'm working with a large code base that I'm slowly trying to fix unpythonic features of. One feature I'm trying to fix is the use of: # how things are now sys.path.append('/general/path/aaa/bbb') # lots of lines like this to specific dirs import foo Insead I'd rather have PYTHONPATH already

How come print cannot be assigned to a variable?

2005-05-20 Thread [EMAIL PROTECTED]
Hi all, In Python, some functions can be assigned to variables like this: length=len Why is it that print cannot be assigned to a variable like this? (A syntax error is declared.) Thanks, Vaibhav -- http://mail.python.org/mailman/listinfo/python-list

Re: How come print cannot be assigned to a variable?

2005-05-20 Thread Adriano Ferreira
print is a statement, not a function. Read Guido's words on that: http://www.python.org/search/hypermail/python-1992/0112.html Regards. Adriano. -- http://mail.python.org/mailman/listinfo/python-list

dealing with MAC address

2005-05-20 Thread [EMAIL PROTECTED]
Hello, I am trying to fill a packet with source and destination mac address. The first 6 bytes hold the destination mac address and the next six bytes hold the source mac address. In the code i am filling in the first six bytes to broadcast address for the destination. # fill in the destination

Re: Convert from numbers to letters

2005-05-20 Thread Steven Bethard
Jason Drew wrote: ##def tuple2coord(tupl): [snip] ##rowfromzero, colfromzero = tupl Just a side note here that if you want a better function signature, you might consider writing this as: tuple2coord((rowfromzero, colfromzero)): ... Note that the docstrings are nicer this way: py

Re: ANN: new release of RUR-PLE available

2005-05-20 Thread André Roberge
Michael Hoffman wrote: André Roberge wrote: Version 0.8.6a is now available. You might see a bit more interest if you briefly explain what RUR-PLE is, and where to find it. Oops.. sorry about that. RUR - a Python Learning Environment. Its purpose is to provide an environment where

Re: Cascading menus with Tk

2005-05-20 Thread michelle
Martin Franklin wrote: michelle wrote: Hi all, I am new to Tk, or Python GUI programming and I seem to be stuck. I have looked about for help with Tk GUIs, but everything seems so terse or incomplete?? I have been mostly using the Introduction to Tkinter by Fredrik Lundh

Re: Twisted an several CPUs

2005-05-20 Thread Michael Sparks
Paul Rubin wrote: Jp Calderone [EMAIL PROTECTED] writes: Distributing load across multiple machines scales better than distributing it over multiple CPUs in a single machine. If you have serious scalability requirements, SMP is a minor step in the wrong direction (unless you're talking

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-20 Thread cal_2pac
Thanks for the response again. The solution is pretty close but not yet complete This is what I observed. a) I tried to use the delay mechanism as suggested below ie. ie.Navigate('www.google.com') while ie.ReadyState !- 4 time.sleep(0.5) d=win32com.client.DispatchWithEvents(ie.Document,

Re: PIL and line drawing

2005-05-20 Thread rzed
Fredrik Lundh [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: Leonard J. Reder wrote: I am using PIL to annotate some images with lines. I could not find anyway to make the line that is drawn from the ImageDraw object thicker. Does anyone have a suggestion or solution for solving

Re: python24.zip

2005-05-20 Thread Martin v. Löwis
Robin Becker wrote: Firstly should python start up with non-existent entries on the path? Yes, this is by design. Secondly is this entry be the default for some other kind of python installation? Yes. People can package everything they want in python24.zip (including site.py). This can only

Re: circular imports

2005-05-20 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: So I thought I'd just add the necessary __init__.py files and then things would just work. Unfortunately trying this exposed a large number of circular imports which now cause the files to fail to load. You didn't describe you you created the necessary __init__.py

Re: dealing with MAC address

2005-05-20 Thread Grant Edwards
On 2005-05-20, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How do i fill in a command line passed mac address for source mac address. The first six bytes of data[i] should contain destination mac and the next six bytes of data[i] should contain the source mac address. Use the struct module.

Re: How come print cannot be assigned to a variable?

2005-05-20 Thread [EMAIL PROTECTED]
Thank You Adriano. You were a huge help. Vaibhav -- http://mail.python.org/mailman/listinfo/python-list

embedded function body

2005-05-20 Thread Marco Colombo
Hi, I need to embed an user-supplied python function body in a C program. That is, the user has no control over the function definition: def afunction(): here goes user code Now, the problem is that I can't just append the supplied string, because I need to properly indent it which isn't

Re: Convert from numbers to letters

2005-05-20 Thread Jason Drew
Hey, that's good. Thanks Steve. Hadn't seen it before. One to use. Funny that Pythonwin's argument-prompter (or whatever that feature is called) doesn't seem to like it. E.g. if I have def f(tupl): print tupl Then at the Pythonwin prompt when I type f( I correctly get (tupl) in the argument

Re: circular imports

2005-05-20 Thread qhfgva
All of the __init__.py files are empty and I don't know of any overlapping of names. Like I said this is code that works fine, I'm just trying to clean up some things as I go. Here are my working examples: x1.py == # how things work in our code now: # called with home/dlee/test/module

Memory errors with large zip files

2005-05-20 Thread Lorn
Is there a limitation with python's zipfile utility that limits the size of a file that can be extracted? I'm currently trying to extract 125MB zip files with files that are uncompressed to 1GB and am receiving memory errors. Indeed my ram gets maxed during extraction and then the script quits.

Re: OO design question / Transform object in place?

2005-05-20 Thread Dave Benjamin
[EMAIL PROTECTED] wrote: Dave Benjamin wrote: I think it's much better for simplify() to return a new object and leave the original object unmodified. You can still write: expression2 = expression2.simplify() A belated thank-you message for your reply to my posting. I took your advice, and

Re: Convert from numbers to letters

2005-05-20 Thread Bill Mill
On 20 May 2005 10:07:55 -0700, Jason Drew [EMAIL PROTECTED] wrote: Hey, that's good. Thanks Steve. Hadn't seen it before. One to use. Funny that Pythonwin's argument-prompter (or whatever that feature is called) doesn't seem to like it. E.g. if I have def f(tupl): print tupl Then

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread elbertlev
Sure it does not. As well as C, unless you instaead of malloc use low level os-dependant APIs. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in Elementtree/Expat

2005-05-20 Thread uche . ogbuji
Most examples in the book do not include such a declaration and yet are properly rendered by Internet Explorer. Is it mandatory and why is it that Expat crashes on it? It's not mandatory but it's probably good practice to make the document self-contained. The xlink prefix is defined in the

Re: Comparing 2 similar strings?

2005-05-20 Thread Steve Holden
Dennis Lee Bieber wrote: On Wed, 18 May 2005 20:03:53 -0500, Ed Morton [EMAIL PROTECTED] declaimed the following in comp.lang.python: Fantastic test data set. I know how to pronounce McPherson but I'd never have guessed that Mousaferiadis sounds like it. I suppose non-Celts probably

Re: Comparing 2 similar strings?

2005-05-20 Thread Steve Holden
Chris Croughton wrote: On Thu, 19 May 2005 06:38:59 +1000, John Machin [EMAIL PROTECTED] wrote: On Wed, 18 May 2005 15:06:53 -0500, Ed Morton [EMAIL PROTECTED] wrote: William Park wrote: How do you compare 2 strings, and determine how much they are close to each other? Eg.

buffer_info error

2005-05-20 Thread [EMAIL PROTECTED]
Hello, buffer_info is giving the following error: AttributeError: 'str' object has not attribute 'buffer_info' Here's the code snippet... dest = '' src = '0123' data = array('B', '\0' * 256) data1 = ''.join([dest, src] print data1 0123 print

Re: circular imports

2005-05-20 Thread Peter Hansen
[EMAIL PROTECTED] wrote: I'm working with a large code base that I'm slowly trying to fix unpythonic features of. [...] Insead I'd rather have PYTHONPATH already include '/general/path/' and then just use: One option you might not have considered, which I find more pythonic than environment

appending key-value pairs to a dict

2005-05-20 Thread rbt
I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. Many thanks, rbt --

Difficulty installing PyXml.

2005-05-20 Thread Amitpython5
Hello, I have python installed under a different directory (/images/QA/QATools12/lib/python2.1), and I'm now trying to install PyXml. It gives me the following error: - python setup.py buildTraceback (most recent call last): File "setup.py", line 127, in ? config_h_vars =

Re: buffer_info error

2005-05-20 Thread Peter Hansen
[EMAIL PROTECTED] wrote: data = array('B', '\0' * 256) data1 = ''.join([dest, src] print data.buffer_info()[0]... works print data1.buffer_info()[0]error This output is a string and hence i believe i get the above error. Any ideas? Yes, you are entirely correct. (Integers don't

Re: appending key-value pairs to a dict

2005-05-20 Thread Peter Hansen
rbt wrote: I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. Whereas with a list you would call

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Paul Rubin
Dave Brueck [EMAIL PROTECTED] writes: One thing from your experience that did resonate with me is that, except for ftplib and occasionally urllib (for basic, one-shot GETs), we don't use any of the standard library's protocol modules - partly because we had to implement our own HTTP libraries

Re: appending key-value pairs to a dict

2005-05-20 Thread Brian Beck
rbt wrote: I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. Like so: d = {} for filename in

Re: Comparing 2 similar strings?

2005-05-20 Thread Skip Montanaro
Steve (is this the same as 'Conchobar'?) No, that's a trendy pub in Key West... wink Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Paul Rubin
Fredrik Lundh [EMAIL PROTECTED] writes: this has been reported before, and it won't get fixed (unless you're volunteering to add Python-compatible garbage collection to Tk, that is). Yeah, I think I understand what the issue is. I can think of some kludgy possible fixes but I assume they've

Re: appending key-value pairs to a dict

2005-05-20 Thread James Stroud
On Friday 20 May 2005 01:04 pm, rbt wrote: I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. Many

From the call hook, how do I know more precisely what is called?

2005-05-20 Thread Vijay Kumar
Hi, I wrote a trace function using the profiling and tracing hooks provided by the python interpreter. The Python interpreter reports the calls occuring in the source program to my trace function. How can I know whether the call happened is a function call or method call and if it is a method

Re: PyGame and Rotozoom (Sorry if OT)

2005-05-20 Thread Lee Harr
On 2005-05-20, J. W. McCall [EMAIL PROTECTED] wrote: I'm not sure if this is off-topic, since it doesn't deal with Python itself, but here goes: I'm messing around with writing a simple game where the player (a crudely drawn smiley face) moves by rotating and moving back or forward (think

Re: buffer_info error

2005-05-20 Thread Jp Calderone
On 20 May 2005 13:18:33 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: i am filling in a packet with source and destination address and using the buffer_info call to pass on the address to an underlying low level call. The src and dest are strings, but buffer_info expects an array. How do i

Re: appending key-value pairs to a dict

2005-05-20 Thread Roy Smith
rbt [EMAIL PROTECTED] wrote: I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. You just assign values

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Dave Brueck
Paul Rubin wrote: Dave Brueck [EMAIL PROTECTED] writes: One thing from your experience that did resonate with me is that, except for ftplib and occasionally urllib (for basic, one-shot GETs), we don't use any of the standard library's protocol modules - partly because we had to implement our

Re: Process monitoring

2005-05-20 Thread John Abel
gsteff wrote: Hey, I'm working on a Python program that will launch some other non-Python process using os.spawn (in the os.P_NOWAIT mode) and then basically wait for it to finish (while doing some other stuff in the interim). Normally, the new process will signal that it's done by writing to a

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread elbertlev
C programs also can be disassembled. Serious people do not consider braking the machine code harder byte-code. -- http://mail.python.org/mailman/listinfo/python-list

[ann] first release of PyPy

2005-05-20 Thread holger krekel
Welcome to PyPy 0.6 *The PyPy Development Team is happy to announce the first public release of PyPy after two years of spare-time and half a year of EU funded development. The 0.6 release is eminently a preview release.* What it is and where to start

Re: passing arguments

2005-05-20 Thread James Stroud
import sys try: arg1 = sys.argv[1] except IndexError: print This script takes an argument, you boob! sys.exit(1) OR, way better: See the optparse module. On Friday 20 May 2005 03:26 pm, Jeff Elkins wrote: I'm sure this is obvious, but how the heck do pass an argument(s) to a python

Re: first release of PyPy

2005-05-20 Thread Kay Schluehr
holger krekel wrote: Welcome to PyPy 0.6 *The PyPy Development Team is happy to announce the first public release of PyPy after two years of spare-time and half a year of EU funded development. The 0.6 release is eminently a preview release.* Congratulation to You

Re: performance of Nested for loops

2005-05-20 Thread Charles Krug
On 20 May 2005 15:35:10 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is there a better way to code nested for loops as far as performance is concerned. what better way can we write to improve the speed. for example: N=1 for i in range(N): for j in range(N): do_job1

Re: passing arguments

2005-05-20 Thread Jeff Elkins
On Friday 20 May 2005 06:46 pm, James Stroud wrote: import sys try: arg1 = sys.argv[1] except IndexError: print This script takes an argument, you boob! sys.exit(1) OR, way better: See the optparse module. On Friday 20 May 2005 03:26 pm, Jeff Elkins wrote: I'm sure this is

processing a large utf-8 file

2005-05-20 Thread Ivan Voras
Since the .encoding attribute of file objects are read-only, what is the proper way to process large utf-8 text files? I need bulk processing (i.e. in blocks - the file is ~ 1GB), but reading it in fixed blocks is bound to result in partially-read utf-8 characters at block boundaries. --

Re: processing a large utf-8 file

2005-05-20 Thread Martin v. Lwis
Ivan Voras wrote: Since the .encoding attribute of file objects are read-only, what is the proper way to process large utf-8 text files? You should use codecs.open, or codecs.getreader to get a StreamReader for UTF-8. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments

2005-05-20 Thread Daniel Bickett
An even better way would be to use the optparse module.-- Daniel Bickettdbickett at gmail.comhttp://heureusement.org/ -- http://mail.python.org/mailman/listinfo/python-list

Parsing bash_history and inputting into mysql (Intrusion Detection)

2005-05-20 Thread sreekanth . hari
I have a seemingly tough assignment for my Senior Project. I need to develop an Intrusion Detection System. My approach is to parse the bash_history file of each user into a mysql database, assign a threshold for commands or sequences of commands and then alert the admin of nethin fishy is found.

Re: performance of Nested for loops

2005-05-20 Thread Larry Bates
You can use xrange(N) that way Python doesn't have to build the 1 item lists 2 times. Other than that one would need to know why you would call do_job1 and do_job2 1 times each inside a 1 iteration loop. Most VERY large performance gains are due to better algorithms not code

Re: How to receive events (eg. user mouse clicks) from IE

2005-05-20 Thread J Correia
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks for the response again. The solution is pretty close but not yet complete This is what I observed. a) I tried to use the delay mechanism as suggested below ie. ie.Navigate('www.google.com') while ie.ReadyState !- 4

[ANN] pysqlite 2.0.2 released

2005-05-20 Thread Gerhard Haering
This is a minor bugfix release. Wiki, bugtracker, downloads at http://pysqlite.org/ If you missed 2.0.1, it fixed a bug that could happen if user-defined functions/aggregates were getting out of scope. It's a fatal bug that will crash your application if you encounter it. - Code changes to

Can you introduce some book about python?

2005-05-20 Thread fdsl ysnh
--- [EMAIL PROTECTED]: Send Python-list mailing list submissions to python-list@python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/python-list or, via email, send a message with subject or body 'help' to [EMAIL

Re: passing arguments

2005-05-20 Thread Steven Bethard
James Stroud wrote: import sys try: arg1 = sys.argv[1] except IndexError: print This script takes an argument, you boob! sys.exit(1) Also possible, to guarantee that exactly one argument was given: try: arg1, = sys.argv except ValueError: print This script takes an argument,

Re: Is Python suitable for a huge, enterprise size app?

2005-05-20 Thread Paul Rubin
Dave Brueck [EMAIL PROTECTED] writes: What do you use for HTTPS? m2crypto (plus some patches to make asynchronous SSL do what we needed). That seems to be a nice piece of code, but it's still at version 0.13; if something goes wrong, are you sure you want to explain that you were using

count files in a directory

2005-05-20 Thread rbt
I assume that there's a better way than this to count the files in a directory recursively. Is there??? def count_em(valid_path): x = 0 for root, dirs, files in os.walk(valid_path): for f in files: x = x+1 print There are, x, files in this directory.

Re: appending key-value pairs to a dict

2005-05-20 Thread rbt
Peter Hansen wrote: rbt wrote: I know how to setup an empty list and loop thru something... appending to the list on each loop... how does this work with dicts? I'm looping thru a list of files and I want to put the file's name and its sha hash into a dict on each loop. Whereas with

Re: how to config a comserver in a customize dll?

2005-05-20 Thread Roger Upole
If you have a custom COM dll, you should just register it as normal. I'm not sure why you would want to register it as a python COM server. Unless you've duplicated the whole framework that allows com servers to be written in python ? Roger ÒÊÃÉɽÈË [EMAIL PROTECTED] wrote in message

Re: count files in a directory

2005-05-20 Thread James Stroud
On Friday 20 May 2005 07:12 pm, rbt wrote: I assume that there's a better way than this to count the files in a directory recursively. Is there??? def count_em(valid_path): x = 0 for root, dirs, files in os.walk(valid_path): for f in files: x = x+1

Re: count files in a directory

2005-05-20 Thread James Stroud
Come to think of it file_count = len(os.walk(valid_path)[2]) -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Parsing bash_history and inputting into mysql (Intrusion Detection)

2005-05-20 Thread William Park
[EMAIL PROTECTED] wrote: I have a seemingly tough assignment for my Senior Project. I need to develop an Intrusion Detection System. My approach is to parse the bash_history file of each user into a mysql database, assign a threshold for commands or sequences of commands and then alert the

Re: first release of PyPy

2005-05-20 Thread Christian Tismer
[EMAIL PROTECTED] wrote: Kay Schluehr wrote: holger krekel wrote: Welcome to PyPy 0.6 *The PyPy Development Team is happy to announce the first public release of PyPy after two years of spare-time and half a year of EU funded development. The 0.6 release is eminently a

Re: count files in a directory

2005-05-20 Thread James Stroud
Sorry, I've never used os.walk and didn't realize that it is a generator. This will work for your purposes (and seems pretty fast compared to the alternative): file_count = len(os.walk(valid_path).next()[2]) The alternative is: import os import os.path file_count = len([f for f in

  1   2   >