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

2007-10-19 Thread Diez B. Roggisch
Sean DiZazzo schrieb: > 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 s

Re: class vs type

2007-10-19 Thread Stargaming
On Fri, 19 Oct 2007 12:21:25 -0400, Colin J. Williams wrote: > 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 use

Re: __main__ : What is this?

2007-10-19 Thread Matt McCredie
> 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 be

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

2007-10-19 Thread Stargaming
On Fri, 19 Oct 2007 17:37:29 -0500, Robert Dailey wrote: > 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 invo

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

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 18:38:06 +0200, stef mientki wrote: > I don't have pointers, I've just names (at least I think). Let me > explain a little bit more, > I want to simulate / debug a user program, the user program might look > like this: > >x = 5 >for i in xrange(10): >x = x + 1

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 i

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: __main__ : What is this?

2007-10-19 Thread Steven D'Aprano
On Sat, 20 Oct 2007 00:26:22 +, Matimus wrote: > The common pattern: > > if __name__ == "__main__": > # do stuff > > IMHO better written: > > if "__main__" == __name__: > # do stuff Apart from looking weird, what's the difference? -- Steven. -- http://mail.python.org/mailman/list

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 idoli

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 embed

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: __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 daily.

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

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 nati

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 :) -Basilis

Re: where do I need to "tab"?

2007-10-19 Thread Scott David Daniels
[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 current (2.5.1) Python. > a = 3 > b = a + 1 Fine in all > print a + b + (a * b) Fine i

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: 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, passi

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

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 d

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

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: 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

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: 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

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 requi

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

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]>

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. -- http://mail.python.org/mailman/

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 exi

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 -- http://mail

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 terribl

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

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

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: 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 -- Th

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,

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 a

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 wo

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: 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 D

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

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, whe

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, y

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 i

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

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

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: 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/ -- http://mail.pyt

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

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

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, a

Re: Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread Paul Hankin
On Oct 19, 7:26 pm, xkenneth <[EMAIL PROTECTED]> wrote: >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 thoug

Organizing Sequential Data (TimeStamps) Overthinking?

2007-10-19 Thread xkenneth
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 overthinking the problem

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: Unless you do

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

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

2007-10-19 Thread Paul Hankin
On Oct 19, 5:38 pm, stef mientki <[EMAIL PROTECTED]> wrote: > ... snip hand-coded debugger > I couldn't come up with a better solution ;-) Does pdb not suffice? Even if it doesn't; you can look up variables without using exec, using locals()['x'] or globals()['x'] -- Paul Hankin -- http://mail

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 obje

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

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 Py

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) > > nam

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. > > >

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, class

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 except

Re: vote for Python - PLEASE

2007-10-19 Thread Steven Bethard
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 agree with others that voting here if you don't use MySQL is *not* a good idea. That said, I still ap

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

Re: documenting excepetions in Python

2007-10-19 Thread kyosohma
On Oct 19, 10:32 am, [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. > > Thanks in advance for your help. Read the source, run unit tests, etc. If y

documenting excepetions in Python

2007-10-19 Thread dale_bertrand
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. Thanks in advance for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic invoke

2007-10-19 Thread Sushant
I did not know about getattr and it is the right thing. getattr seems to be converting string into function pointer and I am just saying that string cannot be used as a function pointer in Python as may be in PHP. I copied the PHP code so I did not replace arrow with dot. Good point :) -Sush

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... I

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 crea

Re: write whitespace/tab to a text file

2007-10-19 Thread Bjoern Schliessmann
dirkheld wrote: > f=open('/User/home/Documents/programming/python/test.txt','w') > for x in range(len(names)): > f.write(tags[x]) > f.close() Definitely consider the Python tutorial. Also, please provide working code examples. I don't think yours will work ;) names = ['John','St

Re: Please Help !!!

2007-10-19 Thread Johannes Findeisen
Hello Heiko, On Wed, 2007-10-17 at 11:32 +0200, Heiko Schlierkamp 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: dynamic invoke

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 10:29:12 -0400, Sushant wrote: > Python will not allow string to be used a function pointer. It is type > unsafe. Best way is to convert string into function pointers manually. > > if dynamicMethod == 'bar': > method = oFoo->bar > else: > method = oFoo->default > metho

Re: dynamic invoke

2007-10-19 Thread Steven D'Aprano
On Fri, 19 Oct 2007 11:34:39 +, Nils wrote: > Use apply(): > http://docs.python.org/lib/non-essential-built-in-funcs.html No, don't use apply. Not only does it not solve the original poster's problem, it is a deprecated function. You shouldn't use it in new code. -- Steven. -- http://

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) > > n

Re: dynamic invoke

2007-10-19 Thread Diez B. Roggisch
Sushant wrote: > Python will not allow string to be used a function pointer. It is type > unsafe. Best way is to convert string into function pointers manually. > > if dynamicMethod == 'bar': > method = oFoo->bar > else: > method = oFoo->default > method() Sorry to say so, but that answe

Re: write whitespace/tab to a text file

2007-10-19 Thread Tim Chase
> 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

Re: vote for Python - PLEASE

2007-10-19 Thread Luis Zarrabeitia
On Thursday 18 October 2007 22:59, [EMAIL PROTECTED] wrote: > > but > > I'd rather that people got the message that they should do more python > > development work!) > > Maybe the Python community doesn't need your help. He did try to help, in a morally questionable way, but still in good faith (I

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

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 %{

Re: Please Help !!!

2007-10-19 Thread marc wyburn
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, that I have cre

Re: Noob questions about Python

2007-10-19 Thread Grant Edwards
On 2007-10-19, Hendrik van Rooyen <[EMAIL PROTECTED]> wrote: > "Arnaud Delobelle" 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. >

Re: dynamic invoke

2007-10-19 Thread Sushant
Python will not allow string to be used a function pointer. It is type unsafe. Best way is to convert string into function pointers manually. if dynamicMethod == 'bar': method = oFoo->bar else: method = oFoo->default method() On Friday 19 October 2007 7:56 am, Diez B. Roggisch wrote: > 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

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: 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 = '' >> lin

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

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? C

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 -- http://mail.python.org/mailman/listi

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 > t

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

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. >

  1   2   >