Re: strptime and microseconds

2007-10-19 Thread mathieu
On Oct 18, 10:54 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: On 18 oct, 13:46, mathieu [EMAIL PROTECTED] wrote: On Oct 18, 6:36 pm, mathieu [EMAIL PROTECTED] wrote: I am trying to use strptime to parse my microseconds but I was not able the documentation for it. The only list I

Re: What Data is Available With a Pickled Object Over a Socket?

2007-10-19 Thread Hendrik van Rooyen
milan_sanremo hanco,,,ail.comwrote: pickledMailbag = cPickle.dump(mb, HIGHEST_PROTOCOL) If you are going to send it over a socket - is it not better to use dumps instead of dump? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert string to command..

2007-10-19 Thread Hrvoje Niksic
Abandoned [EMAIL PROTECTED] writes: Use a different column type for cache2's column, one more appropriate for storing binary characters (perhaps BYTEA for Postgres). Don't forget to also use a bind variable, something like: cursor.execute(INSERT INTO cache2 VALUES (?), a) Using INSERT ...

how to iterate over sequence and non-sequence ?

2007-10-19 Thread stef mientki
hello, I generate dynamically a sequence of values, but this sequence could also have length 1 or even length 0. So I get some line in the form of: line = '(2,3,4)' line = '' line = '(2)' (in fact these are not constant numbers, but all kind of integer variables, coming from

Re: Convert string to command..

2007-10-19 Thread Bruno Desthuilliers
Peter Otten a écrit : (snip) Before you go on with your odd caching schemes -- is the database properly indexed? Something like CREATE UNIQUE INDEX mytable_id1_id2 ON mytable (id-1, id-2); (actual syntax may differ) might speed up the lookup operation enough that you can do without

Re: python logging module and custom handler specified in config file

2007-10-19 Thread Frank Aune
On Thursday 18 October 2007 19:26:59 Vinay Sajip wrote: The values in the config file are interpreted in the context of the logging module's namespace. Hence, one way of achieving what you want is putting any custom handlers in a module of your own, and providing a binding in the logging

dynamic invoke

2007-10-19 Thread lukasz . f24
Hello, Is there any way (other then eval) to invoke a method by passing method name in a string. It's very simple in php: $oFoo = new Foo(); $dynamiMethod = bar; $oFoo-$dynamiMethod(); Unfortunately I can't find a good solution to do the same thing in python. Does it have some build-in function

Re: Convert string to command..

2007-10-19 Thread Hrvoje Niksic
Hrvoje Niksic [EMAIL PROTECTED] writes: If you're generating the string from Python, use cPickle instead. Much faster: [...] t0 = time.time(); d2 = eval(s); t1 = time.time(); t1-t0 1.5457899570465088 t0 = time.time(); d2 = pickle.loads(s); t1 = time.time(); t1-t0 0.060307979583740234 It

Re: image resize question

2007-10-19 Thread Tim Arnold
Matimus [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Oct 18, 11:56 am, Tim Arnold [EMAIL PROTECTED] wrote: Hi, I'm using the Image module to resize PNG images from 300 to 100dpi for use in HTML pages, but I'm losing some vertical and horizontal lines in the images (usually

deepcopy debugging

2007-10-19 Thread Robin Becker
I'm using deepcopy in some code which eventually ends up by crash witht he following rather long winded error. I'm not directly using _hashlib.HASH, but I suppose something else along the way could be. Is there some nice way to make copy/deepcopy give more information when this error happens? I

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread stef
Paul Hankin wrote: On Oct 19, 12:24 am, stef mientki [EMAIL PROTECTED] wrote: I generate dynamically a sequence of values, but this sequence could also have length 1 or even length 0. So I get some line in the form of: line = '(2,3,4)' line = '' line = '(2)' (in fact

Re: Noob questions about Python

2007-10-19 Thread Grant Edwards
On 2007-10-19, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Arnaud Delobelle arnoemail.com wrote: In binary 2 is 10. When you multiply by 10, you shift all your digits left by 1 place. When you multiply by 10**n (which is 1 followed by n zeroes), you shift all your digits left by n

write whitespace/tab to a text file

2007-10-19 Thread dirkheld
Hi, I would l like to write some data to a text file. I want to write the data with whitespace or tabs in between so that I create tabular columns like in a spreadsheet. How can I do this in python. (btw, I'm new to python) names = ['John','Steve','asimov','fred','jim'] ## output I would like in

How to use module audit-lib ?

2007-10-19 Thread Sébastien Weber
Hello, I've installed the python-audit-lib module but there's no documentation. Does someone know how to use it ? Thank's in advance, SW -- http://mail.python.org/mailman/listinfo/python-list

Re: What Data is Available With a Pickled Object Over a Socket?

2007-10-19 Thread Lawrence Oluyede
milan_sanremo [EMAIL PROTECTED] wrote: I've read the library entry for pickle a couple of times, and I'm still not sure what data is maintained when an item is pickled and sent over a socket. I would not do that if I were you: http://jcalderone.livejournal.com/15864.html Unless you don't

Re: write whitespace/tab to a text file

2007-10-19 Thread Grant Edwards
On 2007-10-19, marc wyburn [EMAIL PROTECTED] wrote: I would l like to write some data to a text file. I want to write the data with whitespace or tabs in between so that I create tabular columns like in a spreadsheet. How can I do this in python. (btw, I'm new to python) names =

Re: Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

2007-10-19 Thread Metalone
Thanks to all, I learned something in each post. When using py2exe to build an executable sys.executable does not provide the name of the python interpreter but the name of the executable generated by py2exe. -- http://mail.python.org/mailman/listinfo/python-list

Re: DIAGNOSIS: Racism moves back to Denmark from South Africa

2007-10-19 Thread mich
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] INCISIVE ANALYSIS: The dismantlement of Apartheid Regime in South Africa sent the racist Dutch Afrikaners back to Denmark where they are spreading their racist ideology -- The Apartheid Christianity : The Dutch went back to Denmark?

Using Python with SciTE editor

2007-10-19 Thread bobmon
Hello, I have a problem running Python programs from within SciTE, under Linux --- the input( ) function fails with IOError: [Errno 9] Bad file descriptor The same program will run happily in SciTE, under Windows --- gets the input, goes off and calculates wondrous things --- but somehow,

Re: How to use module audit-lib ?

2007-10-19 Thread Sébastien Weber
Le Fri, 19 Oct 2007 21:49:59 +0200, Jarek Zgoda a écrit : Sébastien Weber napisał(a): I've installed the python-audit-lib module but there's no documentation. Does someone know how to use it ? I don't know this package, but why did you install it? Maybe somebody in Überwald knows its

Re: Problem with format string / MySQL cursor

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 05:32:04 -0300, Dennis Lee Bieber [EMAIL PROTECTED] escribió: On Thu, 18 Oct 2007 13:40:53 -0700, Florian Lindner [EMAIL PROTECTED] declaimed the following in comp.lang.python: That works! Thanks! But a weird error message for this solution... Not really... The

Re: ConfigParser preserving file ordering

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 10:16:00 -0300, Andrew Durdin [EMAIL PROTECTED] escribió: As for updating ConfigParser -- like most other changes, it probably needs a champion. ConfigParser is so dumb that should be burned to death and rebuilt from the ashes. -- Gabriel Genellina --

Re: Python script for mobile platforms -- suggested?

2007-10-19 Thread Robert Dailey
On 8/14/07, Jay Loden [EMAIL PROTECTED] wrote: XML is first and foremost a machine-parseable language, and a human-readable one second ;) I don't think this is particularly hard to read, but then I work with XML configuration files on a daily basis at work, so I may just be a terrible

Problem with shelve/gdbm

2007-10-19 Thread Douglas Applegate
Hi- I am having a problem with shelve. The problem I think is really with gdbm. I'll write out a file using shelve/gdbm on an amd64 machine and then I'll try to read it in on a i386 machine. The result is a 'gdbm fatal: read error.' Reversing directions results in the same problem. Below

Re: Strange behaviour with reversed()

2007-10-19 Thread Duncan Booth
Andreas Kraemer [EMAIL PROTECTED] wrote: The only other behaviours I would regard as intuitive for iteration over a mutating sequence would be to throw an exception either for mutating the sequence while the iterator exists or for using the iterator after a mutation. Maybe it would have

Re: class vs type

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 20:14:03 -0300, Colin J. Williams [EMAIL PROTECTED] escribió: The Python 3.0 doc, under Class, has: Programmer’s note: Variables defined in [...] For new-style classes, descriptors can be used to create instance variables with different implementation details.

Re: Last iteration?

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 19:12:49 -0300, Michael J. Fromberger [EMAIL PROTECTED] escribió: Before I affront you with implementation details, here's an example: | from __future__ import with_statement | with last_of(enumerate(file('/etc/passwd', 'rU'))) as fp: | for pos, line in fp: |

SQLObject - Connect to established DB with non-int 'id' field

2007-10-19 Thread Sean DiZazzo
Hi all, I am just beginning with TurboGears and have run into a problem with SQLObject. I'm trying to connect to an established mysql DB, and use TurboGears to display results from the DB only. The problem is that the DB already has an 'id' field that is a string as opposed to an int. SQLObject

More friends more money,get friends while get paid

2007-10-19 Thread my god
More friends more money,get friends while get paid http://groups.google.com/group/all-good-things/web/get-friends-while-get-paid -- http://mail.python.org/mailman/listinfo/python-list

Re: __main__ : What is this?

2007-10-19 Thread Massimo Di Pierro
if the .py file is imported as a module that condition is false else (if the .py file is executed) that condition is true On Oct 19, 2007, at 6:29 PM, Robert Dailey wrote: Hi, I've read various portions of the Python 2.5 documentation in an attempt to figure out exactly what the following

__main__ : What is this?

2007-10-19 Thread Robert Dailey
Hi, I've read various portions of the Python 2.5 documentation in an attempt to figure out exactly what the following condition represents: if __name__ == __main__: main() However, I was not able to determine what it is actually checking for. Could someone point me in the way of a tutorial

Re: class vs type

2007-10-19 Thread Colin J. Williams
Terry Reedy wrote: Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Doesn't Python 3 provide an opportunity | to move away from discussions about | new_style vs old-style? This an | opportunity to treat old-style as a | historical artefact, not requiring |

Re: DIAGNOSIS: Racism moves back to Denmark from South Africa

2007-10-19 Thread Jarek Zgoda
mich napisał(a): INCISIVE ANALYSIS: The dismantlement of Apartheid Regime in South Africa sent the racist Dutch Afrikaners back to Denmark where they are spreading their racist ideology -- The Apartheid Christianity : The Dutch went back to Denmark? Let them thank God they didn't sent

Re: Running another python interpreter

2007-10-19 Thread Gabriel Genellina
--- Simon Pickles [EMAIL PROTECTED] escribió: os.spawnl(os.P_NOWAIT, sys.executable, sys.executable, gateway.py) ... works but both process output to the same interpreter window. Is there a way to run another interpreter window containing gateway.py? Use the subprocess module, passing

Re: ANN: Pyrex 0.9.6.3

2007-10-19 Thread Greg Ewing
[EMAIL PROTECTED] wrote: Also, I noticed that if I try to download the testing framework, it gives me a 404. That one is fixed now, if you want to try again. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: C++ version of the C Python API?

2007-10-19 Thread Joe Riopel
On 10/19/07, Robert Dailey [EMAIL PROTECTED] wrote: Is there a C++ version of the C Python API packaged with python 2.5? It would be nice to have a OOP approach to embedding python in C++. It would also be a bonus if this C++ Python API cleaned up a lot of the messy code involved in embedding

where do I need to tab?

2007-10-19 Thread [EMAIL PROTECTED]
hi I'm following the python's translation of SICP: http://codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Python:Chapter_1 ... a = 3 b = a + 1 print a + b + (a * b) print (a == b) print b if ((b a) and (b (a * b))) else a everything was fine till this point, and I got:

Re: __main__ : What is this?

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 21:26:22 -0300, Matimus [EMAIL PROTECTED] escribió: The common pattern: if __name__ == __main__: # do stuff IMHO better written: if __main__ == __name__: # do stuff I'm intrigued why do you feel the second alternative is better. Which is your native language?

Re: where do I need to tab?

2007-10-19 Thread Basilisk96
Tab is not the issue here. By my powers of deduction, I can see that you are running this code in Python version previous to 2.5, because the construct true_clause if condition else false_clause did not exist until 2.5. It's a neat little construct, I highly recommend you upgrade now :)

Re: __main__ : What is this?

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 20:29:03 -0300, Robert Dailey [EMAIL PROTECTED] escribió: I've read various portions of the Python 2.5 documentation in an attempt to figure out exactly what the following condition represents: if __name__ == __main__: main() However, I was not able to determine

Re: __main__ : What is this?

2007-10-19 Thread Matimus
I've read various portions of the Python 2.5 documentation in an attempt to figure out exactly what the following condition represents: if __name__ == __main__: main() However, I was not able to determine what it is actually checking for. Could someone point me in the way of a tutorial

Re: __main__ : What is this?

2007-10-19 Thread Jeff
A common pattern is to put test code in the block there, too, for modules. Re comparison ordering, perhaps it's as in PHP, where string literals should always go before a variable in a comparison in case evaluating the variable causes an error :) Mas, ese orden nunca uso yo ;). On Oct 19, 10:25

Distributed RVS, Darcs, tech love

2007-10-19 Thread Xah Lee
When i first heard about distributed revision control system about 2 years ago, i heard of Darcs, which is written in Haskell. I was hugely excited, thinking about the functional programing i love, and the no- side effect pure system i idolize, and the technology of human animal i rapture in

Re: Noob: Loops and the 'else' construct

2007-10-19 Thread MRAB
On Oct 19, 4:11 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Thu, 18 Oct 2007 23:44:27 -0300, Ixiaus [EMAIL PROTECTED] escribió: I have just come across a site that discusses Python's 'for' and 'while' loops as having an (optional) 'else' structure. At first glance I interpreted it

Re: where do I need to tab?

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 23:24:30 -0300, Scott David Daniels [EMAIL PROTECTED] escribió: [EMAIL PROTECTED] wrote: I'm following the python's translation of SICP: http://codepoetics.com/wiki/index.php?title=Topics:SICP_in_other_languages:Python:Chapter_1 ... OK, you have a mix of Python 3,0 and

Re: traceback over C API and PyObject_CallObject

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 13:53:03 -0300, Sami Vaisanen [EMAIL PROTECTED] escribió: Hello group, I'm trying to get the Python exception information (message and traceback) stored into a string in my C++ code. However all i get back is the string None. This is what you get (actually None\n)

Re: Last iteration?

2007-10-19 Thread Michael J. Fromberger
In article [EMAIL PROTECTED], Raymond Hettinger [EMAIL PROTECTED] wrote: [Diez B. Roggisch] out:) But I wanted a general purpose based solution to be available that doesn't count on len() working on an arbitrary iterable. [Peter Otten] You show signs of a severe case of morbus

Re: Distributed RVS, Darcs, tech love

2007-10-19 Thread Byung-Hee HWANG
On Fri, 2007-10-19 at 20:28 -0700, Xah Lee wrote: When i first heard about distributed revision control system about 2 years ago, i heard of Darcs, which is written in Haskell. I was hugely excited, thinking about the functional programing i love, and the no- side effect pure system i idolize,

Re: DIAGNOSIS: Racism moves back to Denmark from South Africa

2007-10-19 Thread Maarten Bergvelt
On 2007-10-19, mich [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] INCISIVE ANALYSIS: The dismantlement of Apartheid Regime in South Africa sent the racist Dutch Afrikaners back to Denmark where they are spreading their racist ideology -- The Apartheid

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Gabriel Genellina
En Fri, 19 Oct 2007 16:17:41 -0300, Raymond Hettinger [EMAIL PROTECTED] escribió: Try heapq.nsmallest(). En Fri, 19 Oct 2007 16:20:29 -0300, Raymond Hettinger [EMAIL PROTECTED] escribió: Try heapq.nsmallest(). En Fri, 19 Oct 2007 17:22:13 -0300, Raymond Hettinger [EMAIL PROTECTED]

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread Bruno Desthuilliers
stef mientki a écrit : Steven D'Aprano wrote: On Fri, 19 Oct 2007 16:19:32 +0200, stef wrote: Well I'm not collecting data, I'm collecting pointers to data. I beg to differ, you're collecting data. How that data is to be interpreted (a string, a number, a pointer...) is a

C++ version of the C Python API?

2007-10-19 Thread Robert Dailey
Hi, Is there a C++ version of the C Python API packaged with python 2.5? It would be nice to have a OOP approach to embedding python in C++. It would also be a bonus if this C++ Python API cleaned up a lot of the messy code involved in embedding python. Thanks. --

Re: Strange behaviour with reversed()

2007-10-19 Thread Andreas Kraemer
On Oct 19, 1:49 pm, Duncan Booth [EMAIL PROTECTED] wrote: Andreas Kraemer [EMAIL PROTECTED] wrote: The only other behaviours I would regard as intuitive for iteration over a mutating sequence would be to throw an exception either for mutating the sequence while the iterator exists or for

Need some help with my first Twisted program

2007-10-19 Thread McCann, Brian
I posted this to the Twisted list...figured I'd try here too. I'm looking for what is probably an simple solution I can't figure out on my own. I'm writing an SSH server based on the example on the web (using conch). I'm trying to figure out how to detect when the client exists (for example,

Re: documenting excepetions in Python

2007-10-19 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : In python, how do I know what exceptions a method s/method/callable/ A method is only a thin wrapper around a function, and functions are just one kind of callable object (classes are another, and you can define your own...) could raise? Practically speaking,

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Raymond Hettinger
On Oct 19, 11:26 am, xkenneth [EMAIL PROTECTED] wrote: All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of timeStamps without iterating over a list. My

Re: How to use module audit-lib ?

2007-10-19 Thread Jarek Zgoda
Sébastien Weber napisał(a): I've installed the python-audit-lib module but there's no documentation. Does someone know how to use it ? I don't know this package, but why did you install it? Maybe somebody in Überwald knows its usage? -- Jarek Zgoda http://jpa.berlios.de/ --

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Raymond Hettinger
On Oct 19, 11:26 am, xkenneth [EMAIL PROTECTED] wrote: All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of timeStamps without iterating over a list. My

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Raymond Hettinger
On Oct 19, 11:26 am, xkenneth [EMAIL PROTECTED] wrote: All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of timeStamps without iterating over a list. My

Re: vote for Python - PLEASE

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 15:45:42 +, Grant Edwards wrote: Even though Python is way ahead, you've probably ruined it for us. I suspect the folks at MySQL will ignore or discount the results when they find out you've solicited fradulent votes from the Python community. It's an Internet poll.

Re: class vs type

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 12:21:25 -0400, Colin J. Williams wrote: In this case, why do we continue to use the word class to generate a type? Because type is a callable, and class is convenient syntactic sugar. class Parrot(object): def speak(self, msg): return Polly sez %s % msg is

Re: class vs type

2007-10-19 Thread Terry Reedy
Colin J. Williams [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Doesn't Python 3 provide an opportunity | to move away from discussions about | new_style vs old-style? This an | opportunity to treat old-style as a | historical artefact, not requiring | current explanation. Yes,

Re: Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

2007-10-19 Thread Thomas Heller
Metalone schrieb: Thanks to all, I learned something in each post. When using py2exe to build an executable sys.executable does not provide the name of the python interpreter but the name of the executable generated by py2exe. When running the executable built with py2exe you might be

Re: Memory Problems in Windows 2003 Server

2007-10-19 Thread AMD
Thanks Marc, I just tried shelve but it is very slow :( I haven't tried the dbs yet. Andre Marc 'BlackJack' Rintsch a écrit : On Mon, 15 Oct 2007 11:31:59 +0200, amdescombes wrote: Are there any classes that implement disk based dictionaries? Take a look at the `shelve` module from the

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Larry Bates
xkenneth wrote: All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of timeStamps without iterating over a list. My thought was to use a binary tree, am i

Re: Control Log File Size

2007-10-19 Thread Matt McCredie
I've got an application running on linux which writes log files using the python logging module. I'm looking for some help and advice to cap the size which the file will grow too, something reasonably like 2Mb would be great. What is the best way to handle this kind of thing? Can this be

Re: Millisecond timestamp function?

2007-10-19 Thread Joshua J. Kugler
On Friday 19 October 2007 05:44, Dmitri O.Kondratiev wrote: What Python module / function can be used to get millisecond timestamps? time.time() returns the time as a floating point number expressed in seconds since the epoch, in UTC. Thanks! See the module datetime. The datetime object

traceback over C API and PyObject_CallObject

2007-10-19 Thread Sami Vaisanen
Hello group, I'm trying to get the Python exception information (message and traceback) stored into a string in my C++ code. However all i get back is the string None. All the checks pass and all pointers get a value from the python API calls. I've also tried with a different function such as

Re: write whitespace/tab to a text file

2007-10-19 Thread marc wyburn
On Oct 19, 3:33 pm, dirkheld [EMAIL PROTECTED] wrote: Hi, I would l like to write some data to a text file. I want to write the data with whitespace or tabs in between so that I create tabular columns like in a spreadsheet. How can I do this in python. (btw, I'm new to python) names =

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread stef mientki
Steven D'Aprano wrote: On Fri, 19 Oct 2007 16:19:32 +0200, stef wrote: Well I'm not collecting data, I'm collecting pointers to data. I beg to differ, you're collecting data. How that data is to be interpreted (a string, a number, a pointer...) is a separate issue. This

Re: class vs type

2007-10-19 Thread Colin J. Williams
Hrvoje Niksic wrote: Colin J. Williams [EMAIL PROTECTED] writes: In Python Types and Objects, Shalabh Chaturvedi says (in the Python 3.0 documentation - New Style Classes) The term class is traditionally used to imply an object created by the class statement. However, classes are now

write whitespace/tab to a text file

2007-10-19 Thread dirkheld
Hi, I would l like to write some data to a text file. I want to write the data with whitespace or tabs in between so that I create tabular columns like in a spreadsheet. How can I do this in python. (btw, I'm new to python) names = ['John','Steve','asimov','fred','jim'] ## output I would like in

Re: documenting excepetions in Python

2007-10-19 Thread Nikita the Spider
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: In python, how do I know what exceptions a method could raise? Do I need to look at the source? I don't see this info in the API docs for any of the APIs I'm using. Hi Dale, Usually the docs for a method will list the likely

Re: vote for Python - PLEASE

2007-10-19 Thread Grant Edwards
On 2007-10-18, Monty Taylor [EMAIL PROTECTED] wrote: MySQL has put up a poll on http://dev.mysql.com asking what your primary programming language is. Even if you don't use MySQL - please go stick in a vote for Python. I'm constantly telling folks that Python needs more love, but PHP and

Re: vote for Python - PLEASE

2007-10-19 Thread Bjoern Schliessmann
Monty Taylor wrote: MySQL has put up a poll on http://dev.mysql.com asking what your primary programming language is. Even if you don't use MySQL - please go stick in a vote for Python. I'm constantly telling folks that Python needs more love, but PHP and Java are kicking our butts... If

Re: Please Help !!!

2007-10-19 Thread kyosohma
On Oct 17, 4:32 am, Heiko Schlierkamp [EMAIL PROTECTED] africa.com.na wrote: I need to update the virus program every day with the new dat file from mcafee I would like to us a Bat file to go to the web page and download the dat file automatically to a specific Directory, that I have created,

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 16:19:32 +0200, stef wrote: Well I'm not collecting data, I'm collecting pointers to data. I beg to differ, you're collecting data. How that data is to be interpreted (a string, a number, a pointer...) is a separate issue. This program simulates a user written program

Re: write whitespace/tab to a text file

2007-10-19 Thread Sébastien Weber
Le Fri, 19 Oct 2007 07:33:29 -0700, dirkheld a écrit : Hi, I would l like to write some data to a text file. I want to write the data with whitespace or tabs in between so that I create tabular columns like in a spreadsheet. How can I do this in python. (btw, I'm new to python) names =

Re: Please Help !!!

2007-10-19 Thread Tim Golden
marc wyburn wrote: On Oct 17, 10:32 am, Heiko Schlierkamp [EMAIL PROTECTED] africa.com.na wrote: I need to update the virus program every day with the new dat file from mcafee I would like to us a Bat file to go to the web page and download the dat file automatically to a specific Directory,

SWIG-PYTHON - Problem in header file inclusion

2007-10-19 Thread abarun22
Hi I am facing a problem while including a C header file in the SWIG interface file. However the problem does not occur when i directly copy the contents of header file in the same place. My interface file read as follows. /* interface file dep.i */ %module dep %{ #include dep.h %} %inline %{

Control Log File Size

2007-10-19 Thread Robert Rawlins - Think Blue
Hello Chaps, I've got an application running on linux which writes log files using the python logging module. I'm looking for some help and advice to cap the size which the file will grow too, something reasonably like 2Mb would be great. What is the best way to handle this kind of thing?

Millisecond timestamp function?

2007-10-19 Thread Dmitri O.Kondratiev
What Python module / function can be used to get millisecond timestamps? time.time() returns the time as a floating point number expressed in seconds since the epoch, in UTC. Thanks! -- Dmitri O. Kondratiev [EMAIL PROTECTED] http://www.geocities.com/dkondr --

Re: ConfigParser preserving file ordering

2007-10-19 Thread Andrew Durdin
On 10/19/07, Frank Aune [EMAIL PROTECTED] wrote: Yes, but as I said I need functionality present in the standard-library, so sub-classing ConfigParser is the last option really. Any particular reason you're limited to the standard library? I've used iniparse http://code.google.com/p/iniparse/

Re: class vs type

2007-10-19 Thread Hrvoje Niksic
Colin J. Williams [EMAIL PROTECTED] writes: In Python Types and Objects, Shalabh Chaturvedi says (in the Python 3.0 documentation - New Style Classes) The term class is traditionally used to imply an object created by the class statement. However, classes are now synonymous with types.

Re: Enso or Launchy like UI from Python

2007-10-19 Thread kyosohma
On Oct 19, 3:45 am, zooey [EMAIL PROTECTED] wrote: Hi there, I want to make transparent/launcher-like window application using python. (similar as Enso, Launchy, etc. I know Enso written in python.) Is there any open source project like it or any example? Thanks, Aaron. -- View

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread Duncan Booth
Nils [EMAIL PROTECTED] wrote: why not: for i in eval('(1,2,3)'): ... print i 1 2 3 For the exact same reason Steven already gave you: one day someone will give you bad data. For eval you need to use slightly more complicated expressions. e.g. __import__('os').system('rm # -rf /')

Re: Noob questions about Python

2007-10-19 Thread Hendrik van Rooyen
Arnaud Delobelle arnoemail.com wrote: In binary 2 is 10. When you multiply by 10, you shift all your digits left by 1 place. When you multiply by 10**n (which is 1 followed by n zeroes), you shift all your digits left by n places. I read somewhere: Only 1 person in 1000 understands

Re: Noob: Loops and the 'else' construct

2007-10-19 Thread Dustan
On Oct 19, 3:12 am, Thorsten Kampe [EMAIL PROTECTED] wrote: So a for/else loop is exactly the same thing as a for loop with the else clause outside the loop (except for break)? Am I missing something here? It sounds to me like you just described two identical constructs. Guess that's why I

Re: how to iterate over sequence and non-sequence ?

2007-10-19 Thread Nils
On Oct 19, 10:58 am, Steven D'Aprano [EMAIL PROTECTED] wrote: On Fri, 19 Oct 2007 01:24:09 +0200, stef mientki wrote: hello, I generate dynamically a sequence of values, but this sequence could also have length 1 or even length 0. So I get some line in the form of: line =

Re: dynamic invoke

2007-10-19 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: On 19 Oct, 11:45, Jarek Zgoda [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] napisa³(a): Is there any way (other then eval) to invoke a method by passing method name in a string. It's very simple in php: $oFoo = new Foo(); $dynamiMethod = bar;

a good website for softwares,sports,movies and music ,sex etc.

2007-10-19 Thread panguohua
www.space666.com nice -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

2007-10-19 Thread BlueBird
On Oct 18, 11:56 pm, Metalone [EMAIL PROTECTED] wrote: In particular I want to know how to tell if reading and writing to the console can occur. Something like sys.isConsolePresent() For a different problem, I have the following code. It might help: def isrealfile(file):

Re: Noob questions about Python

2007-10-19 Thread A.T.Hofkamp
On 2007-10-19, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Oct 19, 1:44 am, MRAB [EMAIL PROTECTED] wrote: On Oct 18, 7:05 am, Michele Simionato [EMAIL PROTECTED] if number == 0: return 0 Hey, Isn't if not number: return 0 faster? Depends on who is parsing it. If a

CGI Server that supports redirects

2007-10-19 Thread Thomas Guettler
Hi, CGIHTTPServer does not support redirects[1] Is there an other python-only way to get a web server running wich can execute python code? Since I already use flup[2]. I think there is not much missing to get it serving as http server. Has anyone hints? [1]

Re: Convert string to command..

2007-10-19 Thread Peter Otten
Abandoned wrote: I'm very confused :( I try to explain main problem... That's always a good first step; try to remember that when you start your next thread. I have a table like this: id-1 | id-2 | value 23 24 34 56 68 66 56 98 32455 55 62 655 56

Enso or Launchy like UI from Python

2007-10-19 Thread zooey
Hi there, I want to make transparent/launcher-like window application using python. (similar as Enso, Launchy, etc. I know Enso written in python.) Is there any open source project like it or any example? Thanks, Aaron. -- View this message in context:

Re: Noob: Loops and the 'else' construct

2007-10-19 Thread Thorsten Kampe
* Gabriel Genellina (Fri, 19 Oct 2007 00:11:18 -0300) En Thu, 18 Oct 2007 23:44:27 -0300, Ixiaus [EMAIL PROTECTED] escribió: I have just come across a site that discusses Python's 'for' and 'while' loops as having an (optional) 'else' structure. At first glance I interpreted it as

Re: problem with Python class creating

2007-10-19 Thread dmitrey
Thanks all for these detailed explanations. On Oct 18, 10:48 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: dmitrey a écrit : Not unless these classes define their own initializers. But that's another problem and there are lots of those ones) class MyClass: def __init__(self):

Please Help !!!

2007-10-19 Thread Heiko Schlierkamp
I need to update the virus program every day with the new dat file from mcafee I would like to us a Bat file to go to the web page and download the dat file automatically to a specific Directory, that I have created, but my problem lays in that the bat file will open the file to be downloaded but

Automatic login to website (newbie)

2007-10-19 Thread Allan Pedersen, Profilm
Did you ever find a solution for this? if so i would like to hear about it... :-) Regards Allan Pedersen, Denmark -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >