RELEASE: twill-0.8.2

2006-02-07 Thread titus
ANNOUNCING twill v0.8.2. twill is a simple language for browsing the Web. It's designed for automated testing of Web sites, but it can be used to interact with Web sites in a variety of ways. In particular, twill supports form submission, cookies, redirects, and HTTP authentication. A twill

[ANN] Pydev 1.0.1 release

2006-02-07 Thread Fabio Zadrozny
Hi All, Pydev Extensions version 1.0.1 has been released More details at http://www.fabioz.com/pydev Pydev - Python IDE (Python Development Enviroment for Eclipse) version 1.0.1 has been released. More details at http://pydev.sf.net Details for Release: 1.0 .1: This was a 'single bug'

Re: Question about idioms for clearing a list

2006-02-07 Thread Raymond Hettinger
[Steven D'Aprano] The Zen isn't only one way to do it. If it were, we wouldn't need iterators, list comps or for loops, because they can all be handled with a while loop (at various costs of efficiency, clarity or obviousness). del L[:] works, but unless you are Dutch, it fails the

how to copy a Python object

2006-02-07 Thread mitsura
Hi, I am new to Python and OO programming. I need to copy a Python object (of a class I made myself). new_obj = old_object doesn't seem to work since apparently new_obj is then a referrence to old_obj. I found out that there is a module called 'copy' that allows you to do a shallow or a deep

Re: Compiling

2006-02-07 Thread Ravi Teja
Martin v. Löwis wrote: Ravi Teja wrote: But more often I am looking to use Python libraries in other languages since I am more familiar with them and they typically tend to be more high level (the way I like it) than the standard libraries of others. Ah. In that case, the normal C API

Re: Question about idioms for clearing a list

2006-02-07 Thread Raymond Hettinger
[EMAIL PROTECTED] In my programs I have seen that there is another practical difference between version 1 and 3: (1) mylist[:] = [] (3) mylist = [] If you create a big mylist again and again many times, the version 1 uses the memory more efficiently (probably less work for the garbage

Re: Best way of finding terminal width/height?

2006-02-07 Thread Joel Hedlund
You might want to try just setting a flag in the signal handler to see if that prevents the I/O operations on stdin/stdout from being interrupted. Tried this: source import signal, os, sys from terminal_info import get_terminal_size terminal_size = get_terminal_size() _bTerminalSizeChanged

Re: Detecting line endings

2006-02-07 Thread Sybren Stuvel
Fuzzyman enlightened us with: This is what I came up with. [...] Comments/corrections welcomed. You could use a little more comments in the code, but apart from that it looks nice. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity,

Re: UTF16, BOM, and Windows Line endings

2006-02-07 Thread Fuzzyman
Neil Hodgson wrote: Fuzzyman: Thanks - so I need to decode to unicode and *then* split on line endings. Problem is, that means I can't use Python to handle line endings where I don't know the encoding in advance. In another thread I've posted a small function that *guesses* line

Re: Detecting line endings

2006-02-07 Thread Fuzzyman
Alex Martelli wrote: Fuzzyman [EMAIL PROTECTED] wrote: Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using Open the file with 'rU' mode, and check the file object's newline attribute. Ha, so

Re: Detecting line endings

2006-02-07 Thread Fuzzyman
Alex Martelli wrote: Fuzzyman [EMAIL PROTECTED] wrote: Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using Open the file with 'rU' mode, and check the file object's newline attribute. Do you

Re: HTMLDocument and Xpath

2006-02-07 Thread swilson
Got the answer - there's a bug in xpath. I think the HTML parser converts all the tags (but not the attributes) to uppercase. Xpath definitely does not like my first string but, these work fine: test = Evaluate('//TD', doc_node.documentElement) test = Evaluate('/HTML/BODY/TABLE/TR/TD',

[ANN] Pydev 1.0.1 release

2006-02-07 Thread Fabio Zadrozny
Hi All, Pydev Extensions version 1.0.1 has been released More details at http://www.fabioz.com/pydev Pydev - Python IDE (Python Development Enviroment for Eclipse) version 1.0.1 has been released. More details at http://pydev.sf.net Details for Release: 1.0 .1: This was a 'single bug'

Re: python

2006-02-07 Thread Simon Brunning
On 2/6/06, Brain Murphy [EMAIL PROTECTED] wrote: I am new to python and programming but i was wondering, what can i program with python?? Brian Uh, that's a hard one to answer. You can program just about anything in Python except device drivers and operating systems - and I'm prepaired tlo be

Great Job Board

2006-02-07 Thread ema32
--_NextPart_9763-0843-0CE6F984-7AA4 Content-Type: text/plain Content-Transfer-Encoding: 7bit There is a great job board located at the employment section of http://www.4charlesson.com . So pass it on to anyone looking for a job. --_NextPart_9763-0843-0CE6F984-7AA4-- --

Re: winguiauto

2006-02-07 Thread Simon Brunning
On 30 Jan 2006 11:05:58 -0800, puff [EMAIL PROTECTED] wrote: There seem to be a number of winguiauto(s) available on the net. Is there any 'offical' version? Official? Hmm, dunno. ;-) The version from my site is a bit old. I've escaped Windows now, so I'm not doing any work on Windows

45 [XPost] Libero ADSL: Statene alla Larga!!! 454226

2006-02-07 Thread Belgian
Wind, Infostrada e Libero vi stanno fregando! Si lamentano una serie di disservizi con eMule tra cui il blocco della navigazione internet qualora eMule sia funzionante, l'impossibilità di far funzionare Kademlia, distacchi continui dai server ed2k, velocità ridicole della linea stessa qualora

Re: Question about idioms for clearing a list

2006-02-07 Thread Ben Sizer
Raymond Hettinger wrote: [Steven D'Aprano] The Zen isn't only one way to do it. If it were, we wouldn't need iterators, list comps or for loops, because they can all be handled with a while loop (at various costs of efficiency, clarity or obviousness). del L[:] works, but unless

Re: fairly large webapp: from Java to Python. experiences?

2006-02-07 Thread bruno at modulix
[EMAIL PROTECTED] wrote: (snip) Does anyone here have any experience with large(ish) webapps in Python? Depends on the definition of large(ish). If you use KLOC as a metric, you can expect a Python solution to be 5 to 10 time smaller, so what's a 'large' app in Java may end up as a

Re: Accessing Windows Serial Port

2006-02-07 Thread malv
Hi All, Would anybody know whether PySerial would work over an usb/serial adapter? (what about usb/parallel adapters?) Thx. malv -- http://mail.python.org/mailman/listinfo/python-list

Re: how to copy a Python object

2006-02-07 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] a écrit : Hi, I am new to Python and OO programming. I need to copy a Python object (of a class I made myself). new_obj = old_object doesn't seem to work since apparently new_obj is then a referrence to old_obj. it is I found out that there is a module called 'copy'

Re: how to copy a Python object

2006-02-07 Thread mitsura
Already thanks for the reply, but how to write your own copy operator? Won't you always be passing referrences to new_obj? -- http://mail.python.org/mailman/listinfo/python-list

Re: python

2006-02-07 Thread Salvatore
A new OS in Python : http://unununium.org/introduction :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Code Feedback

2006-02-07 Thread mwt
Jorgen Grahn wrote: You might want to look into using doc strings properly. You have comments at the start of functions, but they read more like implementation notes than what this method does and why. But I only had a quick look. Yeah. They were just my scaffolding notes to myself. I'd

ftp: get list of files

2006-02-07 Thread eels
Hello, I want to get a listing of my files at web server with ftp. I wantn 't download the files. With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I need this information at variable yyy. How can I resolve this problem? Thank's for your hints, Thomas --

Re: get list of files

2006-02-07 Thread Fredrik Lundh
eels wrote: I want to get a listing of my files at web server with ftp. I wantn 't download the files. With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I need this information at variable yyy. How can I resolve this problem? as mentioned in the documentation, you need to

Re: ftp: get list of files

2006-02-07 Thread Lawrence Oluyede
eels [EMAIL PROTECTED] writes: With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I need this information at variable yyy. How can I resolve this problem? As written in the doc retrlines has an optional parameter (a callback function) called on each line retrieved, so you can

Re: RPy / R

2006-02-07 Thread Hans Georg Krauthaeuser
jason schrieb: Hello: I installed the following: python-2.4.2.msi pywin32-207.win32-py2.4.exe R-2.2.1-win32.exe rpy-0.4.6-R-2.0.0-to-2.2.1-py24.win32.exe on a Windows XP (SP2) box. When I try to run the following (source: http://rpy.sourceforge.net/plotting-with-RPy.html) in IDLE

Re: get list of files

2006-02-07 Thread eels
Hello Fredrik, thank's for your quick help. Greetings Eels Fredrik Lundh schrieb: eels wrote: I want to get a listing of my files at web server with ftp. I wantn 't download the files. With yyy = ftp.retrlines('LIST') I get this listing at stdout, but I need this information at

Re: how to copy a Python object

2006-02-07 Thread Schüle Daniel
[EMAIL PROTECTED] wrote: Already thanks for the reply, but how to write your own copy operator? Won't you always be passing referrences to new_obj? for example this would work class X(object): ... def __init__(self,lst): ... self.lst = lst ... def copy(self): ...

Re: python

2006-02-07 Thread Steve Holden
Salvatore wrote: A new OS in Python : http://unununium.org/introduction :-) That page includes: Is the project dead? Maybe. Very little code was written in 2005. 2006 so far does not look better. What code has been written isn't very useful. ... regards Steve -- Steve Holden

Re: Detecting line endings

2006-02-07 Thread Arthur
Alex Martelli wrote: Fuzzyman [EMAIL PROTECTED] wrote: Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using Open the file with 'rU' mode, and check the file object's newline attribute. Do you

Re: Detecting line endings

2006-02-07 Thread Arthur
Arthur wrote: Alex Martelli wrote: I just got flummoxed by this issue, working with a (pre-alpha) package by very experienced Python programmers who sent file.readline to tokenizer.py without universal newline support. Went on a long (and educational) journey trying to figure out why my

Re: Unable to get PIL to load jpeg images

2006-02-07 Thread peter . mosley
Someone out there must surely know - please! Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-07 Thread Steve Holden
Raymond Hettinger wrote: [Steven D'Aprano] [...] While the sentiment behind the list.clear() suggestion is noble, it is an exercise in futility to design a language around the presumption that other programmers are incapable of learning the basics of the language. +1 QOTW There was a

Re: Accessing Windows Serial Port

2006-02-07 Thread Roel Schroeven
malv schreef: Hi All, Would anybody know whether PySerial would work over an usb/serial adapter? If the driver for the adapter creates a virtual COM-port (i.e. it shows up as a serial port in Windows' device manager), it works. The software sees no difference between a real port and a fake

Natural Language Date Processing.

2006-02-07 Thread Andrew Gwozdziewycz
I've been looking recently for date processing modules that can parse dates in forms such as next week or 6 days from next sunday. PHP has a function that will do this called 'strtotime', but I have not found a Python implementation. I've check the standard date, datetime and time modules

Re: Unable to get PIL to load jpeg images

2006-02-07 Thread Steve Holden
[EMAIL PROTECTED] wrote: Someone out there must surely know - please! Peter Try image-sig@python.org - or better still, subscribe to the image SIG mailing list (then you'll see replies ...) I've never had any problems loading JPEG images. It's probably a setup issue. regards Steve --

Tkinter: is there a has_focus method or property for a window?

2006-02-07 Thread Harlin Seritt
I have two windows. One is a main config window. The other is an 'Add Setting' window. Both are using two different classes. Once the Add Setting button is clicked on the Add Setting window, the setting is written to file. At that time the main config window should update its setting listing but

Re: Strange behavior with os call in cgi script

2006-02-07 Thread Jim
But I do think that adding logging to a cgi script is a sensible thing to do for a beginner. Let me second that. I happen to write a lot of CGI, and ISTM that while you can do it without logging, you are condemming yourself to a lot of staring at the screen, head-scratching, and saying ``Now

Re: how to copy a Python object

2006-02-07 Thread Juho Schultz
[EMAIL PROTECTED] wrote: Already thanks for the reply, but how to write your own copy operator? Won't you always be passing referrences to new_obj? If you need to modify the behaviour of copy or deepcopy, you can give your class __copy__ and __deepcopy__ methods. Then copy.copy and

Re: Code Feedback

2006-02-07 Thread Sion Arrowsmith
mwt [EMAIL PROTECTED] wrote: 1) Is this good Python code? What should be changed to make it more Pythonesque? while not len(self.stacks) 0: while not self.stacks: An empty list is considered to be false, hence testing the list itself is the same as testing len(l) 0 . -- \S

Re: Question about idioms for clearing a list

2006-02-07 Thread Arthur
Raymond Hettinger wrote: There was a pithy Tim Peters quotation to the effect that he was unpersuaded by language proposals predicated on some hypothetical average programmer not being smart enough to understand something that the rest of us find to be basic. Peters pithy ;) As someone

Using RAW_SOCKETS on win XP SP2

2006-02-07 Thread billie
Hi all. I'd need to send a TCP SYN packet having a certain string as payload. I'm using Python and an high level packet building library called Impacket to build TCP and IP datagrams. I wrote this simple code that works on Linux but not on Windows XP SP2, probably because of SP2 security

Re: in over my head ascii

2006-02-07 Thread nephish
i'm not sure, but its kinda been a pain in the hinder for a newbie like me to find it in their docs. thanks for all the help guys, let you know how it goes -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with odbc (pywin32) and unicode

2006-02-07 Thread Frank Millman
Frank Millman wrote: Hi all I am using odbc from pywin32 to connect to MS SQL Server. I am changing my program from the old (incorrect) style of embedding values in the SQL command to the new (correct) style of passing the values as parameters. I have hit a problem. The following all work

Re: How to I write DBASE files without ODBC

2006-02-07 Thread Larry Bates
Durumdara wrote: Hi ! I have a text processor code and I want to put the results to standard files. HTML, XML, SQLite - they are ok. But I want to put these datas to DBF too, because when records are many, does not fit in Excel table (load from HTML). XML and SQLite need some

Pythonwin - problem with non English character

2006-02-07 Thread Lad
Hello, is there a way how to use PythonWin for editting of Python files that consist non English characters? In my Python scripts I need to use( print) Cyrilic characters and with PythonWin it is not possible . I use PythonWin 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on

Re: Question about idioms for clearing a list

2006-02-07 Thread Ed Singleton
On 7 Feb 2006 00:27:05 -0800, Raymond Hettinger [EMAIL PROTECTED] wrote: There was a pithy Tim Peters quotation to the effect that he was unpersuaded by language proposals predicated on some hypothetical average programmer not being smart enough to understand something that the rest of us

Re: Question about idioms for clearing a list

2006-02-07 Thread Fredrik Lundh
Steve Holden wrote: While the sentiment behind the list.clear() suggestion is noble, it is an exercise in futility to design a language around the presumption that other programmers are incapable of learning the basics of the language. +1 QOTW There was a pithy Tim Peters quotation to the

Re: Question about idioms for clearing a list

2006-02-07 Thread Ed Singleton
On 7 Feb 2006 02:02:42 -0800, Ben Sizer [EMAIL PROTECTED] wrote: Fred is exactly correct. Slicing is absolutely basic to Python. Accordingly, it gets covered right at the beginning of the tutorial (section 3.1). Yes, right after UTF encoding details, complex numbers, and various mentions

Re: how to kill a python process?

2006-02-07 Thread MackS
Hi Jorgen THanks for your help. I began writing a wrapper around python did (as Donn suggested), but then noticed that this was due to not having educated myself on the options you can pass to ps, pidof and top: running pidof -x and using the 'c' command in top work pretty nicely. That way I no

Re: Question about idioms for clearing a list

2006-02-07 Thread André
Ed Singleton wrote: I'm a fairly average programmer (better than average compared to my immediate colleagues). I've read every tutorial I can get my hands on, but I have no _memory_ of ever coming across the del keyword, let alone that it is fundamental to Python, and I have no idea what

Re: Accessing Windows Serial Port

2006-02-07 Thread Grant Edwards
On 2006-02-07, malv [EMAIL PROTECTED] wrote: Hi All, Would anybody know whether PySerial would work over an usb/serial adapter? Yes. (what about usb/parallel adapters?) Don't know. -- Grant Edwards grante Yow! I'm an East Side

Re: variables preceeded with @

2006-02-07 Thread Diez B. Roggisch
Thomas Girod wrote: Hello there. I recently started looking at turbogears and I found code such as : class Root(controllers.Root): @turbogears.expose(html=blog.templates.accueil) def index(self,**kw): return dict() What is this @ ? I looked around but couldn't

Re: Question about idioms for clearing a list

2006-02-07 Thread Arthur
Arthur wrote: My ability to grok Python to any extent, from that starting point, was based on an understanding that it was my responsibility to come to Python, not it to me. And concerted, almost obsessive effort, And time. OTOH - because of exactly these factors - I have actively

Re: * 'struct-like' list *

2006-02-07 Thread Ernesto
Thanks for the approach. I decided to use regular expressions. I'm going by the code you posted (below). I replaced the line re.findall line with my file handle read( ) like this: print re.findall(pattern, myFileHandle.read()) This prints out only brackets []. Is a 're.compile' perhaps

Re: Natural Language Date Processing.

2006-02-07 Thread Andrew Gwozdziewycz
On 7 Feb 2006 05:51:40 -0800, [EMAIL PROTECTED] It seems that the string to be parsed has to be provided in the GNU date format. One option would be to provide a function that calls out to the the GNU date program with whatever string you want to parse. Actually, I looked at the source of the

Re: Numeric and matlab

2006-02-07 Thread malv
A convincing experience is to 'translate' some substantial matlab matrix code into python. You will at once see the difference between a true programming language and matlab Further, also look at matplotlib. malv -- http://mail.python.org/mailman/listinfo/python-list

Re: * 'struct-like' list *

2006-02-07 Thread Schüle Daniel
Ernesto wrote: Thanks for the approach. I decided to use regular expressions. I'm going by the code you posted (below). I replaced the line re.findall line with my file handle read( ) like this: print re.findall(pattern, myFileHandle.read()) This prints out only brackets []. Is a

Re: Question about idioms for clearing a list

2006-02-07 Thread Raymond Hettinger
I'm a fairly average programmer (better than average compared to my immediate colleagues). I've read every tutorial I can get my hands on, but I have no _memory_ of ever coming across the del keyword, let alone that it is fundamental to Python, My thought is that get/set/del are fundamental

Regular Expression Syntax Help

2006-02-07 Thread Ernesto
I'm trying to get the right syntax for my regular expression. The string I'm trying to parse is: # myString [USELESS DATA] Name: David Dude [USELESS DATA] Right now, I'm using the following code: pattern_Name= '''(?x) Title:\s+(\w+)\s+ ''' names = re.findall(pattern_Name, myString) print

Re: winguiauto

2006-02-07 Thread puff
Thanks Simon. I looked at the other two and ended up using your version unmodified as the changes in watsup and pywinauto dealt with things unique to their needs. Your code still addresses basic needs and rather well at that. Regards -- http://mail.python.org/mailman/listinfo/python-list

Re: variables preceeded with @

2006-02-07 Thread Thomas Girod
Yum, food for thoughts. Thanks Diez. -- http://mail.python.org/mailman/listinfo/python-list

Uses of The 4th Dimension (New Discovery by The Human Race!)

2006-02-07 Thread use4d
Uses of The 4th Dimension (New Discovery by The Human Race!) - Note Before: Everything you read on this page is The Truth. What does this mean? It means, if you try to do what is written here: EXAMPLE: If you

Re: * 'struct-like' list *

2006-02-07 Thread Ernesto
Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression Syntax Help

2006-02-07 Thread Ernesto
The word Title there should be Name. What I really need is the pattern for getting the entire string after Name: until a '\n' is found. -- http://mail.python.org/mailman/listinfo/python-list

Re: in over my head ascii

2006-02-07 Thread nephish
ok, i am stuck again. from the docs, the byte stream is supposed to look like this: 'S' 'T' 'X' [length indicator] [message type] [message] 'E' 'N' 'X' the length indicator it says is a four byte integer number of a value N ( N would be how long the message body is ) the message type comes

Re: Detecting line endings

2006-02-07 Thread Bengt Richter
On 6 Feb 2006 06:35:14 -0800, Fuzzyman [EMAIL PROTECTED] wrote: Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using multi-byte encodings) - which is why I'm not letting Python handle the line endings. Is

Re: Collecting snmp data - threads, processes, twisted?

2006-02-07 Thread Mike C. Fletcher
Antal Rutz wrote: ... I'd like to collect snmp data from varoius network devices parallel. ... Could you give me some advice how can I make my script really parallel? My options maybe: 1. pySNMP (as it's full in python) 2. subprocess (I'd like to make (find) a solution as threadpool.py)

The problem of anonymity with decorators

2006-02-07 Thread Franck Pommereau
Dear all, I would like to work around the anonymizing effect of decorators when an exception is raised in the wrapped function. Let's consider the following example: def int_result (fun) : def wrapped (*largs, **kwargs) : result = fun(*largs, **kwargs) if not

Re: Detecting line endings

2006-02-07 Thread Alex Martelli
Fuzzyman [EMAIL PROTECTED] wrote: ... Open the file with 'rU' mode, and check the file object's newline attribute. Do you know if this works for multi-byte encodings ? Do files have You mean when you open them with the codecs module? metadata associated with them showing the

Re: Natural Language Date Processing.

2006-02-07 Thread andychambers2002
From the docs for PHP's 'strtotime' Parameters time The string to parse, according to the GNU Date Input Formats syntax. Before PHP 5.0, microseconds weren't allowed in the time, since PHP 5.0 they are allowed but ignored. ... It seems that the string to be parsed has to be provided in the GNU

Re: jython problem importing a py file

2006-02-07 Thread Khalid Zuberi
didier.prophete writes: I tried everything I could think of (playing with the __init__.py, the PYTHONCLASS, the CLASSPATH), but nothing seems to work... I am doing something wrong here ? -Didier Take a look at the jython registry setting python.path:

Re: Detecting line endings

2006-02-07 Thread Fuzzyman
Bengt Richter wrote: On 6 Feb 2006 06:35:14 -0800, Fuzzyman [EMAIL PROTECTED] wrote: Hello all, I'm trying to detect line endings used in text files. I *might* be decoding the files into unicode first (which may be encoded using multi-byte encodings) - which is why I'm not letting Python

Re: Regular Expression Syntax Help

2006-02-07 Thread Raja Raman Sundararajan
try this. maybe this is what you want? reg = re.compile('Name:.*\\n', re.IGNORECASE) -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of finding terminal width/height?

2006-02-07 Thread Grant Edwards
On 2006-02-07, Joel Hedlund [EMAIL PROTECTED] wrote: As before, the only IO case above that doesn't throw exceptions is the uncommented one. Yup, that's the exception. Standard practice is to catch it and retry the I/O operation. Hmm... I guess it's not that easy to retry IO operations

Re: Literal Escaped Octets

2006-02-07 Thread Bengt Richter
On Mon, 06 Feb 2006 04:40:31 GMT, Chason Hayes [EMAIL PROTECTED] wrote: I am trying to convert raw binary data to data with escaped octets in order to store it in a bytea field on postgresql server. I could do this easily in c/c++ but I need to do it in python. I am not sure how to read and

Re: Natural Language Date Processing.

2006-02-07 Thread Steven Bethard
Andrew Gwozdziewycz wrote: I've been looking recently for date processing modules that can parse dates in forms such as next week or 6 days from next sunday. This is, in fact, a fairly difficult problem in general. See the TERN_ competition that's currently held yearly on this task. There

Re: The problem of anonymity with decorators

2006-02-07 Thread Alex Martelli
Franck Pommereau [EMAIL PROTECTED] wrote: ... import new def rename (fun, name) : return new.function(fun.func_code, {}, name) You need to make a new code object too: def int_result(fun) : def wrapped(*largs, **kwargs) : result = fun(*largs, **kwargs) if

Dual Core outlook

2006-02-07 Thread malv
Multiprocessing has been pushed into the field as the chip manufacturers can no longer deliver as they were used to for many years. The general public has been conditioned to believe that 1 + 1 = 2 but this is in fact not that simple. Although software manufacturers can with some effort adapt

Re: Question about idioms for clearing a list

2006-02-07 Thread Steven Bethard
Ben Sizer wrote: Likewise, the del keyword is fundamental -- if you can't get, set, and del, then you need to go back to collections school. I have hardly used the del keyword in several years of coding in Python. Why should it magically spring to mind in this occasion? Similarly I hardly

Is Python good for web crawlers?

2006-02-07 Thread Tempo
I was wondering if python is a good language to build a web crawler with? For example, to construct a program that will routinely search x amount of sites to check the availability of a product. Or to search for news articles containing the word 'XYZ'. These are just random ideas to try to explain

problem with opening Python IDLE

2006-02-07 Thread Bennie Tilma
I'm having trouble with opening the python IDLE-program. When I try to start it, it gives an errormessage wich states that it can not make a connection, possibly because of a firewall. However, adding it to firewalls exeptions or even disabeling the firewall has no effect. These are the

Re: Is Python good for web crawlers?

2006-02-07 Thread Andrew Gwozdziewycz
On 7 Feb 2006 08:33:28 -0800, Tempo [EMAIL PROTECTED] wrote: I was wondering if python is a good language to build a web crawler with? For example, to construct a program that will routinely search x amount of sites to check the availability of a product. Or to search for news articles

Too Many if Statements?

2006-02-07 Thread slogging_away
Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32, and have a script that makes numerous checks on text files, (configuration files), so discrepancies can be reported. The script works fine but it appears that I may have hit a wall with 'if'

Re: The problem of anonymity with decorators

2006-02-07 Thread Michele Simionato
Using my decorator module (http://www.phyast.pitt.edu/~micheles/python/documentation.html, http://www.phyast.pitt.edu/~micheles/python/decorator.zip) you solve the problem of the name, but the traceback is still not perfect. You get: # dec_traceback.py from ms.decorator import decorator

sys.path and unicode folder names

2006-02-07 Thread Nir Aides
Hello, Is there a solution or a work around for the sys.path problem with unicode folder names on Windows XP? I need to be able to import modules from a folder with a non-ascii name. Thanks, Nir -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting line endings

2006-02-07 Thread Fuzzyman
Alex Martelli wrote: Fuzzyman [EMAIL PROTECTED] wrote: ... Open the file with 'rU' mode, and check the file object's newline attribute. Do you know if this works for multi-byte encodings ? Do files have You mean when you open them with the codecs module? No, if I open a UTF16

python-ldap

2006-02-07 Thread [EMAIL PROTECTED]
y0! where can i get module of python-ldap to work with eclipse ide on windows? tks! -- http://mail.python.org/mailman/listinfo/python-list

python-ldap

2006-02-07 Thread [EMAIL PROTECTED]
y0! where can i get module of python-ldap to work with eclipse ide on windows? tks! -- http://mail.python.org/mailman/listinfo/python-list

python-ldap

2006-02-07 Thread [EMAIL PROTECTED]
y0! where can i get module of python-ldap to work with eclipse ide on windows? tks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Natural Language Date Processing.

2006-02-07 Thread Michael Amrhein
Andrew Gwozdziewycz schrieb: I've been looking recently for date processing modules that can parse dates in forms such as next week or 6 days from next sunday. PHP has a function that will do this called 'strtotime', but I have not found a Python implementation. I've check the standard

Re: Dual Core outlook

2006-02-07 Thread Xavier Morel
malv wrote: Of course, multiprocessing has been used for many years but this always involved a much higher level of sophistication on the part of the designers. This point seems to be largely hidden from the public, ignorant and semi-ignorant, by the chip manufacturers. Will new languages see

Is the Python types module superfluous?

2006-02-07 Thread Colin J. Williams
Travis Oliphant wrote: Gerard Vermeulen wrote: On Wed, 01 Feb 2006 11:15:09 -0500 Colin J. Williams [EMAIL PROTECTED] wrote: [ currently numpy uses ndarray, with synonym ArrayType, for a multidimensional array ] [Dbg] import types [Dbg] dir(types) ['BooleanType', 'BufferType',

Re: Too Many if Statements?

2006-02-07 Thread bruno at modulix
slogging_away wrote: Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32, and have a script that makes numerous checks on text files, (configuration files), so discrepancies can be reported. The script works fine but it appears that I may have hit a

Re: Too Many if Statements?

2006-02-07 Thread snoe
slogging_away wrote: Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32, and have a script that makes numerous checks on text files, (configuration files), so discrepancies can be reported. The script works fine but it appears that I may have hit a

Re: Too Many if Statements?

2006-02-07 Thread slogging_away
I don't consider myself to be a seasoned programmer so if you mean redesigning the script to make the checks and therefore reduce the number of 'if' statements, I'm not sure if that can be done. The script needs to make numerous checks for the existence of particular strings within the

Re: Is Python good for web crawlers?

2006-02-07 Thread Tempo
Why do you say that the bottleneck of the crawler will always be downloading the page? Is it becasue there isn't already a modual to do this and I will have to start from scratch? Or a bandwidth issue? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way of finding terminal width/height?

2006-02-07 Thread Joel Hedlund
You just call the failed read() or write() again. Unless there's some way that the read/write partially succeeded and you don't have any way to know how many bytes were read/written, If that's the case then Python's file object read and write would appear to be broken by design. Wow... I

  1   2   3   >