Iowa Python User's Group Meeting (November 3rd)

2008-10-27 Thread Mike Driscoll
Hi, The next Iowa Python Users Group (AKA Pyowa) is nearly upon us. We will be meeting November 3rd, from 7-9 p.m. at the following location: Marshall County Sheriff's Office 2369 Jessup Ave Marshalltown, IA 50158 At this meeting, we will be having a Crash Course of sorts for all the new

ANN: RPyC 3.00 RC2

2008-10-27 Thread sebulba
Release candidate 2 of RPyC 3.00 has been released! RPyC (Remote Python Call) is a python library for *transparent* and symmetric RPC and distributed computing. website:http://rpyc.wikispaces.com download: http://sourceforge.net/project/showfiles.php?group_id=155578package_id=173301 here's a

OSDC 2008 Earlybird registration closing this Friday

2008-10-27 Thread Mark Rees
Hi fellow python devotee's, Book by THIS FRIDAY to take advantage of earlybird pricing and be part of the best open source developers conference of the year. http://www.osdc.com.au/2008/registration/index.html?ebc=1 The facts: 31st OctoberEarlybird registration closing 2nd December

Re: [Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-27 Thread Gabriel Genellina
En Sun, 26 Oct 2008 12:13:08 -0200, Christian Heimes [EMAIL PROTECTED] escribió: ?? wrote: Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) You have to do each future import in a separate line: from

Re: Immutable object thread-safety

