RE: change a value to NULL?

2005-10-05 Thread Bell, Kevin
Thanks, being new to this, I wasn't sure if I should use None, Null, Nope, Nada, or Nil! I'm going to be loading a list into an MS Access db. Do you know if I load None into an Access field if Access will recognize that as blank/null? I suppose I'll just go test it out. Thanks again... Kevin

Re: how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread Diez B. Roggisch
> What I *really* want is to keep a collection of all the Spam instances, > and if i try to create a new Spam instance with the same contructor > parameters, then return the existing Spam instance. I thought new-style > classes would do it: > So what is the best/preferred way to do this? Use t

Re: change a value to NULL?

2005-10-05 Thread Brett Hoerner
I'm not sure what you mean, really, do you need an official Python "Null" value? Try None? In [6]: myCells = ['Mary', 'Bob', None, 'Joe'] In [7]: for cell in myCells: ...: if cell: ...: print cell ...: else: ...: print "NULL VALUE" ...: Mary Bob NULL VALUE J

how to keep collection of existing instances and return one on instantiation

2005-10-05 Thread marduk
I couldn't think of a good subject.. Basically, say I have a class class Spam: def __init__(self, x): self.x = x then if I create two instances: a = Spam('foo') b = Spam('foo') a == b # False What I *really* want is to keep a collection of all the Spam instances, and if i try to

Re: Python Newbie

2005-10-05 Thread Matt Feinstein
On 5 Oct 2005 08:38:44 -0700, [EMAIL PROTECTED] wrote: >Hi, > >I'm learning Python now and I'm really pleased with everything so far, >however, at some point I'll want to develop a Windows application (no >other OS at this point). The question are: >1. What toolkit is best for Windows develo

Re: change a value to NULL?

2005-10-05 Thread Laszlo Zsolt Nagy
Bell, Kevin wrote: >I'm pulling a list of numbers from MS Excel, but occasionally if there >is no data from excel, the value is an asterisk, but I need to make it >null. > >What is the best way to do that? Thus far, I'm using: > > >for value in myRange: > try: > intV = int(value

Re: New project coming up...stay with Python, or go with a dot net language??? Your thoughts please!

2005-10-05 Thread Bugs
Another page with up to date IronPython information: http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, spiffo <[EMAIL PROTECTED]> wrote: > . > . >

Re: Call C functions from Python

2005-10-05 Thread Fredrik Lundh
"Java and Swing" wrote: >i dont have a myapp.pyd ...i have myapp.c, or are u suggesting I dump > the dll? if that's what you're trying to import, yes. > or the swig generated python file? > the swig generated python file only has .py and .pyc. huh? if you have a swig-generated python file, why

Python Newbie

2005-10-05 Thread norm
Hi, I'm learning Python now and I'm really pleased with everything so far, however, at some point I'll want to develop a Windows application (no other OS at this point). The question are: 1. What toolkit is best for Windows development? 2. Which toolkits can I exclude from consideration?

Re: Replacing utf-8 characters

2005-10-05 Thread Richard Brodie
"Mike" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > However when I pull it into python the URL ends up looking like this > (notice the & instead of just & in the URL) > > Any ideas? Some code would be helpful: the "&" is in the page source to start with (which is as it ought to

change a value to NULL?

2005-10-05 Thread Bell, Kevin
I'm pulling a list of numbers from MS Excel, but occasionally if there is no data from excel, the value is an asterisk, but I need to make it null. What is the best way to do that? Thus far, I'm using: for value in myRange: try: intV = int(value) print intV

Re: Does python support the expression "a = b | 1"???

2005-10-05 Thread François Pinard
[Wenhua Zhao] > a = b | 1 > a = b if b != nil > else a =1 > Is there such expression in python? Hi. Merely write: a = b or 1 In Python, there is no `nil'. `a' will receive 1 instead of the value of `b' only if `b' is either zero, None, False, or empty in some way. -- François Pinard ht

Re: How to prevent logging warning?

2005-10-05 Thread Neil Benn
Thomas Heller wrote: >>Thomas Heller wrote: >> >> >>>I'm about to add some logging calls to a library I have. How can I >>>prevent that the script that uses the library prints >>>'No handlers could be found for logger "comtypes.client"' when the >>>script runs? >>>I would like to setup the lo

Re: How to create temp file in memory???

2005-10-05 Thread Diez B. Roggisch
Wenhua Zhao wrote: > I have a list of lines. I want to feed these lines into a function. > The input of this function is a file. > I want to creat a temp file on disk, and write the list of lines into > this temp file, then reopen the file and feed it to the function. > Can I create a this temp fi

Re: Does python support the expression "a = b | 1"???

2005-10-05 Thread Diez B. Roggisch
Wenhua Zhao wrote: > a = b | 1 > > a = b if b != nil > else a =1 > > Is there such expression in python? Soon there will be, but currently: no. What you are after is a ternary operator like _?_:_ in C. There have been plenty of discussions about these - search this NG. Depending on your usecas

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
Wenhua Zhao wrote: >I have a list of lines. I want to feed these lines into a function. >The input of this function is a file. >I want to creat a temp file on disk, and write the list of lines into >this temp file, then reopen the file and feed it to the function. >Can I create a this temp file o

Re: Call C functions from Python

2005-10-05 Thread Java and Swing
i dont have a myapp.pyd ...i have myapp.c, or are u suggesting I dump the dll? or the swig generated python file? the swig generated python file only has .py and .pyc. -- http://mail.python.org/mailman/listinfo/python-list

Does python support the expression "a = b | 1"???

2005-10-05 Thread Wenhua Zhao
a = b | 1 a = b if b != nil else a =1 Is there such expression in python? Thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create temp file in memory???

2005-10-05 Thread Wenhua Zhao
I have a list of lines. I want to feed these lines into a function. The input of this function is a file. I want to creat a temp file on disk, and write the list of lines into this temp file, then reopen the file and feed it to the function. Can I create a this temp file on memory??? Jeremy Jon

Re: regarding python and c++ interaction

2005-10-05 Thread Fredrik Lundh
"parul garg" wrote: > i am new to python.i hav to call function of c++ .so file(shared > library)on linux. > any how i am not able to do that. > i had made one zoo.so file.when i import it this gives the following error... > import zoo > Traceback (most recent call last): > File "", line 1,

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Diez B. Roggisch
> This is naive. Testing doesn't guarantee anything. If this is what you > think about testing, then testing gives you a false impression of > security. Maybe we should drop testing. Typechecking is done by a reduced lamda calculus (System F, which is ML-Style), whereas testing has the full power

Re: Call C functions from Python

2005-10-05 Thread Fredrik Lundh
"Java and Swing" wrote: >>> from ctypes import * >>> myapp = cdll.LoadLibrary("c:\\myapp.dll") >>> dumpbin /exports myapp.pyd > > i get, SyntaxError: invalid syntax with it pointing at the first "p" in > myapp.pyd. dumpbin is a command-line utillity, usually included in the compiler toolsuite...

Re: How to create temp file in memory???

2005-10-05 Thread Jeremy Jones
Wenhua Zhao wrote: >A.T.T > >Thanks a lot. > > If you could elaborate a bit more, it might be helpful. I'm guessing you want something like StringIO or cStringIO. - jmj -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create temp file in memory???

2005-10-05 Thread jepler
Here's how: 1. open your web browser 2. visit the url http://docs.python.org 3. click the link "Library Reference" (keep this under your pillow) 4. scan down the list of modules until you see these two items: 4.6 StringIO -- Read and write strings as files 4.7 cStringIO -- Faster v

Re: Call C functions from Python

2005-10-05 Thread Grant Edwards
On 2005-10-05, Java and Swing <[EMAIL PROTECTED]> wrote: > i tried... > >>> from ctypes import * >>> myapp = cdll.LoadLibrary("c:\\myapp.dll") >>> dumpbin /exports myapp.pyd > > i get, SyntaxError: invalid syntax with it pointing at the first "p" in > myapp.pyd. Um, just a guess, but I don't think

How to create temp file in memory???

2005-10-05 Thread Wenhua Zhao
A.T.T Thanks a lot. -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe has a new maintainer

2005-10-05 Thread Bugs
This is great Jimmy and thanks. Py2exe is too handy of a project to let fall into obsolescence. I especially appreciate your willingness to work with other projects in developing synergies between them. Thanks again. Jimmy Retzlaff wrote: > I am taking over the maintenance and support of py2ex

Re: question about output

2005-10-05 Thread utabintarbo
Given that the format is consistent (and the last char is not part of the number you want), you can probably do something like this: x = int('10944800e'[:-1]) Disclaimer: I am a n00b. YMMV ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding python and c++ interaction

2005-10-05 Thread Diez B. Roggisch
> i am new to python.i hav to call function of c++ .so file(shared > library)on linux. > any how i am not able to do that. > i had made one zoo.so file.when i import it this gives the following error... > > import zoo > > Traceback (most recent call last): > File "", line 1, in ? > ImportE

Replacing utf-8 characters

2005-10-05 Thread Mike
Hi, I am using Python to scrape web pages and I do not have problem unless I run into a site that is utf-8. It seems & is changed to & when the site is utf-8. If I try to replace it with .replace('&','&') it for some reason does not replace it. For example: http://today.reuters.co.uk/news/def

Re: question about output

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 07:24:31 -0700, Java and Swing wrote: > i have printed out some numbers and they look like > > 10944800e > 10952560d They don't look like numbers to me. They have letters at the end. What are they? What does the letter mean? > ...if i want to later assign this type of numbe

Re: question about output

2005-10-05 Thread Java and Swing
doh! nevermind, my original output had e and d in it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Call C functions from Python

2005-10-05 Thread Java and Swing
i tried... >> from ctypes import * >> myapp = cdll.LoadLibrary("c:\\myapp.dll") >> dumpbin /exports myapp.pyd i get, SyntaxError: invalid syntax with it pointing at the first "p" in myapp.pyd. -- http://mail.python.org/mailman/listinfo/python-list

question about output

2005-10-05 Thread Java and Swing
i have printed out some numbers and they look like 10944800e 10952560d ...if i want to later assign this type of number to variable how can i do it? for example i can't do... >> x = 10944800e ..since it says "invalid token" on the "e". thanks. -- http://mail.python.org/mailman/listinfo/pyth

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
looks sad :( ok, until the decision not found, i've run my script (if someone have the same problem) using sh-script like this: #!/bin/sh while true do myscript.py echo "scrip was fault" | mail -s "run.sh" [EMAIL PROTECTED] done ... still works ;) Franz Steinhaeusler wrote: > Tamer, thanks

SOAPpy, client, execute method that has 'complex' input parameter (with list)?

2005-10-05 Thread Bartas
Hi, I'am writting a simple SOAP client in python (2.4) using SOAPpy lib. I've met with this problem: when I want to send a list of complex type using some method from WebService(java,WAS), I'v got an exception: ** SOAPpy.Types.faultType: http://www.w3.org/

Re: How to get the output from os.system() into a variable?

2005-10-05 Thread alexLIGO
Hi, thank you very much for your tipps. I get it to work! Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent logging warning?

2005-10-05 Thread Thomas Heller
> Thomas Heller wrote: >> I'm about to add some logging calls to a library I have. How can I >> prevent that the script that uses the library prints >> 'No handlers could be found for logger "comtypes.client"' when the >> script runs? >> I would like to setup the logging so that there is no loggin

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >>> They also relieve a burden from the run-time, since all variables >>> are declared, the runtime doesn't has to check whether or not >>> a variable is accesible, it knows it is. >> Not in a dynamic language. Python lets you delete variables at run >> tim

Re: How to get the output from os.system() into a variable?

2005-10-05 Thread Laszlo Zsolt Nagy
>>result=python_command(' command_on_the_bash ') >> >>Is that possible? And how to do that? >> >> > >Check out the commands module. > >http://docs.python.org/lib/module-commands.html > Hmm, I forgot this one. It is only working from UNIX, am I right? Les -- http://mail.python.org/mailman

Re: How to get the output from os.system() into a variable?

2005-10-05 Thread Laszlo Zsolt Nagy
alexLIGO wrote: >Hi, > >I would like to execute some command in python on the bash, e.g. > >os.system('globus-job-run mike4.cct.lsu.edu/jobmanager-pbs -l >/bin/date') > >and want the result of the output in a vector, so something like: > >result=python_command(' command_on_the_bash ') > >Is that p

Re: how to debug when "Segmentation fault"

2005-10-05 Thread jepler
Interesting. I'd noticed that the metaclass one didn't crash my 2.2, but I didn't check the marshal one. This one core dumps in 'Python 2.2.2 (#1, Feb 24 2003, 19:13:11) ... linux2' but inexplicably prints 'keys' when I ran it on the 2.4.1 I used in my last post. >>> import marshal >>> f = lambd

Re: How to get the output from os.system() into a variable?

2005-10-05 Thread Björn Lindström
"alexLIGO" <[EMAIL PROTECTED]> writes: > I would like to execute some command in python on the bash, e.g. > > os.system('globus-job-run mike4.cct.lsu.edu/jobmanager-pbs -l > /bin/date') > > and want the result of the output in a vector, so something like: > > result=python_command(' command_on_the

How to get the output from os.system() into a variable?

2005-10-05 Thread alexLIGO
Hi, I would like to execute some command in python on the bash, e.g. os.system('globus-job-run mike4.cct.lsu.edu/jobmanager-pbs -l /bin/date') and want the result of the output in a vector, so something like: result=python_command(' command_on_the_bash ') Is that possible? And how to do that?

regarding python and c++ interaction

2005-10-05 Thread parul garg
hi i am new to python.i hav to call function of c++ .so file(shared library)on linux. any how i am not able to do that. i had made one zoo.so file.when i import it this gives the following error... >>> import zoo Traceback (most recent call last): File "", line 1, in ? ImportError: ./zoo.so: und

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Maksim Kasimov
[EMAIL PROTECTED] wrote: > I've rewritten your middle example to be clearer. > $ python2.4 > Python 2.4.1 (#1, May 16 2005, 15:15:14) > [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > type("Y", (type,), {"mro": lambda

Re: bug or feature?

2005-10-05 Thread Steve Holden
Ben Sizer wrote: > Fredrik Lundh wrote: > > >>it's also mentioned in chapter 4 of the tutorial: >> >>http://docs.python.org/tut/node6.html#SECTION00671 >> >> "*Important warning*: The default value is evaluated only once. This >>makes a difference when the default is a

Re: Help with chaos math extensions.

2005-10-05 Thread Fredrik Lundh
Brandon K" wrote: > Here's the Script it was being used in (forgive it if it seems a bit > messy, i have been tinkering with variables and such to try different > ideas and haven't really cleaned it up). the C compiler does in fact provide you with some clues: c:\test\c_lib.cpp(22) : warning C47

Re: While and If messing up my program?

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 06:48:59 +, CJ wrote: > >Hey, I'm new to the Python world, but I do have experience in several > other languages. I've been running through a tutorial, and I decided that > I'd make a program that runs through a list, finds if there are any > duplicates. The progra

Re: bug or feature?

2005-10-05 Thread Steve Holden
beza1e1: > Coming back from a bug hunt, i am not sure what to think of this python > behaviour. Here is a demo program: > > class A: >def __init__(self, lst=[]): > self.lst = lst > > a = A() > b = A() > b.lst.append("hallo") > print a.lst # output: ["hallo"] > > The point seems to be,

10060, Operation timed out Error

2005-10-05 Thread Ajay Abhyankar
Hi, I am trying to upload zip files using ftplib module. The server has Vsftpd 2.0.3 installed on it. I was able to succesfully upload files using ftplib and Vsftpd on the server locally connected. Now, I want to transfer files to remote server using the same script. I am getting the following e

Re: How to prevent logging warning?

2005-10-05 Thread Maksim Kasimov
may be this you will find usefull: def getLog(logName, fileName = None): if fileName: hdl = logging.FileHandler(fileName) else: hdl = logging.StreamHandler() fmt = logging.Formatter("%(name)s:\t%(levelname)s:\t%(asctime)s:\t%(message)s") hdl.setFormatter(f

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Franz Steinhaeusler
On Wed, 05 Oct 2005 14:53:45 +0200, Tamer Fahmy <[EMAIL PROTECTED]> wrote: >On Tue, 04 Oct 2005 19:13:10 +0300, Maksim Kasimov wrote: >> my programm sometime gives "Segmentation fault" message (no matter how >> long the programm had run (1 day or 2 weeks). And there is nothing in >> log-files that

Re: Call C functions from Python

2005-10-05 Thread Fredrik Lundh
Java and Swing wrote: >I used, myApp = CDLL("C:...") ...as I saw it in one of the ctypes > samples. > > Anyhow, I tried... > > myApp = cdll.LoadLibrary("C:\\myapp.dll") > myApp.AddNumbers(1, 4) > > ..I get an error... > > AttributeError: function 'AddNumbers' not found > > ...myapp certainly has A

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Magnus Lycka
Paul Rubin wrote: > So where are the complex templates and dangerous void pointers in ML? You're right about that of course. There aren't any templates or pointers in COBOL either as far as I know, and COBOL has been used for lots of real world code (which ML hasn't). I don't know what your point

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Tamer Fahmy
On Tue, 04 Oct 2005 19:13:10 +0300, Maksim Kasimov wrote: > my programm sometime gives "Segmentation fault" message (no matter how > long the programm had run (1 day or 2 weeks). And there is nothing in > log-files that can points the problem. My question is how it possible to > find out where is t

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: > You'd have to declare any variable global, or declare it local, or it > could be a function name (defined with def) or a function arg (in the > function scope), or maybe you could also declare things like loop > indices. If it wasn't one of the above, the compiler would flag it

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > Aren't you looking for some of compile-time checking that ensures that > only declared variables are actually used? If so, how does global help? You'd have to declare any variable global, or declare it local, or it could be a function name (defined with

Re: bug or feature?

2005-10-05 Thread Ben Sizer
Fredrik Lundh wrote: > it's also mentioned in chapter 4 of the tutorial: > > http://docs.python.org/tut/node6.html#SECTION00671 > > "*Important warning*: The default value is evaluated only once. This > makes a difference when the default is a mutable object such as a

Re: bug or feature?

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 03:39:30 -0700, beza1e1 wrote: > Coming back from a bug hunt, i am not sure what to think of this python > behaviour. [snip code] > The point seems to be, that lst=[] creates a class attribute (correct > name?), which is shared by all instances of A. So a.lst ist the same > o

Re: Confused with module and .py files

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 13:46:30 +0530, Iyer, Prasad C wrote: > > Actually I am bit confused between the modules and .py file > How do I differentiate between the 2. > > For example > I have a file import1.py, import2.py file > > Which has few functions and classes > And if I have a class with same

Re: Python, Mysql, insert NULL

2005-10-05 Thread deelan
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. > None is een object in Python and NULL not. > None is not converted to NULL? > Table shows None and not NULL! None is converted to mysql's NULL and

Re: Python, Mysql, insert NULL

2005-10-05 Thread Steve Holden
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. So you *don't* know how to insert values in a database: as Laszlo wrote, you might be best using parameterized queries. > None is een object in Py

Re: Python, Mysql, insert NULL

2005-10-05 Thread Gerhard Häring
Python_it wrote: > I know how to insert values in a database. > That's not my problem! > My problem is how i insert NULL values in de mysql-database. > None is een object in Python and NULL not. > None is not converted to NULL? > Table shows None and not NULL! As Laszlo wrote, "None will be conver

How to prevent logging warning?

2005-10-05 Thread Thomas Heller
I'm about to add some logging calls to a library I have. How can I prevent that the script that uses the library prints 'No handlers could be found for logger "comtypes.client"' when the script runs? I would like to setup the logging so that there is no logging when nothing is configured, and no

Re: Build spoofed IP packets

2005-10-05 Thread billie
> Yes, give us the error. And know that you can't build raw IP packets > unless you're root. > > Sybren Sorry. I forgot to paste the error: Traceback (most recent call last): File "C:\test\client.py", line 156, in ? send_pkt() File "C:\test\client.py", line 96, in send_pkt s.sendto(i

Re: Help with chaos math extensions.

2005-10-05 Thread Brandon K
Here's the Script it was being used in (forgive it if it seems a bit messy, i have been tinkering with variables and such to try different ideas and haven't really cleaned it up). import ctest import Tkinter import threading hue_map = ("#FF","#FEFEFF","#FDFDFF","#FCFCFF","#FBFBFF","#FAFAF

Re: Call C functions from Python

2005-10-05 Thread Java and Swing
I used, myApp = CDLL("C:...") ...as I saw it in one of the ctypes samples. Anyhow, I tried... myApp = cdll.LoadLibrary("C:\\myapp.dll") myApp.AddNumbers(1, 4) ..I get an error... AttributeError: function 'AddNumbers' not found ...myapp certainly has AddNumbers. Grant Edwards wrote: > On 2005-

Re: While and If messing up my program?

2005-10-05 Thread Steven D'Aprano
On Wed, 05 Oct 2005 00:10:12 -0700, [EMAIL PROTECTED] wrote: > hi, > > to get howmany element list appear you can code: > ttllst=[4,3,45,3] > for x in ttllst: > print x, ttllst.count(x) > pass > > to get non duplicate element list you can code: > ttllst=[4,3,45,3] >

Re: Help with chaos math extensions.

2005-10-05 Thread Fredrik Lundh
Brandon Keown wrote: >I have programmed a fractal generator (Julia Set/Mandelbrot Set) in > python in the past, and have had good success, but it would run so > slowly because of the overhead involved with the calculation. I > recently purchased VS .NET 2003 (Win XP, precomp binary of python

Re: how to debug when "Segmentation fault"

2005-10-05 Thread Pierre Barbier de Reuille
Maksim Kasimov a écrit : > > yes, to generete core dump is the best way, > > but the command "$ ulimit -c 50" don't make python to generete core > dump in the time of crush. > > I would like to know how to run python script so if it crushes than core > dump will be genereted. > > Thanks >

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread bruno modulix
Mike Meyer wrote: (snip) > Antoon, at a guess I'd say that Python is the first time you've > encountered a dynamnic language. Being "horrified" at not having > variable declarations, Mike, "being horrified" by the (perceived as...) lack of variable declaration was the OP's reaction, not Antoon's.

Re: bug or feature?

2005-10-05 Thread beza1e1
Thanks for you answer! This copy trick is the most elegant solution i think. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with chaos math extensions.

2005-10-05 Thread Brandon K
In case you missed it, I said I have windows XP. Windows XP pre-compiled python binaries are built on VS .NET 2003. In order to build extensions, you need the compiler the interpreter was built on, or at least that is what is reported to me by calling setup.py. If I was using linux, which I

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Brian Quinlan
Paul Rubin wrote: >>Which is evaluated at runtime, does not require that the actual global >>variable be pre-existing, and does not create the global variable if >>not actually assigned. I think that is pretty different than your >>proposal semantics. > > > Different how? Aren't you looking for

Re: Python, Mysql, insert NULL

2005-10-05 Thread Python_it
I know how to insert values in a database. That's not my problem! My problem is how i insert NULL values in de mysql-database. None is een object in Python and NULL not. None is not converted to NULL? Table shows None and not NULL! -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Duncan Booth
Antoon Pardon wrote: > As far as I understand people don't like global very much so I don't > expect that a second keyword with the same kind of behaviour has > any chance. That's why the behaviour I suggest is different than the current behaviour of global. Arguments against global (it is the on

Re: bug or feature?

2005-10-05 Thread Fredrik Lundh
Steve Holden wrote: > Interestingly I couldn't find this in the FAQ, though it *is* a > frequently-asked question [note: my not finding it doesn't guarantee > it's not there]. it's there: http://www.python.org/doc/faq/general.html#why-are-default-values-shared-between-objects (maybe "defau

RE: Confused with module and .py files

2005-10-05 Thread Iyer, Prasad C
Sorry guys for that .py in import. It was typing mistake. Extremely sorry regards prasad chandrasekaran --- Cancer cures smoking #-Original Message- #From: Steve Holden [mailto:[EMAIL PROTECTED] #Sent: Wednesday, October 05, 2005 2:43 PM #To: python-list@python.org #Subject: R

Re: Python, Mysql, insert NULL

2005-10-05 Thread Laszlo Zsolt Nagy
> > BTW, you did not write which driver are you using. Oh, you did. Sorry. :-( Import your DB module 'yourmodule' and then print yourmodule.paramstyle Description of paramstyle is also in PEP249: paramstyle String constant stating the type of parameter marker

Python, Mysql, insert NULL

2005-10-05 Thread Python_it
Python 2.4 MySQL-python.exe-1.2.0.win32-py2.4.zip How can I insert a NULL value in a table (MySQL-database). I can't set a var to NULL? Or is there a other possibility? My var must be variable string or NULL. Becaus i have a if statement: if cursor.execute(".insert NULL

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Ron Adam
Antoon Pardon wrote: > Op 2005-10-04, Ron Adam schreef <[EMAIL PROTECTED]>: > >>Antoon Pardon wrote: >> >>>Op 2005-10-03, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >>> And lo, one multi-billion dollar Mars lander starts braking either too early or too late. Result: a new crater on Mars,

Re: Python, Mysql, insert NULL

2005-10-05 Thread Laszlo Zsolt Nagy
Python_it wrote: >Python 2.4 >MySQL-python.exe-1.2.0.win32-py2.4.zip > >How can I insert a NULL value in a table (MySQL-database). >I can't set a var to NULL? Or is there a other possibility? >My var must be variable string or NULL. >Becaus i have a if statement: >if > cursor.execute("..

Re: bug or feature?

2005-10-05 Thread Steve Holden
beza1e1 wrote: > Coming back from a bug hunt, i am not sure what to think of this python > behaviour. Here is a demo program: > > class A: >def __init__(self, lst=[]): > self.lst = lst > > a = A() > b = A() > b.lst.append("hallo") > print a.lst # output: ["hallo"] > > The point seems t

Re: bug or feature?

2005-10-05 Thread Simon Percivall
Python.org General FAQ 1.4.21: Why are default values shared between objects? (http://www.python.org/doc/faq/general.html#why-are-default-values-shared-between-objects) -- http://mail.python.org/mailman/listinfo/python-list

Re: bug or feature?

2005-10-05 Thread Tomasz Lisowski
beza1e1 wrote: > Coming back from a bug hunt, i am not sure what to think of this python > behaviour. Here is a demo program: > > class A: >def __init__(self, lst=[]): > self.lst = lst > > a = A() > b = A() > b.lst.append("hallo") > print a.lst # output: ["hallo"] > > The point seems t

Re: dictionary interface

2005-10-05 Thread Steve Holden
Antoon Pardon wrote: > Op 2005-10-05, Steve Holden schreef <[EMAIL PROTECTED]>: [...] > > Anyway, I have searched the source of the test for all testing > with regards to < and after some browsing back and fore it seems > it all boils down to the following two tests. > >self.assert_(not {} <

Re: bug or feature?

2005-10-05 Thread skip
beza1e1> class A: beza1e1>def __init__(self, lst=[]): beza1e1> self.lst = lst Lists are mutable and default args are only evaluated once, at function definition. If you want independent default args use: class A: def __init__(self, lst=None): if lst

Re: python plotting with greek symbols within labels recommendations?

2005-10-05 Thread wobsta
Hi, [EMAIL PROTECTED] wrote: > this message is geared toward those of you in the scientific community. > i'm looking for a python plotting library that can support rendering > greek symbols and other various characters on plot axes labels, etc. I > would prefer something that adheres to tex format

bug or feature?

2005-10-05 Thread beza1e1
Coming back from a bug hunt, i am not sure what to think of this python behaviour. Here is a demo program: class A: def __init__(self, lst=[]): self.lst = lst a = A() b = A() b.lst.append("hallo") print a.lst # output: ["hallo"] The point seems to be, that lst=[] creates a class attribu

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > "10001234" -> ""10.001.234"" > So I need thousand separators. > Can anyone helps me with a simply solution (like %xxx) ? I think you're supposed to do a locale-specific conversion (I've never understood that stuff). You could also do something lik

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi ! > > I need to convert some integer values. > > "1622" ->"1 622" > > or > > "10001234" -> ""10.001.234"" > > So I need thousand separators. > > Can anyone helps me with a simply solution (like %xxx) ? The module locale does what you need, look at ist docs, espe

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Satchidanand Haridas
One possible solution. Don't know how efficient it is though. :-) >>> def put_decimal(s): ... return ''.join( [ [s[i], '.%s' % s[i]][(len(s)-i)%3 == 0] for i in range(0, len(s))]) ... >>> put_decimal("10001234") '10.001.234' >>> put_decimal("12622") '12.622' thanks, Satchit [EMAIL PROTE

Quick help needed: how to format an integer ?

2005-10-05 Thread [EMAIL PROTECTED]
Hi ! I need to convert some integer values. "1622" ->"1 622" or "10001234" -> ""10.001.234"" So I need thousand separators. Can anyone helps me with a simply solution (like %xxx) ? Thanx for it: dd Ps: Now I use this proc: def toths(i): s=str(i) l=[] ls=len(s) for i in rang

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Antoon Pardon
Op 2005-10-05, Duncan Booth schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >> It also is one possibility to implement writable closures. >> >> One could for instace have a 'declare' have the effect that >> if on a more inner scope such a declared variable is (re)bound it >> will rebind the

Re: dictionary interface

2005-10-05 Thread Antoon Pardon
Op 2005-10-05, Steve Holden schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >> >> I have been searching some more and finally stumbled on this: >> >> http://docs.python.org/ref/comparisons.html >> >> Mappings (dictionaries) compare equal if and only if their sorted >> (key, value) lists

Re: Help needed in OOP-Python

2005-10-05 Thread Toufeeq Hussain
Thanks Fredrik. Went through the code to make sure "self" was used properly and one of the parent classes was missing a "self".It's fixed now. /me kicks self -toufeeqOn 10/5/05, Toufeeq Hussain <[EMAIL PROTECTED]> wrote: Fredrik, sigh! I see the problem you mention and I agree. Should have post

sos too long penis

2005-10-05 Thread by9tusa
I had in the past the most ridiculous erection in the world,4in.I'm not poor and then,I used all the supposed "miraculous products" to rectify.Vainly.Until one of my friends,who experimented it himself,advise me to use an african grass,in the way of tea.As long as I haven't obtain the desired size.

Re: Excel library with unicode support

2005-10-05 Thread Richie Hindle
[Mike] > Is there a python library, that is able to create Excel files with > unicode characters. pyExcelerator claims to do this, but I've never used it. http://sourceforge.net/projects/pyexcelerator/ -- Richie Hindle [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Steve Holden
Brian Quinlan wrote: > Paul Rubin wrote: > >>Brian Quinlan <[EMAIL PROTECTED]> writes: >> >> >>>Have those of you who think that the lack of required declarations in >>>Python is a huge weakness given any thought to the impact that adding >>>them would have on the rest of the language? I can't ima

<    1   2   3   >