Re: nntplib: abstraction of threads

2005-01-17 Thread Rakesh
Steve Holden wrote: Werner Amann wrote: Rakesh schrieb: What I want is to *group the messages belonging to each thread* . Hello Why not sort with Message-ID and References? Attention - it is a Newbie-Solution. import nntplib hamster = nntplib.NNTP('127.0.0.1', 119,

how to print unicode structures?

2005-01-17 Thread Timothy Babytch
Imagine you have some list that looks like ('unicode', 'not-acii', 'russian') and contains characters not from acsii. or list of dicts, or dict of dicts. how can I print it? not on by one, with for - but with just a simple print? My debugging would be MUCH simpler. Now when I try print or

Re: why are some types immutable?

2005-01-17 Thread Fredrik Lundh
Roy Smith wrote: But, in a nutshell, the biggest reason for immutable types (tuples and strings) is that this lets they be dictionary keys. if you think that's the biggest reason, you haven't spent enough time working on high-performance Python code and extensions (there's a reason why some

Re: (objects as) mutable dictionary keys

2005-01-17 Thread Antoon Pardon
Op 2005-01-14, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-01-14, Peter Maas schreef [EMAIL PROTECTED]: I have summarized the discussion about the usability of lists (and and other mutable types) as dictionary keys and put it into the Python wiki.URL:

Re: from __future__ import decorators

2005-01-17 Thread Jacek Generowicz
Tim Roberts [EMAIL PROTECTED] writes: Jacek Generowicz [EMAIL PROTECTED] wrote: I have some code, which makes copious use of the @decorator syntax I'm very curious to know what kind of application you are writing in which copious use of the @decorator syntax actually solved a problem

Re: how to print unicode structures?

2005-01-17 Thread Serge Orlov
Timothy Babytch wrote: Imagine you have some list that looks like ('unicode', 'not-acii', 'russian') and contains characters not from acsii. or list of dicts, or dict of dicts. how can I print it? not on by one, with for - but with just a simple print? My debugging would be MUCH simpler. I

Re: what would you like to see in a 2nd edition Nutshell?

2005-01-17 Thread Steven Chan
I completely agree. I'm also waiting for an advanced Python/project management book that helps folks out with large-scale projects. And, for the 2nd edition, may I suggest: - coverage of OptionParser module, which is more advanced than the getopt module that you discuss on page 141. - better Mac

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Fredrik Lundh
Ala Qumsieh wrote: © my $n= @_[0]; Do you ever test your code before making fun of yourself in front of millions? this perl usability study is getting more and more interesting. who needs television? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda

2005-01-17 Thread Antoon Pardon
Op 2005-01-14, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-01-13, hanz schreef [EMAIL PROTECTED]: Antoon Pardon wrote: So if I have a call with an expression that takes more than one line, I should assign the expression to a variable and use the variable in the call?

Re: Executing a script created by the end user

2005-01-17 Thread Nick Coghlan
Craig Howard wrote: I am working on a python project where an object will have a script that can be edited by the end user: object.script If the script is a simple one with no functions, I can easily execute it using: exec object.script Take a look at the execfile builtin. But if the object

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJ
Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered by vmstat) to push the data to

Re: OCAMl a more natural extension language for python?

2005-01-17 Thread Duncan Booth
Jelle Feringa // EZCT / Paris wrote: After reading about extending python with C/Fortran in the excellent Python Scripting for Computational Science book by Hans Langtangen, I'm wondering whether there's not a more pythonic way of extending python. And frankly I think there is: OCAML There

getting a class attribute using a keyword argument

2005-01-17 Thread Guy Robinson
Hello, I have a list of class instances. I wish to get the appropriate class attribute in each class instance depending on a SINGLE keyword in the calling class. How do I get the calling method to correctly recognise the keyword as a keyword and not a class attribute? See example code below

Re: getting a class attribute using a keyword argument

2005-01-17 Thread Nick Coghlan
Guy Robinson wrote: Hello, I have a list of class instances. I wish to get the appropriate class attribute in each class instance depending on a SINGLE keyword in the calling class. Py help(getattr) Help on built-in function getattr in module __builtin__: getattr(...) getattr(object, name[,

platform independent kbhit()

2005-01-17 Thread Hans Georg Krauthaeuser
Hey all, this is probably a FAQ, but I didn't found the answer... I use msvcrt.kbhit() to check for a user keyboard event on windows. But now, I would prefer to make the module independent from the platform used. I already know that I can use curses (on linux/unix) or Tkinter. Also, I found

Re: import problems *newbie*

2005-01-17 Thread Steve Holden
Grig Gheorghiu wrote: In my experience (as a tester), it is easier to deal with PYTHONPATH than to add the my.pth file to the site-packages directory. The main reason is that I have my custom packages and modules in a directory tree that I deploy on many clients/servers/platforms/OS versions, some

Re: getting a class attribute using a keyword argument

2005-01-17 Thread [EMAIL PROTECTED]
Guy Robinson wrote: Hello, I have a list of class instances. I wish to get the appropriate class attribute in each class instance depending on a SINGLE keyword in the calling class. How do I get the calling method to correctly recognise the keyword as a keyword and not a class attribute?

Re: lambda

2005-01-17 Thread Steve Holden
Antoon Pardon wrote: [...] A foolish consistency is the hobgoblin of little minds. Rules are made to be broken. Like only use immutables as dictionary keys. Fair enough, but don;t go advising newbies to do this. Besides which, if you don't understand the language environment, rules alone will

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Steve Holden
Erik Max Francis wrote: Steven Bethard wrote: Is there any chance you could post these all as part of the same thread?That would be really nice for those of us who aren't interested -- then we could just ignore the thread... You are looking for evidence of cluefulness where it seems

Re: Writing huge Sets() to disk

2005-01-17 Thread Duncan Booth
Martin MOKREJ© wrote: Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered by vmstat)

Re: lambda

2005-01-17 Thread Antoon Pardon
Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: [...] A foolish consistency is the hobgoblin of little minds. Rules are made to be broken. Like only use immutables as dictionary keys. Fair enough, but don;t go advising newbies to do this. How about something

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Nick Coghlan
Steve Holden wrote: As I may have mentioned before, egotism can be the only possible reason. I'd merely figured it as a textbook case of trolling - attention seeking behaviour, most likely indicative of a lack of self-esteem, rather than the reverse. Still, he does at least keep the

Re: lambda

2005-01-17 Thread Steve Holden
Antoon Pardon wrote: Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: [...] A foolish consistency is the hobgoblin of little minds. Rules are made to be broken. Like only use immutables as dictionary keys. Fair enough, but don;t go advising newbies to do this. How

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJ
Duncan Booth wrote: Martin MOKREJ wrote: Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered

Re: (objects as) mutable dictionary keys

2005-01-17 Thread Peter Maas
Antoon Pardon schrieb: Dictionary lookup with mutable types like lists is a source of unpleasant surprises for the programmer and therefore impossible in Python. It is not impossible in Python. It may be discouraged but it is not impossible since I have already done so. Wouldn't this raise a

Re: OCAMl a more natural extension language for python?

2005-01-17 Thread Ville Vainio
Jelle == Jelle Feringa // EZCT / Paris [EMAIL PROTECTED] writes: Jelle After reading about extending python with C/Fortran in the Jelle excellent Python Scripting for Computational Science book Jelle by Hans Langtangen, I'm wondering whether there's not a Jelle more pythonic way

Re: (objects as) mutable dictionary keys

2005-01-17 Thread Just
In article [EMAIL PROTECTED], Peter Maas [EMAIL PROTECTED] wrote: Antoon Pardon schrieb: Dictionary lookup with mutable types like lists is a source of unpleasant surprises for the programmer and therefore impossible in Python. It is not impossible in Python. Is too. It

Re: generator expressions: performance anomaly?

2005-01-17 Thread Raymond Hettinger
[Delaney, Timothy C] Nick's other suggestion - that genexps propagate __len__ - might still be interesting. Of course, it would only be applicable for unconditional genexps(i.e. no if clause). Length transparency for iterators is not as general as one would expect. I once spent a good deal of

Re: Writing huge Sets() to disk

2005-01-17 Thread Martin MOKREJ
Steve Holden wrote: Martin MOKREJ wrote: Hi, could someone tell me what all does and what all doesn't copy references in python. I have found my script after reaching some state and taking say 600MB, pushes it's internal dictionaries to hard disk. The for loop consumes another 300MB (as gathered

Re: OCAMl a more natural extension language for python?

2005-01-17 Thread Do Re Mi chel La Si Do
Hi ! OCAML is very complementary at Python : unreadable vs readable functionnel vs procedural/POO/etc. compiled vs interpreted (or compil JIT) very fast vs mean velocity hard to learn vs easy to easy to learn Yes, OCAML is very complementary, too much, much too,

Re: protecting the python code.

2005-01-17 Thread Andrey Tatarinov
nell wrote: First the 10x in advance means thanks in advance. The main importance of protecting my code is to save headache of customers that want to be smart and change it and then complain on bugs also you can try to use py2exe -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing a script created by the end user

2005-01-17 Thread Fuzzyman
compile and eval is a good way to go. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Native widgets for Python

2005-01-17 Thread A. Klingenstein
Which other GUI library for Python other than wxpython has native widgets for MS Windows ? I know there is MFC and GDI, but I want something easier to use than wx, not harder :) wxpython has to problem that it handles much more like a C++ library than a Python one sometimes. Alex --

Re: Native widgets for Python

2005-01-17 Thread Stephen Thorne
there's someone writing 'dabo', which is apparently wxpython but more python. Stephen. On Mon, 17 Jan 2005 15:13:07 +0100, A. Klingenstein [EMAIL PROTECTED] wrote: Which other GUI library for Python other than wxpython has native widgets for MS Windows ? I know there is MFC and GDI, but I

RE: OCAMl a more natural extension language for python?

2005-01-17 Thread Jelle Feringa // EZCT / Paris
H. Not familiar with erlang at all... Subject: Re: OCAMl a more natural extension language for python? Hi ! OCAML is very complementary at Python : unreadable vs readable That's depending on how you compare; I find OCAML quite readable compared to C / Fortran

Re: lambda

2005-01-17 Thread Just
In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: There you go with the minutiae again. How about: Don't use mutables as hash keys? That sounds too dogmatic to my ears. I also find it too selective. The problem

PUG in Melbourne Australia?

2005-01-17 Thread Emiliano Molina
Does anyone here know if there is a Python Users Group in Melbourne Australia? A google search shows an attempt to start one at meetups.com or something like that but it now seems defunct. -- http://mail.python.org/mailman/listinfo/python-list

Re: lambda

2005-01-17 Thread Antoon Pardon
Op 2005-01-17, Just schreef [EMAIL PROTECTED]: In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: There you go with the minutiae again. How about: Don't use mutables as hash keys? That sounds too dogmatic to my

Re: lambda

2005-01-17 Thread Antoon Pardon
Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I don't see a big difference between these principles and the hash key principle, so in the end may be we should just stick with the more general principle: Don't use mutables! and be done with it.

[ANN] iCalendar package 0.9

2005-01-17 Thread Max M
I have written a package that can parse and generate files according to RFC 2445 (iCalender). That should be any file ending with .ics :-) It is not quite polished yet, but fully functional, and choke full of doctest. It does support the full spec and all datatypes and parameter values. The

Re: Native widgets for Python

2005-01-17 Thread Tim Heaney
Stephen Thorne [EMAIL PROTECTED] writes: there's someone writing 'dabo', which is apparently wxpython but more python. It looks like dabo uses, not replaces, wxPython http://dabodev.com/about -- http://mail.python.org/mailman/listinfo/python-list

Employablity of python programmers

2005-01-17 Thread Mir Nazim
Hi, Here I am once again to give a bit trouble. I am at the verge of completing my graduation in computer sciences. I will be graduating within 6-8 months. Now I am faced with the problems of my career. I am in a fix what skill set I must choose to be safe as far as job openings are concerned. I

Re: lambda

2005-01-17 Thread John Lenton
On Mon, Jan 17, 2005 at 11:41:20AM +, Antoon Pardon wrote: Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: [...] A foolish consistency is the hobgoblin of little minds. Rules are made to be broken. Like only use immutables as dictionary keys.

Re: List problems in C code ported to Python

2005-01-17 Thread Grant Edwards
On 2005-01-17, Lucas Raab [EMAIL PROTECTED] wrote: Sorry about that. I had a bad day. First there was the migraine and then the fight with my significant other, so yesterday was not a good day. I apologize for what I said. No worries. As somebody else said, the best way to get help solving

Install Python 2.4 on Fedora 3 Core

2005-01-17 Thread Bill
I have less than a week experience on linux, so I am a new newbie. Python 2.3 came preinstalled. I installed version 2.4. All seemed to go well except it installed to usr/local? 1. Was it wrong to install when logged in as 'root'? Does it make a difference? 2. I looked in the package editor

Re: Native widgets for Python

2005-01-17 Thread Steve Holden
Tim Heaney wrote: Stephen Thorne [EMAIL PROTECTED] writes: there's someone writing 'dabo', which is apparently wxpython but more python. It looks like dabo uses, not replaces, wxPython http://dabodev.com/about Actually I think it *layers* wxPython, with the intention of being able to replace

Re: lambda

2005-01-17 Thread Just
In article [EMAIL PROTECTED], Antoon Pardon [EMAIL PROTECTED] wrote: I don't see a big difference between these principles and the hash key principle, Than you haven't looked hard enough. All of these can get unexpected behaviour because of the assignment-doesn't-copy semantics. The

Re: Install Python 2.4 on Fedora 3 Core

2005-01-17 Thread Fredrik Lundh
Bill [EMAIL PROTECTED] wrote: 2. I looked in the package editor and there was no way to uninstall 2.3? Should I? If so, how can I? If not,what are the problems, if any, of having both. if your OS comes with Python, there's a certain chance that it includes utilities that rely on a specific

Re: List problems in C code ported to Python

2005-01-17 Thread Lucas Raab
Lucas Raab wrote: I'm done porting the C code, but now when running the script I continually run into problems with lists. I tried appending and extending the lists, but with no avail. Any help is much appreciated Please see both the Python and C code at http://home.earthlink.net/~lvraab. The

Re: Native widgets for Python

2005-01-17 Thread Ed Leafe
On Jan 17, 2005, at 10:19 AM, Steve Holden wrote: It looks like dabo uses, not replaces, wxPython http://dabodev.com/about Actually I think it *layers* wxPython, with the intention of being able to replace wxPython with other GUI kits at a later date. So, there should be a simpler graphical

Re: lambda

2005-01-17 Thread Antoon Pardon
Op 2005-01-17, John Lenton schreef [EMAIL PROTECTED]: --vni90+aGYgRvsTuO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 17, 2005 at 11:41:20AM +, Antoon Pardon wrote: Op 2005-01-17, Steve Holden schreef

Re: Install Python 2.4 on Fedora 3 Core

2005-01-17 Thread rbt
Bill wrote: I have less than a week experience on linux, so I am a new newbie. Python 2.3 came preinstalled. I installed version 2.4. All seemed to go well except it installed to usr/local? 1. Was it wrong to install when logged in as 'root'? Does it make a difference? 2. I looked in the

Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP

2005-01-17 Thread [EMAIL PROTECTED]
Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP PIG/IP will hold its first meeting on Jan 19, 2005 at the Lawrenceville Library (Room #3). Jon Fox will speak about Python's 2.4 release and then open discussion about Python will be encouraged. When: Wednesday, January

Re: lambda

2005-01-17 Thread Steve Holden
Antoon Pardon wrote: Op 2005-01-17, Steve Holden schreef [EMAIL PROTECTED]: Antoon Pardon wrote: I don't see a big difference between these principles and the hash key principle, so in the end may be we should just stick with the more general principle: Don't use mutables! and be done with it.

Re: Integration with java (Jpype vs. JPE)

2005-01-17 Thread Istvan Albert
Cameron Laird wrote: Someone really ought to include a couple of sentences to that effect on the front page of URL: http://jpype.sf.net/ . Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import *

pychecker - sets.Set need to be overridden

2005-01-17 Thread Istvan Albert
Hello all, if I have this code: import sets class Foo: x = sets.Set() then pychecker says: test.py:4: Methods (__cmp__, __hash__) in sets.Set need to be overridden in a subclass I don't get this message. What is it trying to say, and why? Istvan. --

Re: dynamic data types

2005-01-17 Thread beliavsky
rbt wrote: I've always thought of it like this... in C, we have to do something like this when declaring a variable: int x = 0; We had to specifically tell the language compiler that x is an integer. In Python, all we have to do is: x = 0 The interpretor knows that x is an integer. We can

help with wxSlider wxPython

2005-01-17 Thread Scott
I have the code below. I have changed the background of the frame to white, but I cannot get the wxSlider to not be the ugly gray color. Can someone tell me how to change it to a transparent background (I tried wxTRANSPARENT_WINDOW without success)? import os from wxPython.wx import *

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread [EMAIL PROTECTED]
mport sets class Foo: def __init__(self): self.x = sets.Set() x = Foo() print x, getattr(x, 'x') gives for me: __main__.Foo instance at 0x00C578A0 Set([]) on 2.4. on WinXP. What environment do you run in? -- http://mail.python.org/mailman/listinfo/python-list

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread Istvan Albert
[EMAIL PROTECTED] wrote: __main__.Foo instance at 0x00C578A0 Set([]) on 2.4. on WinXP. What environment do you run in? I'm running it on cygwin, but still don't get it, why the warning? Istvan. -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-17 Thread [EMAIL PROTECTED]
l = [] for i in range(2): for j in range(2): l[i],[j] = 0 print l gives Traceback (most recent call last): File C:\TEMP\test.py, line 75, in -toplevel- l[i],[j] = 0 TypeError: unpack non-sequence That's why your current code needs a matrix class. --

Re: Integration with java (Jpype vs. JPE)

2005-01-17 Thread Jan Dries
Istvan Albert wrote: Now I remember visiting this site, but never understood how it actually worked. Examples such as: from jpype import * startJVM(d:/tools/j2sdk/jre/bin/client/jvm.dll, -ea) java.lang.System.out.println(hello world) shutdownJVM() in three different versions are the only code

how to find site-packages path

2005-01-17 Thread Philippe C. Martin
Hi, I am using my own install script for my software and am looking for a flawless way to figure out where python, and more specifically site-packages is installed. Any clue ? Regards, Philippe -- *** Philippe C. Martin SnakeCard LLC www.snakecard.com

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread Peter Otten
Istvan Albert wrote: if I have this code: import sets class Foo: x = sets.Set() then pychecker says: test.py:4: Methods (__cmp__, __hash__) in sets.Set need to be overridden in a subclass I don't get this message. What is it trying to say, and why? The minimal example is

Re: List problems in C code ported to Python

2005-01-17 Thread Grant Edwards
On 2005-01-17, Lucas Raab [EMAIL PROTECTED] wrote: data[4][j] = ((int)ref_rotor[j]-'A'+26)%26; data[4],[j] = (ref_rotor[j] - 'A'+26) % 26 ^ The comma shouldn't be there. C: data[4][j] Python: data[4][j] Now, do I need to start boning

Re: pychecker - sets.Set need to be overridden

2005-01-17 Thread [EMAIL PROTECTED]
I don't know pychecker, maybe there's something wrong with it as your code seems valid to me. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to stop google from messing Python code

2005-01-17 Thread Fredrik Lundh
Fuzzyman wrote: if you have internet access, you have NNTP access. gmane.org provides access to more than 6,500 mailing lists via NNTP, including all relevant Python forums. Not if you're behind a censoring proxy that blocks everything except http. This is a situation many people find

Re: List problems in C code ported to Python

2005-01-17 Thread [EMAIL PROTECTED]
l = [] for i in range(2): for j in range(2): l[i][j] = 'x' Traceback (most recent call last): File pyshell#7, line 3, in -toplevel- l[i][j] = 'x' IndexError: list index out of range So you still have to dimension the list before you can use it , eg like l = [] for i in range(2):

Re: directory bug on linux; workaround?

2005-01-17 Thread Ewald R. de Wit
Russell E. Owen wrote: It seems that the path was to a fat file partition and included a directory name that was all uppercase. The directory was created, but using lowercase. I'm not yet sure the version of python. The workaround for now is to not use fat file partitions. But I was

How to prevent the script from stopping before it should

2005-01-17 Thread python
I have a script that downloads some webpages.The problem is that, sometimes, after I download few pages the script hangs( stops). (But sometimes it finishes in an excellent way ( to the end) and download all the pages I want to) I think the script stops if the internet connection to the server

RE: How to prevent the script from stopping before it should

2005-01-17 Thread Batista, Facundo
Title: RE: How to prevent the script from stopping before it should [EMAIL PROTECTED] #- I have a script that downloads some webpages.The problem is that, #- sometimes, after I download few pages the script hangs( stops). What do you mean with hangs? It raises an error and quit? It

Re: platform independent kbhit()

2005-01-17 Thread Scott David Daniels
Hans Georg Krauthaeuser wrote: I use msvcrt.kbhit() to check for a user keyboard event on windows. But now, I would prefer to make the module independent from the platform used. This is not in general possible; many machines do not have keyboards. You can, perhaps, build one for yourself from a

Re: How to prevent the script from stopping before it should

2005-01-17 Thread [EMAIL PROTECTED]
#import urllib, sys #pages = ['http://www.python.org', 'http://xxx'] #for i in pages: # try: #u = urllib.urlopen(i) #print u.geturl() #except Exception, e: #print sys.stderr, '%s: %s' % (e.__class__.__name__, e) will print an error if a page fails opening, rest opens

Re: Producer/consumer Queue trick

2005-01-17 Thread Evan Simpson
I should clarify up front that I may have given an overblown sense of how long the producer thread typically takes to generate a board; It's usually a few tenths of a second, up to a few seconds for especially fecund boards. My concern was that even a few seconds is long enough for fifty

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Xah Lee
errata: * the variables in the perl section should be declared inside the subroutine. * the @_[0] should've been $_[0] thanks for Dave Cross for pointing them out. * the Mathematica Apply should be Select... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html --

Re: how to find site-packages path

2005-01-17 Thread vincent wehren
Philippe C. Martin wrote: Hi, I am using my own install script for my software and am looking for a flawless way to figure out where python, and more specifically site-packages is installed. You can take a look at how this is done in Lib/site.py. Look for the bit of code that starts with prefixes

Re: Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP

2005-01-17 Thread Jay Loden
Are visitors welcome? I just happen to be in NJ, and I would like to attend my first PIG/IP Also, are you related in any way to LUG/IP? -Jay On Monday 17 January 2005 10:36, [EMAIL PROTECTED] wrote: Central New Jersey PIG Meeting -- Python Interest Group In Princeton PIG/IP PIG/IP will

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Xah Lee
erratum: the Mathematica Apply should've been Select. ... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] 20050117, filter, map

2005-01-17 Thread Xah Lee
erratum: the Mathematica Apply should've been Select. ... Xah [EMAIL PROTECTED] http://xahlee.org/PageTwo_dir/more.html -- http://mail.python.org/mailman/listinfo/python-list

Re: How to prevent the script from stopping before it should

2005-01-17 Thread Steve Holden
[EMAIL PROTECTED] wrote: #import urllib, sys #pages = ['http://www.python.org', 'http://xxx'] #for i in pages: # try: #u = urllib.urlopen(i) #print u.geturl() #except Exception, e: #print sys.stderr, '%s: %s' % (e.__class__.__name__, e) will print an error if a page

Re: strange note in fcntl docs

2005-01-17 Thread Skip Montanaro
Skip I could have sworn that os.open supported the O_SHLOCK and Skip O_EXLOCK flags. I submitted a patch to posixmodule.c for these: http://python.org/sf/1103951 Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: PyChecker messages

2005-01-17 Thread John Roth
Ben Sizer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] But you could use a dict of return values, or even just assigning a different return value in each if clause. The end result is that you have a single well-defined exit point from the function, which is generally considered to be

Re: Assigning to self

2005-01-17 Thread [EMAIL PROTECTED]
An implementation of what you want can be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Mark McEahern
Frans Englich wrote: Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my scenario: [snip] The basic problem seems to be that you're trying to avoid

Re: Assigning to self

2005-01-17 Thread Peter Otten
Frans Englich wrote: What the code attempts to do is implementing a, to the API user, transparent memory-saver by ensuring that no more than one instance of the class foo exists for a particular id. E.g, the user can simply create an instance and if one not already exists, it is created. By

Re: Assigning to self

2005-01-17 Thread Reinhold Birkenfeld
Frans Englich wrote: Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my scenario:

Re: How to prevent the script from stopping before it should

2005-01-17 Thread Fredrik Lundh
Steve Holden wrote: You will need to import the socket module and then call socket.setdefaulttimeout() to ensure that communication with non-responsive servers results in a socket exception that you can trap. or you can use asynchronous sockets, so your program can keep processing the

Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Are there runtime settings that can be used to adjust the default 1024 byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a need to pump this up to permit input of a large data block via stdin. Tim Jones -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Paul McGuire
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] An implementation of what you want can be found here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 I think this recipe pre-dates the introduction of __new__ in Python. How about something like this (requires the name to

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread Andrew Koenig
brucoder [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Are there runtime settings that can be used to adjust the default 1024 byte stdin buffer limit or a buildtime setting in pyconfig.h? I have a need to pump this up to permit input of a large data block via stdin. What do you

Re: Adjusting the 1024 byte stdin buffer limit

2005-01-17 Thread brucoder
Currently, when sending a data stream that exceeds 1024 bytes via stdin, the stream blocks at the 1024th byte. This precludes completion of the submission of the data stream. Tim -- http://mail.python.org/mailman/listinfo/python-list

Interpreter Not Initialized (version mismatch?)

2005-01-17 Thread Ryan Jud Hughes
I'm having trouble with python on MacOSX 10.3. I wrote an extension module, in C, and got it to compile and run just fine, in MacOSX 10.2, using the MacPython 2.3 package that I downloaded. But when I copied my stuff over to my computer that had MacOSX 10.3(.7), and the out-of-the-box MacPython

Re: Embedding a restricted python interpreter

2005-01-17 Thread Dieter Maurer
Paul Rubin http://[EMAIL PROTECTED] writes on 08 Jan 2005 14:56:43 -0800: Dieter Maurer [EMAIL PROTECTED] writes: It uses a specialized compiler that prevents dangerous bytecode operations to be generated and enforces a restricted builtin environment. Does it stop the user from

Re: python to mssql

2005-01-17 Thread Peter A.Schott
Brane, What are you wanting to know specifically? What is your client machine running? I've started using the Win32 modules to connect using ADODB and that works for me on Windows XP (hopefully 2003 as well, but not tested yet). I pulled those samples from someplace on the net using

Re: Assigning to self

2005-01-17 Thread John Roth
Frans Englich [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, [...] What the code attempts to do is implementing a, to the API user, transparent memory-saver by ensuring that no more than one instance of the class foo exists for a particular id. E.g, the user can simply create

FTPLIB - retry files?

2005-01-17 Thread Peter A.Schott
Is there any way to retry sending files with some delay up to a set number on failure? Sometimes we encounter a locked file on our server or the destination server and we want to retry that file in X seconds. Not exactly sure how to go about that right now short of moving the files elsewhere and

Re: Assigning to self

2005-01-17 Thread Frans Englich
On Monday 17 January 2005 20:03, John Roth wrote: Frans Englich [EMAIL PROTECTED] wrote in message snip In other words, you're trying to create a singleton. In general, singletons are frowned on these days for a number of reasons, not least because of the difficulty of testing them. Then I

Py_Object* Py_BuildValue, Py_INCREF necessary?

2005-01-17 Thread Torsten Mohr
Hi, when i write an extension module in C and return a Py_Object* that i've built with Py_BuildValue, do i need to use Py_INCREF on that before i return it to python from my extension module or not? Thanks for hints, Torsten. -- http://mail.python.org/mailman/listinfo/python-list

supplying constants in an extension module

2005-01-17 Thread Torsten Mohr
Hi, i write an extension module in C at the moment. I want to define some constants (integer mainly, but maybe also some strings). How do i do that best within this extension module in C? Do i supply them as RO attributes? What's the best way for it? Thanks for hints, Torsten. --

extension module, thread safety?

2005-01-17 Thread Torsten Mohr
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. The question came up if this is by itself thread safe, if some two or more threads try to change these data

  1   2   >