2008-10-27 Thread Gabriel Genellina
En Sun, 26 Oct 2008 23:25:09 -0200, Alcari The Mad [EMAIL PROTECTED] escribió: I am confused about which data structure to rely on thread-safety, or operator in Python? All of the builtin functions(which are implemented in C, like len()) are atomic(but assigning their output to a value may

Re: Improving interpreter startup speed

2008-10-27 Thread David Cournapeau
On Mon, Oct 27, 2008 at 2:36 PM, Terry Reedy [EMAIL PROTECTED] wrote: It this a theoretical problem or an actual one, that we might have other suggestions for? Any command line based on python is a real example of that problem. There are plenty of them. David --

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 3:36 PM, Terry Reedy [EMAIL PROTECTED] wrote: It this a theoretical problem or an actual one, that we might have other suggestions for? Heaven knows! I hardly think invoking hundreds and possibly thousands of short-lived python interpreters to be an optimal solution that

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:28 PM, David Cournapeau [EMAIL PROTECTED] wrote: Any command line based on python is a real example of that problem. There are plenty of them. Yes, but in most cases you are not invoking your command-line app x times per y units of time. --JamesMills -- -- --

Re: Improving interpreter startup speed

2008-10-27 Thread Paul Rubin
James Mills [EMAIL PROTECTED] writes: Heaven knows! I hardly think invoking hundreds and possibly thousands of short-lived python interpreters to be an optimal solution that may have spawned this particular thread. It's not optimal but it is very common (CGI for example). --

Re: Improving interpreter startup speed

2008-10-27 Thread David Cournapeau
On Mon, Oct 27, 2008 at 4:33 PM, James Mills [EMAIL PROTECTED] wrote: Yes, but in most cases you are not invoking your command-line app x times per y units of time. Depends on the tool: build tool and source control tools are example it matters (specially when you start interfaciing them with

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:36 PM, Paul Rubin http://phr.cx@nospam.invalid wrote: It's not optimal but it is very common (CGI for example). Which is why we (The Python Community) created WSGI and mod_wsgi. Cmon guys these problems are a bit old and out dated :) --JamesMills -- -- -- Problems

Re: Improving interpreter startup speed

2008-10-27 Thread Gabriel Genellina
En Sun, 26 Oct 2008 23:52:32 -0200, James Mills [EMAIL PROTECTED] escribió: On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan [EMAIL PROTECTED] wrote: You must be in a real big hurry if half a second matters that much to you. Maybe if it took 5 seconds for the interpreter to start up, I

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:40 PM, David Cournapeau [EMAIL PROTECTED] wrote: Depends on the tool: build tool and source control tools are example it matters (specially when you start interfaciing them with IDE or editors). Having fast command line tools is an important feature of UNIX, and if

Re: @property decorator doesn't raise exceptions

2008-10-27 Thread Peter Otten
Rafe wrote: Can anyone explain why this is happening? When an attribute error is raised that is an indication that the requested attribute doesn't exist, and __getattr__() must be called as a fallback. I can hack a work-around, but even then I could use some tips on how to raise the 'real'

Re: Improving interpreter startup speed

2008-10-27 Thread James Mills
On Mon, Oct 27, 2008 at 5:46 PM, Gabriel Genellina [EMAIL PROTECTED] wrote: +1 This thread is stupid and pointless. Even for a so-called cold startup 0.5s is fast enough! I don't see the need to be rude. And I DO care for Python startup time and memory footprint, and others do too. Even if

Re: Python 2.5.chm problem

2008-10-27 Thread [EMAIL PROTECTED]
This solve the problem: http://techrepublic.com.com/5208-11183-0.html?forumID=89threadID=191474 regsvr32 %systemroot%\system32\hhctrl.ocx press enter regsvr32 %systemroot%\system32\itss.dll press enter [EMAIL PROTECTED]: Hi! When I try to open the 2.5 Python help, I got error message: A

Re: 2.6, 3.0, and truly independent intepreters

2008-10-27 Thread Martin v. Löwis
Andy O'Meara wrote: On Oct 24, 9:52 pm, Martin v. Löwis [EMAIL PROTECTED] wrote: A c-level module, on the other hand, can sidestep/release the GIL at will, and go on it's merry way and process away. ...Unless part of the C module execution involves the need do CPU- bound work on another

Re: Improving interpreter startup speed

2008-10-27 Thread [EMAIL PROTECTED]
To make faster python, you can do: 1.) Use mod_python, and not cgi. 2.) Use other special python server that remaining in memory, and call it from compiled C code. For example, the C code communicate this server with pipes, tcp, (or with special files, and the result will come back in other

conversion to and from unicode strings

2008-10-27 Thread abhishek
hello group, i want to represent and store a string u'\x00\x07\xa7' as '\x00\x07\xa7'. any ideas on how to achieve this. -- http://mail.python.org/mailman/listinfo/python-list

Re: set/dict comp in Py2.6

2008-10-27 Thread Gabriel Genellina
En Sat, 25 Oct 2008 23:44:46 -0200, Benjamin [EMAIL PROTECTED] escribió: On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: I'd like to know why Python 2.6 doesn't have the syntax to create sets/ dicts of Python 3.0, like: Because nobody bothered to backport them. En Sat, 25 Oct 2008 23:47:32

Re: conversion to and from unicode strings

2008-10-27 Thread Gerhard Häring
abhishek wrote: hello group, i want to represent and store a string u'\x00\x07\xa7' as '\x00\x07\xa7'. any ideas on how to achieve this. You want to store it in the form of the repr() of the string? It is possible to use repr() to get a bytestring to store and to use eval() to create a

Do I need a lock here?

2008-10-27 Thread jasiu85
Hey, Please take a look at the code of the two threads below: COMMON_DICT = {} def thread_1(): global COMMON_DICT local_dict = prepare_dict() COMMON_DICT = local_dict def thread_2(): global COMMON_DICT local_dict = COMMON_DICT use_dict(local_dict) Do I need a lock to

Re: Do I need a lock here?

2008-10-27 Thread Diez B. Roggisch
jasiu85 schrieb: Hey, Please take a look at the code of the two threads below: COMMON_DICT = {} def thread_1(): global COMMON_DICT local_dict = prepare_dict() COMMON_DICT = local_dict def thread_2(): global COMMON_DICT local_dict = COMMON_DICT use_dict(local_dict) Do

Re: Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-27 Thread M.-A. Lemburg
On 2008-10-25 20:19, Akira Kitada wrote: Hi Marc-Andre, Thanks for the suggestion. I opened a ticket for this issue: http://bugs.python.org/issue4204 Thanks. Now I understand the state of the multiprocessing module, but it's too bad to see math, mmap and readline modules, that worked

example for PEP 342

2008-10-27 Thread Severin
Hello, Is there a simple example demonstrating how to use the Trampoline from PEP 342 (http://www.python.org/dev/peps/pep-0342/)? Regards -- http://mail.python.org/mailman/listinfo/python-list

FTP via web browser

2008-10-27 Thread rodmc
Hi, I have posted elsewhere about a related topic. But I an curious is it possible to set up a web form which people select a file for upload which is then upload it via FTP protocol to the web server - the entire process must be web based and not require an external FTP client. The reason for

Re: Type feedback tool?

2008-10-27 Thread M.-A. Lemburg
On 2008-10-26 13:54, Martin Vilcans wrote: Hi list, I'm wondering if there's a tool that can analyze a Python program while it runs, and generate a database with the types of arguments and return values for each function. In a way it is like a profiler, that instead of measuring how often

Re: FTP via web browser

2008-10-27 Thread Tino Wildenhain
rodmc wrote: Hi, I have posted elsewhere about a related topic. But I an curious is it possible to set up a web form which people select a file for upload which is then upload it via FTP protocol to the web server - the entire process must be web based and not require an external FTP client.

Re: conversion to and from unicode strings

2008-10-27 Thread Duncan Booth
abhishek [EMAIL PROTECTED] wrote: hello group, i want to represent and store a string u'\x00\x07\xa7' as '\x00\x07\xa7'. any ideas on how to achieve this. You can use latin-1 encoding. u = ''.join(unichr(c) for c in range(256)) [ord(c) for c in u.encode('latin1')] == range(256) True --

Re: Do I need a lock here?

2008-10-27 Thread Duncan Booth
jasiu85 [EMAIL PROTECTED] wrote: Hey, Please take a look at the code of the two threads below: COMMON_DICT = {} def thread_1(): global COMMON_DICT local_dict = prepare_dict() COMMON_DICT = local_dict def thread_2(): global COMMON_DICT local_dict = COMMON_DICT

xchat

2008-10-27 Thread luca72
Hello i have installed xchat on suse11 i see that there is the possibility to use python for make some script, i see also that the python interface is loaded, but when in python i type import xchat i get that the module don't exist. where is the module? I try also to ask in the xchat forum but i

Re: Type feedback tool?

2008-10-27 Thread skip
(Sorry for any repeated recommendations. I'm offline until Monday morning. You may well see some of these suggestions in the meanwhile, but so far it seems you've had no nibbles.) Martin I'm wondering if there's a tool that can analyze a Python Martin program while it runs, and generate

Re: xchat

2008-10-27 Thread Tino Wildenhain
Hi, luca72 wrote: Hello i have installed xchat on suse11 i see that there is the possibility to use python for make some script, i see also that the python interface is loaded, but when in python i type import xchat i get that the module don't exist. where is the module? I try also to ask in

Re: Type feedback tool?

2008-10-27 Thread Orestis Markou
I think that rope has something like that; not really sure though. On Mon, Oct 27, 2008 at 1:41 AM, [EMAIL PROTECTED] wrote: (Sorry for any repeated recommendations. I'm offline until Monday morning. You may well see some of these suggestions in the meanwhile, but so far it seems you've had

Post easy_install hooks/message

2008-10-27 Thread Orestis Markou
Hello, I've finally uploaded PySmell [1] to PyPI [2], thanks to a fantastic contributor which did all the work for me. As I've written in a blog post [3], I have some trouble distributing some support files, notably, a vim script. I am currently using these directives: data_files = [

Re: Triple-quoted strings hath not the Python-nature

2008-10-27 Thread Steven D'Aprano
On Mon, 27 Oct 2008 12:11:34 +1300, Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: I disagree. Triple-quoted strings are exactly the same as other strings: they capture *exactly* what you put in them ... But that conflicts with the use of whitespace for

Re: Do I need a lock here?

2008-10-27 Thread Michael Sparks
jasiu85 wrote: Do I need a lock to protect the COMMON_DICT dictionary? AFAIK bytecode operations are atomic and in each thread there's only one crucial bytecode op: STORE_NAME in the first thread and LOAD_NAME in the second one. So I suspect that everything will work just fine. Am I right?

Python-URL! - weekly Python news and links (Oct 27)

2008-10-27 Thread Gabriel Genellina
QOTW: But it is the right idea. They just don't know what it means, because they've been listening to people like you who insist on using Pascal terminology with a definition unrecognizable to Pascal programmers. To an ex-Pascal programmer like myself, when you talk about 'call by value where the

Finding Default Page Name using urllib2

2008-10-27 Thread barrett
Is there a way to find the name of a page you are retrieving using python. For example, if I get http://www.cnn.com/ i want to know that the page is index.html. I can do this using wget. as seen in the code below. Can I do this in python? Thanks, $ wget cnn.com --11:15:25-- http://cnn.com/

Re: Finding Default Page Name using urllib2

2008-10-27 Thread Philip Semanchuk
On Oct 27, 2008, at 12:17 PM, barrett wrote: Is there a way to find the name of a page you are retrieving using python. For example, if I get http://www.cnn.com/ i want to know that the page is index.html. I can do this using wget. as seen in the code below. Can I do this in python? Hi

Re: Linq to Python

2008-10-27 Thread Tim Rowe
2008/9/24 Duncan Booth [EMAIL PROTECTED]: Python still wins hands down on this example both in verbosity and readability: But AFAICS, the Python version you give creates a temporary. One of the advantages cited for LINQs functional programming paradigm is that it specifies what is wanted at a

Re: Limit between 0 and 100

2008-10-27 Thread Matimus
On Oct 25, 1:42 pm, [EMAIL PROTECTED] wrote: Hi. I'm very new to Python, and so this is probably a pretty basic question, but I'm lost. I am looking to limit a float value to a number between 0 and 100 (the input is a percentage). I currently have: integer = int() running = True while

Re: Do a Gnuplot of a file in python

2008-10-27 Thread Santix
Thanks a lot because it works with g.load(power.p) But now I have this problem gnuplot load 'power.p' gnuplot set terminal postscript enhanced color gnuplot set output spectrum.ps gnuplot plot gnuplot set terminal x11 gnuplot set output gnuplot plot ^ line 0:

Re: Ordering python sets

2008-10-27 Thread bearophileHUGS
Glenn Linderman: how does one create a key that corresponds to ascending integer followed by descending character string? (Others may have already answered you because Google groups is very slow.) seq = [(10, abb), (5, zul), (5, hal), (2, of)] sorted(seq, key=lambda (n,s): (-n, s),

Re: Limit between 0 and 100

2008-10-27 Thread bearophileHUGS
(Sorry for the answering delay, Google groups is very slow.) James: P.S. I don't understand a lot of what I have there, I got most of it from the beginning tutorials and help sections. I have never programmed before, but this is for a school assignment. You must understand what you do at

Re: big objects and avoiding deepcopy?

2008-10-27 Thread bearophileHUGS
Robert Kern: This is similar to implementing Undo functionality in applications. In a quite-high-level language (like Python, but not necessarily in Python itself) it may become eventually advantageous to add some (even limited) built-in form of undo. Both to give a simpler way to implement a

Re: dictionary

2008-10-27 Thread Scott David Daniels
Hendrik van Rooyen wrote: ... You had Compilers! You had Compiler Vendors! When I was lad, we had nowt but raw hardware. We had to sit in cold room, ears deafened by whine of fan, clicking switches to load our octal in computer. We just had error light... You had octal! We just had

Re: using modules in destructors

2008-10-27 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: It seems to me that deleting local instances before imported modules would solve the problem. Is it not possible for the interpreter to get this right? Or are there cases where this would break stuff. It seems rather unpythonic for the __del__() method to become

Re: Ordering python sets

2008-10-27 Thread Peter Otten
[EMAIL PROTECTED] wrote: Glenn Linderman: how does one create a key that corresponds to ascending integer followed by descending character string? (Others may have already answered you because Google groups is very slow.) seq = [(10, abb), (5, zul), (5, hal), (2, of)] sorted(seq,

Re: Improving interpreter startup speed

2008-10-27 Thread Terry Reedy
David Cournapeau wrote: On Mon, Oct 27, 2008 at 2:36 PM, Terry Reedy [EMAIL PROTECTED] wrote: It this a theoretical problem or an actual one, that we might have other suggestions for? Any command line based on python is a real example of that problem. No it is not. The specific problem that

Re: Improving interpreter startup speed

2008-10-27 Thread Terry Reedy
James Mills wrote: So instead of coming up with arbitary problems, why don't we come up with solutions for Improving Interpreter Startup Speeds ? The current developers, most of whom use Python daily, are aware that faster startup would be better. 2.6 and 3.0 start up quicker because the

Re: Finding the instance reference of an object

2008-10-27 Thread Douglas Alan
Steven D'Aprano [EMAIL PROTECTED] writes: I understand that Python's object and calling semantics are exactly the same as Emerald (and likely other languages as well), and that both Emerald and Python are explicitly based on those of CLU, as described by by Barbara Liskov in 1979: In

Re: [Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-27 Thread Terry Reedy
Gabriel Genellina wrote: En Sun, 26 Oct 2008 12:13:08 -0200, Christian Heimes [EMAIL PROTECTED] escribió: ?? wrote: Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) You have to do each future import in

redirection of standard output of a Python command to a Python variable

2008-10-27 Thread TP
Hi everybody, I try to find a quick way to redirect the standard output of a Python command (for example: print message) to a python variable foobar. Ok, in this simple example, I could do foobar = message, but in fact 'print message' could be replaced by any Python function writing on standard

Re: Finding Default Page Name using urllib2

2008-10-27 Thread M�ta-MCI (MVP)
Hi! Can I do this in python? No. The default page is a property of the web-server ; and it is not client side. Examples : for Apache, it's index.html or index.htm ; but if PHP is installed, index.php is also possible. for APS, it's init.htm (between others possibilites). etc.

Re: big objects and avoiding deepcopy?

2008-10-27 Thread Terry Reedy
[EMAIL PROTECTED] wrote: Robert Kern: This is similar to implementing Undo functionality in applications. In a quite-high-level language (like Python, but not necessarily in Python itself) it may become eventually advantageous to add some (even limited) built-in form of undo. Right now, I

Re: Finding the instance reference of an object

2008-10-27 Thread gooberts
On Oct 17, 5:39 pm, Joe Strout [EMAIL PROTECTED] wrote: On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: And my real point is that this is exactly the same as in every other modern language. No, it isn't.  In many other languages (C, Pascal, etc.), a variable is commonly thought of as

[no subject]

2008-10-27 Thread janandith jayawardena
-- http://mail.python.org/mailman/listinfo/python-list

Simple print to stderr

2008-10-27 Thread RC
By default the print statement sends to stdout I want to send to stderr Try print my meeage, file=sys.stderr I got SyntaxError: invalid syntax I try print my message, sys.stderr But it still sent to stdout. What is the syntax? I wouldn't understand Python's manual print([object,

Re: Simple print to stderr

2008-10-27 Thread Matt Nordhoff
RC wrote: By default the print statement sends to stdout I want to send to stderr Try print my meeage, file=sys.stderr I got SyntaxError: invalid syntax I try print my message, sys.stderr But it still sent to stdout. What is the syntax? I wouldn't understand Python's

Re: redirection of standard output of a Python command to a Python variable

2008-10-27 Thread Gabriel Genellina
En Mon, 27 Oct 2008 16:03:45 -0200, TP [EMAIL PROTECTED] escribió: Hi everybody, I try to find a quick way to redirect the standard output of a Python command (for example: print message) to a python variable foobar. Ok, in this simple example, I could do foobar = message, but in fact 'print

Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
On Oct 17, 5:39 pm, Joe Strout [EMAIL PROTECTED] wrote: On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: And my real point is that this is exactly the same as in every other modern language. No, it isn't. In many other languages (C, Pascal, etc.), a variable is commonly thought of as

Re: Finding the instance reference of an object

2008-10-27 Thread Joe Strout
On Oct 27, 2008, at 12:19 PM, [EMAIL PROTECTED] wrote: I think this uncontrived example addresses the C/Python difference fairly directly (both were tested): That's correct, but of course, C is a decades-old language barely a step above assembler. For a fair comparison, pick any modern OOP

Re: Proposal for thread-safe Tkinter

2008-10-27 Thread Steve Holden
Allen Taylor wrote: I was given the task of upgrading a Python/Tkinter GUI application to the latest versions of Python and Tk. After a while, I realized that the application had not been written in a thread-safe manner. Multiple threads would simply use the Tk object directly. The application

Pydev 1.3.24 Released

2008-10-27 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.24 have been released This is a high-priority release to fix some blocker bugs (that's why it was released in such a short time from the last release) Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on

RE: Web crawler on python

2008-10-27 Thread Support Desk
-Original Message- From: James Mills [mailto:[EMAIL PROTECTED] Sent: Sunday, October 26, 2008 5:26 PM To: sonich Cc: python-list@python.org Subject: Re: Web crawler on python On Mon, Oct 27, 2008 at 6:54 AM, sonich [EMAIL PROTECTED] wrote: I need simple web crawler, I found Ruya, but

Re: Ordering python sets

2008-10-27 Thread bearophileHUGS
Lie Ryan: Oh no, the two dict implementation would work _exactly_ the same from the outside, they are transparently interchangeable. Only the performance characteristic differs because of the different implementation. I don't agree with the general idea. If the operations done by your data

Unpacking byte strings from a file of unknown size

2008-10-27 Thread Mark
Hi; I'm trying to use the struct.unpack to extract an int, int, char struct info from a file. I'm more accustomed to the file.readlines which works well in a 'for' construct (ending loop after reaching EOF). # This does OK at fetching one 10-byte string at a time: # (4, 4, 2 ascii chars

Re: example for PEP 342

2008-10-27 Thread Terry Reedy
Severin wrote: Hello, Is there a simple example demonstrating how to use the Trampoline from PEP 342 (http://www.python.org/dev/peps/pep-0342/)? In the examples section toward the end 3. A simple co-routine scheduler or trampoline that lets coroutines call other coroutines by

Converting a time string to a more readable date, time

2008-10-27 Thread Thierry Lam
I have a python time string which has the following value: 1225137896 The above corresponds to 2008/10/27 16:04:56 What can I use to convert 1225137896 to a more readable date, time format? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python barcode decoding

2008-10-27 Thread Robocop
On Oct 24, 1:24 pm, Mike Driscoll [EMAIL PROTECTED] wrote: On Oct 24, 12:05 pm, Robocop [EMAIL PROTECTED] wrote: Does anyone know of any decent (open source or commercial) python barcoderecognition tools or libraries.  I need to read barcodes from pdfs or images, so it will involve some OCR

Re: Python barcode decoding

2008-10-27 Thread Robocop
On Oct 24, 1:24 pm, Mike Driscoll [EMAIL PROTECTED] wrote: On Oct 24, 12:05 pm,Robocop[EMAIL PROTECTED] wrote: Does anyone know of any decent (open source or commercial) python barcode recognition tools or libraries.  I need to read barcodes from pdfs or images, so it will involve some OCR

Re: Unpacking byte strings from a file of unknown size

2008-10-27 Thread Steven Clark
On Mon, Oct 27, 2008 at 4:29 PM, Mark [EMAIL PROTECTED] wrote: Hi; I'm trying to use the struct.unpack to extract an int, int, char struct info from a file. I'm more accustomed to the file.readlines which works well in a 'for' construct (ending loop after reaching EOF). # This does OK at

Re: Converting a time string to a more readable date, time

2008-10-27 Thread Benjamin Kaplan
On Mon, Oct 27, 2008 at 4:45 PM, Thierry Lam [EMAIL PROTECTED] wrote: I have a python time string which has the following value: 1225137896 The above corresponds to 2008/10/27 16:04:56 What can I use to convert 1225137896 to a more readable date, time format? -- from datetime import

Re: Ordering python sets

2008-10-27 Thread Carl Banks
On Oct 25, 4:58 am, Lie Ryan [EMAIL PROTECTED] wrote: On Wed, 22 Oct 2008 10:43:35 -0700, bearophileHUGS wrote: Mr.SpOOn: Is there another convenient structure or shall I use lists and define the operations I need? musings As Python becomes accepted for more and more serious projects

Re: Linq to Python

2008-10-27 Thread Duncan Booth
Tim Rowe [EMAIL PROTECTED] wrote: I haven't yet had occasion to use LINQ in anger yet, so I have no idea whether its an idea to love or to hate. I do think it is good that C# has effectively sprouted list comprehensions (not to mention anonymous types and type inferencing) and I expect there

Re: Finding the instance reference of an object

2008-10-27 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Oct 17, 5:39 pm, Joe Strout [EMAIL PROTECTED] wrote: On Oct 17, 2008, at 3:19 PM, Grant Edwards wrote: No, it isn't. In many other languages (C, Pascal, etc.), a variable is commonly thought of as a fixed location in memory into which one can put values. Those

Re: FTP via web browser

2008-10-27 Thread Diez B. Roggisch
rodmc schrieb: Hi, I have posted elsewhere about a related topic. But I an curious is it possible to set up a web form which people select a file for upload which is then upload it via FTP protocol to the web server - the entire process must be web based and not require an external FTP client.

Re: Unpacking byte strings from a file of unknown size

2008-10-27 Thread Gabriel Genellina
En Mon, 27 Oct 2008 19:03:37 -0200, Steven Clark [EMAIL PROTECTED] escribió: On Mon, Oct 27, 2008 at 4:29 PM, Mark [EMAIL PROTECTED] wrote: Hi; I'm trying to use the struct.unpack to extract an int, int, char struct info from a file. I'm more accustomed to the file.readlines which works

Re: Unpacking byte strings from a file of unknown size

2008-10-27 Thread Terry Reedy
Mark wrote: Hi; I'm trying to use the struct.unpack to extract an int, int, char struct info from a file. I'm more accustomed to the file.readlines which works well in a 'for' construct (ending loop after reaching EOF). You do not need .readlines to iterate through a file by lines. for

Re: Type feedback tool?

2008-10-27 Thread Martin Vilcans
Thanks everyone for the suggestions. I've implemented a simple solution using sys.settrace. It's quite nice because it doesn't require any instrumentation of the code (it works like a debugger that traps all function calls). Here's the output I get right now when profiling Skip's example code

Re: Converting a time string to a more readable date, time

2008-10-27 Thread Scott David Daniels
Thierry Lam wrote: I have a python time string which has the following value: 1225137896 The above corresponds to 2008/10/27 16:04:56 What can I use to convert 1225137896 to a more readable date, time format? (1) Read Smart Questions [you could at least have told us where this number came

question about the textwrap module

2008-10-27 Thread TP
Hi everybody, Recently, I have tried to improve the look of the printed text in command line. For this, I was compelled to remove redundant spaces in strings, because in my scripts, often the strings are spreading on several lines. For example, aaa bbb had to be transformed in aaa bbb. I have

Re: Finding the instance reference of an object

2008-10-27 Thread Steven D'Aprano
On Mon, 27 Oct 2008 13:11:04 -0600, Joe Strout wrote: On Oct 27, 2008, at 12:19 PM, [EMAIL PROTECTED] wrote: I think this uncontrived example addresses the C/Python difference fairly directly (both were tested): That's correct, but of course, C is a decades-old language barely a step

Re: Porting VB apps to Python for Window / Linux use

2008-10-27 Thread Steven D'Aprano
On Mon, 27 Oct 2008 12:31:06 +1100, Ben Finney wrote: Lawrence D'Oliveiro [EMAIL PROTECTED] writes: Software has no market value. Business models that try to assign it one are doomed to fight an uphill battle against market forces. +1 QOTW. -1 That quote confuses the *cost* of

Re: Finding the instance reference of an object

2008-10-27 Thread Chuckk Hubbard
I'm sorry to say I'm pretty confused by the example, but if you want something like bob = module.object() frank = module.object() and then to know that bob is bob from a list of instances, you could instead do something like: for person in listofnames: temp = module.object(person)

Re: question about the textwrap module

2008-10-27 Thread Gabriel Genellina
En Mon, 27 Oct 2008 20:50:08 -0200, TP [EMAIL PROTECTED] escribió: Recently, I have tried to improve the look of the printed text in command line. For this, I was compelled to remove redundant spaces in strings, because in my scripts, often the strings are spreading on several lines. For

Looking for a pure python Mysql module

2008-10-27 Thread Carl
Does anyone know of a package that can connect and query a mysql server that is platform independent and does not need to compile any extra c modules (IE a pure python module)? -- http://mail.python.org/mailman/listinfo/python-list

Database specialized in storing directed graphs?

2008-10-27 Thread Carl Banks
I was wondering if anyone had any advice on this. This is not to study graph theory; I'm using the graph to represent a problem domain. The graphs could be arbitrarily large, and could easily have millions of nodes, and most nodes have a substantial amount of data associated with them.

Re: Ordering python sets

2008-10-27 Thread greg
On approximately 10/27/2008 10:27 AM, came the following characters from the keyboard of Peter Otten: Here's a class that can negate arbitrary values ... def __init__(self, value): ... self.value = value ... def __cmp__(self, other): ... return -cmp(self.value,

Re: Finding the instance reference of an object

2008-10-27 Thread greg
Steven D'Aprano wrote: By common usage and technical definition, C is call by value. Argument passing in Python does not behave like C. So why insist that Python is also call by value? Whether it behaves like C is not the test. Let's look at the definitions of the terms: (1) Call by value:

Re: Finding the instance reference of an object

2008-10-27 Thread Dale Roberts
[I am actually enjoying this discussion, even though it does not address the OP's question. It is helping to solidify *my* understanding.] Joe Strout wrote: On Oct 27, 2008, at 12:19 PM, [EMAIL PROTECTED] wrote: I think this uncontrived example addresses the C/Python difference fairly

Re: PIL: Getting a two color difference between images

2008-10-27 Thread Kevin D . Smith
On 2008-10-25 12:41:51 -0500, [EMAIL PROTECTED] said: Kevin D. Smith: What I want is a two color output image: black where the image wasn't different, and white where it was different. There are several ways to do that. If speed isn't essential, then you can create a third blank image of the

Re: lxml removing tag, keeping text order

2008-10-27 Thread Tim Arnold
Stefan Behnel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Tim Arnold schrieb: Hi, Using lxml to clean up auto-generated xml to validate against a dtd; I need to remove an element tag but keep the text in order. For example s0 = ''' option optional first text

Re: Finding the instance reference of an object

2008-10-27 Thread Douglas Alan
greg [EMAIL PROTECTED] writes: Seems to me that (1) describes exactly how parameter passing works in Python. So why insist that it's *not* call by value? Because there's an important distinction to be made, and the distinction has been written up in the Computer Science literature since Lisp

Re: project in python

2008-10-27 Thread alex23
On Oct 26, 2:51 am, Stefan Behnel [EMAIL PROTECTED] wrote: The more you spam people with your repetitive postings, the less likely it becomes that they are willing to answer you. In asit's defence, the Google Groups interface has been woefully broken for the past 3-4 days. If e had posted via

Re: Finding the instance reference of an object

2008-10-27 Thread Gabriel Genellina
En Tue, 28 Oct 2008 00:58:10 -0200, greg [EMAIL PROTECTED] escribió: Steven D'Aprano wrote: By common usage and technical definition, C is call by value. Argument passing in Python does not behave like C. So why insist that Python is also call by value? Whether it behaves like C is not

[issue4213] Lower case file system encoding

2008-10-27 Thread Christian Heimes
New submission from Christian Heimes [EMAIL PROTECTED]: Python should lower case the file system encoding in Python/pythonrun.c. On several occasions Python optimizes code paths for lower case encodings like utf-8 or latin-1. On my Ubuntu system the file system encoding is upper case (UTF-8) and

[issue3723] Py_NewInterpreter does not work

2008-10-27 Thread Christian Heimes
Changes by Christian Heimes [EMAIL PROTECTED]: -- dependencies: +Lower case file system encoding ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3723 ___

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-27 Thread Jesse Noller
Changes by Jesse Noller [EMAIL PROTECTED]: -- nosy: +jnoller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4204 ___ ___ Python-bugs-list mailing list

  1   2   >