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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

updating local()

2005-10-05 Thread Flavio
Hi, I heard time and again that you are not _supposed_ to update the locals dictionary. Can anyone tell me why, if the following code works, I should not do this? # # Extending Local namespace # def fun(a=1,b=2,**args): print 'locals:',locals() locals().update(args) pr

Posix return or exit

2005-10-05 Thread M.N.A.Smadi
hi; my script must return codes which are based on the POSIX spec of returning a positive value. A work perl version of my code uses exit(code_num). I am not sure if the equivilant in python is also: exit(code_num) or return code_num any ideas? thanks moe smadi -- http://mail.python

Re: change a value to NULL?

2005-10-05 Thread Steve Holden
Brett Hoerner wrote: > 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 "

Re: updating local()

2005-10-05 Thread Steve Holden
Flavio wrote: > Hi, > > I heard time and again that you are not _supposed_ to update the > locals dictionary. > > Can anyone tell me why, if the following code works, I should not do > this? > > # > # Extending Local namespace > # > > def fun(a=1,b=2,**args): > > print 'locals:',locals(

RE: change a value to NULL?

2005-10-05 Thread Bell, Kevin
Just tested it. Access does recognize None as null/blank/etc when None is passed in from python. Kevin Bell -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bell, Kevin Sent: Wednesday, October 05, 2005 10:33 AM To: python-list@python.org Subject: RE: c

Re: updating local()

2005-10-05 Thread Sybren Stuvel
Flavio enlightened us with: > Can anyone tell me why, if the following code works, I should not do > this? > > def fun(a=1,b=2,**args): > > print 'locals:',locals() > locals().update(args) > print locals() Because it's very, very, very insecure. What would happen if someone found

Re: updating local()

2005-10-05 Thread Fredrik Lundh
"Flavio" <[EMAIL PROTECTED]> wrote: > Can anyone tell me why, if the following code works, I should not do > this? because it doesn't work: # # Extending Local namespace, now with Local namespace # def fun(a=1,b=2,**args): k="K" v="V" print 'locals:',locals() locals().update(arg

Re: Posix return or exit

2005-10-05 Thread Sybren Stuvel
M.N.A.Smadi enlightened us with: > my script must return codes which are based on the POSIX spec of > returning a positive value. A work perl version of my code uses > exit(code_num). Use sys.exit(code_num). Sybren -- The problem with the world is stupidity. Not saying there should be a capita

Re: updating local()

2005-10-05 Thread Duncan Booth
Flavio wrote: > Can anyone tell me why, if the following code works, I should not do > this? > > # > # Extending Local namespace > # > > def fun(a=1,b=2,**args): > > print 'locals:',locals() > locals().update(args) > print locals() > > e = {'s':3,'e':4} > fun(k=10,v=32,**e) > Be

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

2005-10-05 Thread Jonathan LaCour
> class Spam(object): > cache = {} > def __new__(cls, x): > if cls.cache.has_key(x): > return cls.cache[x] > def __init__(self, x): > self.x = x > self.cache[x] = self > > a = Spam('foo') > b = Spam('foo') > > Well, in this case a and b are identical.

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

2005-10-05 Thread Peter Otten
marduk wrote: > 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: > > class Spam(object): > cache = {}

Re: How to prevent logging warning?

2005-10-05 Thread Trent Mick
[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 logging w

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

2005-10-05 Thread marduk
On Wed, 2005-10-05 at 12:56 -0400, Jonathan LaCour wrote: > Oops, you forgot to return object.__new__(cls, x) in the case the > object isn't in the cache. That should fix it. Ahh, that did it. I didn't even think of calling object... so the new class looks like: class Spam(object): cach

Re: Python Newbie

2005-10-05 Thread UrsusMaximus
I like wxPython, which also can be improved (made more Pythonic) by using Hans Nowak's Wax http://www.zephyrfalcon.org/labs/wax.html and also has a great visual framework in PythonCard. You might check out my links to many Python gui toolkits and related resources at http://www.awaretek.com/plf.ht

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

2005-10-05 Thread marduk
On Wed, 2005-10-05 at 18:28 +0200, Diez B. Roggisch wrote: > Use the BORG-pattern. See > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 > > Together with your caching, that should do the trick. > I looked at the Borg Pattern, but I don't think it was exactly what I want. Th

Re: updating local()

2005-10-05 Thread Jp Calderone
On Wed, 5 Oct 2005 18:47:06 +0200, Sybren Stuvel <[EMAIL PROTECTED]> wrote: >Flavio enlightened us with: >> Can anyone tell me why, if the following code works, I should not do >> this? >> >> def fun(a=1,b=2,**args): >> >> print 'locals:',locals() >> locals().update(args) >> print

Re: How to prevent logging warning?

2005-10-05 Thread Peter Otten
Thomas Heller wrote: > I want the script by default to be agnostic about the libraries > logging.  When I want to see the log messages, I can always do > > logging.basicConfig() > > in the script to see the log messages. > > I get the behaviour that I want when I add a 'NULL' handler in the > l

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

2005-10-05 Thread marduk
On Wed, 2005-10-05 at 12:56 -0400, Jonathan LaCour wrote: > > class Spam(object): > > cache = {} > > def __new__(cls, x): > > if cls.cache.has_key(x): > > return cls.cache[x] > > def __init__(self, x): > > self.x = x > > self.cache[x] = self > > > > a

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

2005-10-05 Thread Peter Otten
marduk wrote: > On Wed, 2005-10-05 at 12:56 -0400, Jonathan LaCour wrote: >> > class Spam(object): >> > cache = {} >> > def __new__(cls, x): >> > if cls.cache.has_key(x): >> > return cls.cache[x] >> > def __init__(self, x): >> > self.x = x >> > self.

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

2005-10-05 Thread Laszlo Zsolt Nagy
>I've removed all references to the object, except for the cache. Do I >have to implement my own garbage collecting is or there some "magical" >way of doing this within Python? I pretty much want to get rid of the >cache as soon as there are no other references (other than the cache). > Store we

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

2005-10-05 Thread Fredrik Lundh
"marduk" wrote: > Do I have to implement my own garbage collecting is or there some "magical" > way of doing this within Python? http://docs.python.org/lib/module-weakref.html -- http://mail.python.org/mailman/listinfo/python-list

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

2005-10-05 Thread Diez B. Roggisch
> > I looked at the Borg Pattern, but I don't think it was exactly what I > want. > > The Borg patten appears to be if you want multiple instances that point > to the same "data". > > What I wanted is multiple calls to create a new object with the same > parameters points to the "original" objec

Extending Python

2005-10-05 Thread Tuvas
I am looking for a good tutorial on how to extend python with C code. I have an application built in C that I need to be able to use in Python. I have searched through various sources, starting of course with the Python site itself, and others, but I felt a bit lacking from the Python site, it seem

Re: Extending Python

2005-10-05 Thread Micah Elliott
On Oct 05, Tuvas wrote: > I am looking for a good tutorial on how to extend python with C > code. I have an application built in C that I need to be able to use > in Python. I have searched through various sources, starting of > course with the Python site itself, and others, but I felt a bit > lac

Antsoft Best domain software

2005-10-05 Thread Vasilisa
Find expired domains with the best software: http://www.antssoft.com The best domain names are already taken. But with expired domain software you can find the best domain names like: http://www.beyx.com http://www.c6d.de http://www.fyq.us http://www.gv0.net ht

Re: Extending Python

2005-10-05 Thread Fredrik Lundh
"Tuvas" wrote: >I am looking for a good tutorial on how to extend python with C code. I > have an application built in C that I need to be able to use in Python. http://docs.python.org/ext/ext.html -- http://mail.python.org/mailman/listinfo/python-list

Re: updating local()

2005-10-05 Thread jepler
I'm surprised you found any example of 'locals().update' that worked. Here's one that doesn't work: def f(y): locals().update({'x': y}) return x print f(3) # prints 3? Jeff pgpLVe48NBWmT.pgp Description: PGP signature -- http://mail.python.org/mailm

Class methods

2005-10-05 Thread Hughes, Chad O
Title: Class methods Is there any way to create a class method?  I can create a class variable like this: class Foo:   classVariable = None   def __init__(self, classVariable):     Foo.classVariable = classVariable A = Foo('a') B = Foo('b') Print 'The class variable for A is "%s" a

Re: MS Word mail merge automation

2005-10-05 Thread Steve M
I was finally able to get things working right, so I thought I'd stick an example here for posterity. """An example of a MS Word mail merge using the COM interface. In order for this script to work you must first run the COM Makepy utility and select "Microsoft Word 10.0 Object Library (8.2)" or w

Re: Class methods

2005-10-05 Thread Laszlo Zsolt Nagy
Hughes, Chad O wrote: > Is there any way to create a class method? I can create a class > variable like this: > ... > Any ideas? > Oh man, it has been a long time I have read such an disturbing question. RTMF here: http://docs.python.org/lib/built-in-funcs.html#l2h-14 Les -- http://mail

Re: Class methods

2005-10-05 Thread Laszlo Zsolt Nagy
>> >> >Oh man, it has been a long time I have read such an disturbing question. > >RTMF here: http://docs.python.org/lib/built-in-funcs.html#l2h-14 > > I feel I was a bit harsh. class A(object): x = 0 @classmethod def f(cls): cls.x += 1 print "x is",cls.x >>> A.

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
For example this is what I am trying to do that is not working. The contents of link is the reuters web page, containing "/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml" link = link.replace('&','&') But if I now view the the

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

2005-10-05 Thread Paul Rubin
Wenhua Zhao <[EMAIL PROTECTED]> writes: > Is there such expression in python? Not in the current version but one is being added. -- http://mail.python.org/mailman/listinfo/python-list

[ANN] PyXMPP build for Python 2.3 for Win32

2005-10-05 Thread Jarek Zgoda
Unofficial binary installer for Pytnon 2.3 of latest SVN snapshot of PyXMPP is available for download at http://pywarriors.haa.pl/varia.php#pyxmpp_win32 (the page is in Polish, but clicking in HTML link is language-independent). It was build with MinGW against libxml2-2.6.20. To get more informat

Re: Class methods

2005-10-05 Thread Fredrik Lundh
Class methods"Hughes, Chad O" wrote: > Is there any way to create a class method? somewhat ironically, the first google hit for that sentence is a chapter in the python tutorial that *doesn't* explain how to create class methods... as others have pointed out, the classmethod wrapper/descriptor i

Re: Replacing utf-8 characters

2005-10-05 Thread Steve Holden
Unknown wrote: > For example this is what I am trying to do that is not working. > > The contents of link is the reuters web page, containing > > "/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml" > > link = link.replace('&','&'

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

2005-10-05 Thread Grant Edwards
On 2005-10-05, Wenhua Zhao <[EMAIL PROTECTED]> wrote: > a = b | 1 Yes, Python supports that expression. > a = b if b != nil > else a =1 But that's not what it means. > Is there such expression in python? >>> b=0 >>> b = 0 >>> a = b | 1 >>> a 1 >>> b = 1 >>> a = b | 1 >>> a 1 >>> b = 2 >>> a =

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
Steve Holden wrote: >>> > You must be doing *something* wrong: > > >>> link = > "/news/newsArticle.aspx?type=businessNews&storyID=2005-10-05T151245Z_01_HO548006_RTRUKOC_0_UK-AIRLINES-BA.xml" > > > >>> link = link.replace('&','&') > >>> link > '/news/newsArticle.aspx?type=businessNe

Swig and pointers

2005-10-05 Thread Java and Swing
I've tried sending a email to the swig mailing list 3 times...but it never seems to get it...not sure what is going on, still looking into it. Until then... I now have a C function such as... int doIt(char *a, MY_DIGIT **digit) { ... } so I am trying to figure out how to pass in that "digit"

Re: Class methods

2005-10-05 Thread Gerrit Holl
Laszlo Zsolt Nagy wrote: > >Oh man, it has been a long time I have read such an disturbing question. > > > >RTMF here: http://docs.python.org/lib/built-in-funcs.html#l2h-14 > > > > > I feel I was a bit harsh. Of course, those posts do keep the Google count for the famous four-letter-abbreviatio

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

2005-10-05 Thread marduk
On Wed, 2005-10-05 at 19:37 +0200, Diez B. Roggisch wrote: > > What I wanted is multiple calls to create a new object with the same > > parameters points to the "original" object instead of creating a new > > one. > > Read the comments. What you say is essentially the same - the data > matters, a

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

2005-10-05 Thread marduk
On Wed, 2005-10-05 at 19:24 +0200, Peter Otten wrote: > Use a weakref.WeakValueDictionary as the cache instead of a normal > dict. > > Peter Thanks for the reference to the weakref module. Until now I've never had a use for it, but it sounds like what I'm looking for. -m -- http://mail.pytho

Re: Replacing utf-8 characters

2005-10-05 Thread Klaus Alexander Seistrup
Mike wrote: > 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. > > [...] > Any ideas? How about using the universal feedparser from feedparser.org to fetch and parse the RS

Re: Python, Mysql, insert NULL

2005-10-05 Thread Thomas Bartkus
"Python_it" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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 No

Re: epydoc, variables and encoding

2005-10-05 Thread Kenneth Pronovici
> I found a "problem" on epydoc. If I specify an encoding, epydoc not find > my global variables, and if I remove it, it work well. > > code.py: > > #!/usr/bin/env python > # -*- coding: utf-8 -*- > > MY_VAR = None > > class foo(object): > def __init__(self, foo):

Java pretty formatter

2005-10-05 Thread Kalle Anke
Does a Java "pretty formatter" exist? I would like to use a Python based web building tool but would like to pretty format Java code (for example adding color to keywords, etc). I haven't managed to find one but have probably been looking in the wrong places. -- http://mail.python.org/mailma

What documentation "standard" to use

2005-10-05 Thread Kalle Anke
I'm confused of how I should document my code, I've always liked being able to document my code directly in my source file and then to use some tool to extract the documentation to some other format. My problem with Python is that there are so many tools and formats ... I don't know which one I

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

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > OK. The Python compiler would check that the name is declared but it > would not check that it is defined before use? So this would be > acceptable: > > def foo(): > local x > return x Come on, you are asking silly questions. Any reasonable C

Using command line args on Windows

2005-10-05 Thread k8
Hello- I'm stuck on a Windows machine today and would love to fully play with and test a simple python script. I want to be able to type "python myscript myarg" somewhere. Is there anything out there to help me? My main concern is playing with the myarg in the sys.argv list. I've been mucking

RE: Using command line args on Windows

2005-10-05 Thread Michael . Coll-Barth
I'll assume that you are not familiar with Windows, so forgive me if you know this. 1) Go to a command prompt. The location of this depends on which OS you are running. But, you can go to Start / Run... and type in cmd or command. This will give you a window with a 'DOS' prompt. 2) Type pat

Re: Using command line args on Windows

2005-10-05 Thread Larry Bates
1) Start a command prompt window (Start-Programs-Accessories-Command Prompt) 2) Change to directory where the python program is stored (cd \) 3) Type python myscript.py myarg -Larry Bates k8 wrote: > Hello- > > I'm stuck on a Windows machine today and would love to fully play with > and t

Re: check html file size

2005-10-05 Thread Richard Gration
On Tue, 04 Oct 2005 17:44:02 -0700, Xah Lee wrote: > would anyone like to translate the following perl script to Python or > Scheme (scsh)? Are you fucking seriously fucking expecting some fucking moron to translate your tech geeking fucking code moronicity? Fucking try writing it fucking properl

Re: Replacing utf-8 characters

2005-10-05 Thread Mike
In playing with this I found link.replace does work but when I use link.replace('&','&') it replaces it with & instead of just &. link.replace is working for me since if I changed the second option from & to something else I see the change. So it seems link.replace() function reads whether th

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

2005-10-05 Thread Diez B. Roggisch
>>Read the comments. What you say is essentially the same - the data >>matters, after all. What do you care if there are several instances >>around? >> > In my case it matters more that the objects are the same. > > For example I want set([Spam(1), Spam(2), > Spam(3)]).intersect(set([Spam(1), Sp

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

2005-10-05 Thread Diez B. Roggisch
Diez B. Roggisch wrote: > >>> Read the comments. What you say is essentially the same - the data >>> matters, after all. What do you care if there are several instances >>> around? >>> >> In my case it matters more that the objects are the same. >> >> For example I want set([Spam(1), Spam(2), >>

Re: What documentation "standard" to use

2005-10-05 Thread Micah Elliott
On Oct 05, Kalle Anke wrote: > I'm confused of how I should document my code, I've always liked being > able to document my code directly in my source file and then to use > some tool to extract the documentation to some other format. > My problem with Python is that there are so many tools and fo

Re: Python Newbie

2005-10-05 Thread James
1. What toolkit is best for Windows development? "Best" depends on your needs. wxPython seems to be the most popular one. 2. Which toolkits can I exclude from consideration? You haven't given enough exclusion criteria. But here are the possible issues to consider. Fox - Hasn't been updated with

Re: Using command line args on Windows

2005-10-05 Thread Diez B. Roggisch
k8 wrote: > Hello- > > I'm stuck on a Windows machine today and would love to fully play with > and test a simple python script. I want to be able to type "python > myscript myarg" somewhere. Is there anything out there to help me? My > main concern is playing with the myarg in the sys.argv lis

<    1   2   3   >