Re: Python becoming less Lisp-like

2005-03-15 Thread Torsten Bronger
Hallchen! Steven Bethard [EMAIL PROTECTED] writes: Torsten Bronger wrote: the underlying constructs are utterly ugly, as are some of Python's features (e.g. __getattr__ and such, and decorators, in order to get nice class properties). What do you find ugly about __getattr__? [First, I

Re: variable arguments question

2005-03-15 Thread Stephan Diehl
On Tue, 15 Mar 2005 03:48:40 -0400, vegetax wrote: if i have a dictionary: d = {'a':2,'b':3 } l = (1,2) how can i pass it to a generic function that takes variable keywords as arguments? same thing with variable arguments, i need to pass a list of arguments to the function def

Re: variable arguments question

2005-03-15 Thread Roel Schroeven
vegetax wrote: if i have a dictionary: d = {'a':2,'b':3 } l = (1,2) how can i pass it to a generic function that takes variable keywords as arguments? same thing with variable arguments, i need to pass a list of arguments to the function def asd(**kw): print kw def efg(*arg): print

Re: urllib (and urllib2) read all data from page on open()?

2005-03-15 Thread Fuzzyman
Bengt Richter wrote: On Mon, 14 Mar 2005 14:48:25 -, Alex Stapleton [EMAIL PROTECTED] wrote: Whilst it might be able to do what I want I feel this to be a flaw in urllib that should be fixed, or at least added to a buglist somewhere so I can at least pretend someone other than me cares.

Re: How can I load a module when I will only know the name 'on the fly'

2005-03-15 Thread gene . tani
imp.find_module() and imp.load_module: http://www.python.org/doc/2.3.4/whatsnew/section-pep302.html http://docs.python.org/lib/module-imp.html renwei wrote: use built-in function: __import__ m = __import__('sys', globals()) print m.platform weir Tobiah [EMAIL PROTECTED] m =

Re: Tkinter Bitmap Newbie question

2005-03-15 Thread Eric Brunel
On Tue, 15 Mar 2005 00:00:57 GMT, Neil Hodgson [EMAIL PROTECTED] wrote: Wim Goffin: But just to make sure I'm on the right track, - Is XBM the best way to for bitmaps? The ones I saw so far are all black and white. Do they also exist in color? XPM is the version of XBM with colour. - Is XBM

Downloading all files older than 3 hours from a ftp-server.

2005-03-15 Thread Thomas W
I need to download all files older than 3 hours from a ftp-server. What's the easiest way to this? I've looked into the standard ftplib, but it seems like the only way to go is to parse the ftp.retrlines('LIST') command and that seems to be very easy to mess up. any hints? Best regards, Thomas

Lisp-likeness

2005-03-15 Thread Kay Schluehr
Maybe You can answer my question what this simple LISP function does ? (defun addn (n) #'(lambda (x) (+ x n))) This is correct LISP-syntax if You bear in mind LISPs powerwull macro language... I think Guido and python-dev are very carefull in adding new power to Python.

Bitmaps On Buttons ?

2005-03-15 Thread PGMoscatt
I am slowly progressing with my python app. I have got to the point where I would like to place images onto my buttons. I use Tkinter as my GUI libary. The following is how I understand I place an image onto a button - but I am not having much success with it all. Any ideas ? Pete

Re: win32 shell extension (virtual drive)

2005-03-15 Thread Fuzzyman
Not much help... but the place to be looking is in the win32 api. You'll then need to see if the functionality is already exposed in the win32 extensions by Mark Hammond - if not you can use ctypes to access it. The ctypes mailing list might be a useful place to ask questions - but it's not

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
rx_data = ser.read(19) byte[] = unpack('19B', rx_data) for k in range(9): if byte[k] == 70 if byte[k+2] == 6 if byte[k+9] == -(byte[k]+byte[k+1]+byte[k+2]+byte[k+3]+byte[k+4]+byte[k+5]+byte[k+6]+byte[k+7]+byte[k+8]) 0xff print

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-15 Thread Richie Hindle
[Richie] It's possibly that it was an all-users installation but I copied the DLL into C:\Python24 for some reason [Martin] Ah, ok. I could not have thought of *that*. That also explains it: the upgrading simply did not manage to remove/replace your copy of python24.dll. It's easy to see

Re: Web framework

2005-03-15 Thread Joe
On Tue, 15 Mar 2005 00:07:34 -0500, Benji York [EMAIL PROTECTED] wrote: That's not entirely true of Zope 2, and not true at all for Zope 3. All code for Zope 3 is loaded from the file system. Great news :-) I'll go check it out. Joe. -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a problem on this simple code

2005-03-15 Thread jrlen balane
did some editing: rx_data = ser.read(19) byte[0:18] = unpack('19B', rx_data) for k in range(9): if byte[k] == 70: if byte[k+2] == 6: if byte[k+9] == -(byte[k]+byte[k+1]+byte[k+2]+byte[k+3]+byte[k+4]+byte[k+5]+byte[k+6]+byte[k+7]+byte[k+8]) 0xff:

Re: Python becoming less Lisp-like

2005-03-15 Thread Carl Banks
Torsten Bronger wrote: Steven Bethard [EMAIL PROTECTED] writes: Interesting. I've never thought that. What parts strike you as patchwork? Well, with a little bit of experience in the field of programming languages, you can see which elements had been added later (ie years after

Re: Can't seem to insert rows into a MySQL table

2005-03-15 Thread Anthra Norell
Very true! I could verify that cursor.execute () seems to understand ... %s ..., ...string... where print () doesn't.. I didn't know that. I could also verify that gumfish's ineffective insertion command works fine for me. (Python 2.4, mysql-3.23.38). So it looks like the problem is with MySQL

raising an exception in one thread from an other. (PyThreadState_SetAsyncExc)

2005-03-15 Thread Antoon Pardon
I have been playing a bit with PyThreadState_SetAsyncExc. Now the documentation abouth this call states the following: | Returns the number of thread states modified; if it returns a number | greater than one, you're in trouble, and you should call it again with | exc set to NULL to revert the

python version anachronism

2005-03-15 Thread Xah Lee
this url: http://www.python.org/doc/2.4/ sayz: Python 2.4 Documentation (released November 30, 2004) but this url: http://www.python.org/doc/2.3.5/ sayz: Python 2.3.5 Documentation (released February 8th, 2005) so, python 2.3.5 is released about 2 months later than 2.4?? also, does the

simulated samba server

2005-03-15 Thread tc
Does anyone know of a module for python which simulates a samba server (windows fileshare). Instead of sharing a Phisical Device I'd like to share a database based filesystem which is spread over various numbers of drives and servers. Any hints? TC --

Re: python version anachronism

2005-03-15 Thread Swaroop C H
--- Xah Lee [EMAIL PROTECTED] wrote: so, python 2.3.5 is released about 2 months later than 2.4?? As far as I understand, 2.3.5 is a maintenance release in the 2.3 branch. It is independent of the 2.4 branch. Swaroop C H Blog: http://www.swaroopch.info Book: http://www.byteofpython.info --

[perl-python] unicode study with unicodedata module

2005-03-15 Thread Xah Lee
python has this nice unicodedata module that deals with unicode nicely. #-*- coding: utf-8 -*- # python from unicodedata import * # each unicode char has a unique name. # one can use the lookup func to find it mychar=lookup('greek cApital letter sIgma') # note letter case doesn't matter print

Re: is there a problem on this simple code

2005-03-15 Thread John Machin
jrlen balane wrote: did some editing: The error means that you received less than 19 bytes of data. rx_data = ser.read(19) !rx_len = len(rx_data) !print 'rx_len', rx_len byte[0:18] = unpack('19B', rx_data) !# trash the above, do this !byte = [ord(x) for x in rx_data] !print 'received', byte

Re: Tkinter Bitmap Newbie question

2005-03-15 Thread klappnase
Neil Hodgson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Wim Goffin: But just to make sure I'm on the right track, - Is XBM the best way to for bitmaps? The ones I saw so far are all black and white. Do they also exist in color? XPM is the version of XBM with

Re: python reading excel thru ADO ?

2005-03-15 Thread Simon Brunning
On Mon, 14 Mar 2005 16:20:17 GMT, Chris Curvey [EMAIL PROTECTED] wrote: I've been reading http://www.mayukhbose.com/python/ado/ad-connection.php , which seems to infer that I can read an Excel file using the ADO interface with Python on Windows. Unfortunately, the usual problem with ADO --

Re: python version anachronism

2005-03-15 Thread Simon Brunning
On 15 Mar 2005 02:05:24 -0800, Xah Lee [EMAIL PROTECTED] wrote: so, python 2.3.5 is released about 2 months later than 2.4?? Yes. 3.2.5 is a bugfix release of the 2.3 branch, 2.4 is a major release. 2.4.1 is coming soon, BTW. also, does the released ... indicates the doc or the doc and the

Re: Web framework

2005-03-15 Thread Stephen Thorne
On Sun, 13 Mar 2005 13:21:27 -0800, Venkat B [EMAIL PROTECTED] wrote: I'd say Nevow! For apache setup, you might be interested in my wsgi [1] implementation. Hi Sridhar, Are you aware of Nevow's integrability with the webservers (CGIHTTPServer in particular) that come packaged with

Re: python reading excel thru ADO ?

2005-03-15 Thread tc
I always used win32com.client to access excel files and parse them, save them as website, csv and so on. why exactly is it that u use ado for solving this? TC -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Tim Daneliuk
In-Reply-To: [EMAIL PROTECTED] X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Nick Craig-Wood wrote: Torsten Bronger [EMAIL PROTECTED] wrote: The current snapshot is a

Re: pre-PEP: Print Without Intervening Space

2005-03-15 Thread Antoon Pardon
Op 2005-03-11, Marcin Ciura schreef [EMAIL PROTECTED]: Moreover, all of them require creating one or two temporary objects to hold the entire result. If the programmers use one of them without qualms, it is only because their mind is warped by the limitation of print.

Re: Python becoming less Lisp-like

2005-03-15 Thread Serge Orlov
Torsten Bronger wrote: Interesting. I've never thought that. What parts strike you as patchwork? Well, with a little bit of experience in the field of programming languages, you can see which elements had been added later (ie years after Python's creation). Properties surely would have

Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Harlin Seritt
I was looking at the Tcl/Tk sourceforge page and found that there were a couple of new widgets being produced for Tcl 8.5. Does anyone know if there are any Tkinter wrappers somewhere? thanks, Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: Downloading all files older than 3 hours from a ftp-server.

2005-03-15 Thread TZOTZIOY
On 15 Mar 2005 00:38:20 -0800, rumours say that Thomas W [EMAIL PROTECTED] might have written: I need to download all files older than 3 hours from a ftp-server. What's the easiest way to this? I've looked into the standard ftplib, but it seems like the only way to go is to parse the

Re: simulated samba server

2005-03-15 Thread TZOTZIOY
On 15 Mar 2005 02:08:55 -0800, rumours say that tc [EMAIL PROTECTED] might have written: Does anyone know of a module for python which simulates a samba server (windows fileshare). Instead of sharing a Phisical Device I'd like to share a database based filesystem which is spread over various

Re: python version anachronism

2005-03-15 Thread TZOTZIOY
On Tue, 15 Mar 2005 10:23:02 +, rumours say that Simon Brunning [EMAIL PROTECTED] might have written: 3.2.5 is a bugfix release of the 2.3 branch Damn, we're on Python 3 already? Where are all the PEPs I missed?-) -- TZOTZIOY, I speak England very best. Be strict when sending and tolerant

Re: Python becoming less Lisp-like

2005-03-15 Thread Torsten Bronger
Hallchen! Serge Orlov [EMAIL PROTECTED] writes: Torsten Bronger wrote: Interesting. I've never thought that. What parts strike you as patchwork? Well, with a little bit of experience in the field of programming languages, you can see which elements had been added later (ie years after

Re: simulated samba server

2005-03-15 Thread Ola Natvig
Christos TZOTZIOY Georgiou wrote: On 15 Mar 2005 02:08:55 -0800, rumours say that tc [EMAIL PROTECTED] might have written: Does anyone know of a module for python which simulates a samba server (windows fileshare). Instead of sharing a Phisical Device I'd like to share a database based filesystem

Re: simulated samba server

2005-03-15 Thread tc
HTTP isn't a solution. I thought of that also, but I need it to simulate a drive, because various programs (also such that don't support webDAV / HTTP) need to access the files on that storage, as if it where a local or a network drive. -- http://mail.python.org/mailman/listinfo/python-list

Re: simulated samba server

2005-03-15 Thread tc
neither... I really need a network drive or a shell integration (like virtual cd drive...) cheers -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread Martin Franklin
Tim Daneliuk wrote: In-Reply-To: [EMAIL PROTECTED] X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Nick Craig-Wood wrote: Torsten Bronger [EMAIL PROTECTED] wrote: The current snapshot

Re: simulated samba server

2005-03-15 Thread Diez B. Roggisch
tc wrote: Does anyone know of a module for python which simulates a samba server (windows fileshare). Instead of sharing a Phisical Device I'd like to share a database based filesystem which is spread over various numbers of drives and servers. Any hints? If you can use a linux server,

Re: Python becoming less Lisp-like

2005-03-15 Thread Peter Maas
Carl Banks schrieb: In Python, classes aren't some magical land where the usual rules don't hold (as they are in many other languages). That's why self. is used on class variables, for instance. A class is nothing more than a scope that uses a smittering of magic to turn it into a type. scope -

Jython Phone Interview Advice

2005-03-15 Thread George Jempty
I'm undergoing a phone interview for a Jython job today. Anybody have practical advice for me? I haven't worked with Python in years, but I have been working with Java in the meantime (resume at http://scriptify.com/george_jempty_resume.pdf). I've been reading up: my old Quick Python

Re: Python becoming less Lisp-like

2005-03-15 Thread Paul Boddie
Torsten Bronger [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... At first, I was very pleased by Python's syntax (and still I am). Then, after two weeks, I learned about descriptors and metaclasses and such and understood nothing (for the first time in syntax I felt totally

Re: simulated samba server

2005-03-15 Thread tc
GREAT, thanks that should just do the trick. Maybe that way i'll generate a bit more network traffic (because it first transfers the data from different servers to the linux server and the sends it from there...) but it actually will work just fine. thanks alot cheers tc --

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: I was looking at the Tcl/Tk sourceforge page and found that there were a couple of new widgets being produced for Tcl 8.5. Does anyone know if there are any Tkinter wrappers somewhere? thanks, Harlin Harlin, I can't see the web page saying these will be included in Tk 8.5 can

Re: win32 shell extension (virtual drive)

2005-03-15 Thread Roger Upole
There's an example shell extension in the Pywin32 demos that creates a pseudo-folder whose contents are determined by python code. Take a look at \win32comext\shell\demos\servers\shell_view.py. However, I don't think it qualifies as 'simple' ;) Roger Tiziano Bettio [EMAIL PROTECTED]

Re: Python becoming less Lisp-like

2005-03-15 Thread Torsten Bronger
Hallchen! [EMAIL PROTECTED] (Paul Boddie) writes: Torsten Bronger [EMAIL PROTECTED] wrote: At first, I was very pleased by Python's syntax (and still I am). Then, after two weeks, I learned about descriptors and metaclasses and such and understood nothing (for the first time in syntax I

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Harlin Seritt
Martin, Take a look here: http://mail.python.org/pipermail/tkinter-discuss/2004-March/10.html It is a well-known post from what I understand. You may have already seen it before. Actually, (as I'm looking at a 8.4 demo set from ActiveTcl distribution), it seems the Tree widget has been added

Re: Jython Phone Interview Advice

2005-03-15 Thread Harlin Seritt
George, Know what they will be wanting you to do with Jython. This has bitten me in @ss a couple of times. I guess it was lack of attention to detail. :-) Good Luck! Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: Martin, Take a look here: http://mail.python.org/pipermail/tkinter-discuss/2004-March/10.html It is a well-known post from what I understand. You may have already seen it before. Actually, (as I'm looking at a 8.4 demo set from ActiveTcl distribution), it seems the Tree

Re: Python becoming less Lisp-like

2005-03-15 Thread Ville Vainio
Torsten == Torsten Bronger [EMAIL PROTECTED] writes: There would be keywords for static and class methods, no distinction between Unicode and non-Unicode You couldn't do that 15 years ago because there were no Unicode that time. Torsten I've never said that Guido was

Re: Lisp-likeness

2005-03-15 Thread ole . rohne
Kay Maybe You can answer my question what this simple LISP function does ? Kay (defun addn (n) Kay #'(lambda (x) Kay (+ x n))) Is that a real question or are you making a rhetorical point here? Kay This is correct LISP-syntax if You bear in mind LISPs powerwull macro Kay

Re: unicode study with unicodedata module

2005-03-15 Thread Xah Lee
how do i get a unicode's number? e.g. 03ba for greek lowercase kappa? (or in decimal form) Xah Xah Lee wrote: python has this nice unicodedata module that deals with unicode nicely. #-*- coding: utf-8 -*- # python from unicodedata import * # each unicode char has a unique name. # one

Re: Getting the process list on win98

2005-03-15 Thread Roger Upole
WMI didn't come installed on Win98. You can download the addon for win98 from Microsoft. If I recall correctly from when I last used it on 98, GetObject didn't work for wmi. You might have to use win32com.client.Dispatch('Wbemscripting.Swbemlocator') to create the object. hth

Truncated file without unbuffered mode

2005-03-15 Thread Fuzzyman
I use a simple python script to monitor downloads from my website. http://www.voidspace.org.uk/python/cgi.shtml#downman It serves the file in a loop using our old friend : ``sys.stdout.write(chunk)`` (After sending the relevant headers with filename and filesize of course). I am testing this

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Harlin Seritt
Martin, If I may ask, who actually works on the Tkinter module? Is there a certain group that does this? I'm just curious as I've never been able to find this information. I know there are, of course, someone who develops Tk but just not sure who does this on the Python side. Thanks, Harlin --

Re: unicode study with unicodedata module

2005-03-15 Thread TZOTZIOY
On 15 Mar 2005 04:55:17 -0800, rumours say that Xah Lee [EMAIL PROTECTED] might have written: how do i get a unicode's number? e.g. 03ba for greek lowercase kappa? (or in decimal form) you get the character with: . uc = u\N{GREEK SMALL LETTER KAPPA} or with . uc = unicodedata.lookup(GREEK

possible solution for bsddb get data results on the internet.

2005-03-15 Thread martijn
H! I have a big bsddb database created with python and that works fast. I know that I can use the python_apache module to show the data results online. //--- python_apache module form action=pythonscript.py input type=text name=age value=user input input type=submit name=Submit value=get records

Re: {SPAM} start a python application as a win NT service

2005-03-15 Thread Frank Millman
Gijs Korremans wrote: Hi, I'm using windows 2003 small business server and I want to install my python programm as a NT (it's just an old name) service. Does anybody know how to do this? Kind regards, Gijs Korremans RD Department Global Supply Chain Services (pty) Ltd. P.O. Box 1263

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: Martin, If I may ask, who actually works on the Tkinter module? Is there a certain group that does this? I'm just curious as I've never been able to find this information. I know there are, of course, someone who develops Tk but just not sure who does this on the Python side.

Re: Python becoming less Lisp-like

2005-03-15 Thread Serge Orlov
Fernando wrote: On Sun, 13 Mar 2005 18:23:05 GMT, Peter Seibel [EMAIL PROTECTED] wrote: Looks like the BDFL is planning to take lambda, reduce, filter, and map out of Python in the next big rev of Python (so called Python 3000): http://www.artima.com/weblogs/viewpost.jsp?thread=98196

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Harlin Seritt
(snip) That said I have got a Tile Button example working (and I can change it's style) so perhaps not that much work Do you happen to have a sampling of this that I can get my hands on?? I've cc'd the tkinter mailing list to see if there is any more interest over there... Thanks for doing

pygtk: edited signal and selected column

2005-03-15 Thread _v_tiziano
Hi, I'm trying to get the selected column from the callback for the signal edited of a gtk.CellRendererCombo. This callback return only the gtk.CellRendererCombo object, the selected path and the new text is being to be inserted. :( Any idea? tanx _v_tiziano --

Re: Lisp-likeness

2005-03-15 Thread Albert Reiner
[EMAIL PROTECTED], Tue, 15 Mar 2005 13:10:52 +0100]: It's indeed correct CL syntax, but I don't see much macro usage in there. defun? Albert. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter wrappers for TkTreeCtrl and Tile

2005-03-15 Thread Martin Franklin
Harlin Seritt wrote: (snip) That said I have got a Tile Button example working (and I can change it's style) so perhaps not that much work Do you happen to have a sampling of this that I can get my hands on?? I've cc'd the tkinter mailing list to see if there is any more interest over there...

Re: Getting the process list on win98

2005-03-15 Thread Ron
Thanks for the reply Roger, Since will put this on my web site for general use, I don't want users to have to install additional software. I'll try win32com.client.Dispatch('Wbemscripting.Swbemlocator') see what that does. As a last resort, I use a registry key as a run status varable. Not my

Re: Jython Phone Interview Advice

2005-03-15 Thread Paul Watson
George Jempty [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm undergoing a phone interview for a Jython job today. Anybody have practical advice for me? I haven't worked with Python in years, but I have been working with Java in the meantime (resume at

Re: How do I pass structures using a C extension?

2005-03-15 Thread [EMAIL PROTECTED]
I have access to the source, so it seems that I can create shareable libs for the libraries I want to use using distutils. I do a glob.glob() on the *.c files in the libscr directory. If I copy the main library.h file over to where my module.i file is, I can do a %include on it and things seem to

Re: Python becoming less Lisp-like

2005-03-15 Thread Steven Bethard
Torsten Bronger wrote: [EMAIL PROTECTED] (Paul Boddie) writes: Well, I've been using Python for almost ten years, and I've managed to deliberately ignore descriptors and metaclasses quite successfully. I get the impression that descriptors in particular are a detail of the low-level implementation

Python CGI discussion Group

2005-03-15 Thread Fuzzyman
There is a `web design` group over on google-groups. http://groups-beta.google.com/group/wd It's brief is for ``Discussion of web design (html, php, flash, wysiwig, cgi, perl, python, css, design concepts, etc.).``, but it's very quiet. I'd love to see it become a discussion forum for Python CGIs

Re: Jython Phone Interview Advice

2005-03-15 Thread George Jempty
Paul Watson wrote: Gee, George. I wonder if the interviewing manager or anyone in their company has access to newsgroups? Then I hope they would see that I was trying to properly prepare for the interview. I've given it to them straight so far: I'm no Python/Jython guru. And I'll give it

Question about string.printable and non-printable characters

2005-03-15 Thread Daniel Alexandre
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there, I'm using the following method in my program to check whether a message received is printable or not and to strip the non-printable characters: CheckPrintable(self,message): printablemessage = for char in message: if char in

Re: Python becoming less Lisp-like

2005-03-15 Thread James Graves
Fernando [EMAIL PROTECTED] wrote: Peter Seibel [EMAIL PROTECTED] wrote: Looks like the BDFL is planning to take lambda, reduce, filter, and map out of Python in the next big rev of Python (so called Python 3000): http://www.artima.com/weblogs/viewpost.jsp?thread=98196 Basically,

Re: Turning String into Numerical Equation

2005-03-15 Thread Steven Bethard
Michael Spencer wrote: Giovanni Bajo wrote: I use something along these lines: def safe_eval(expr, symbols={}): return eval(expr, dict(__builtins__=None, True=True, False=False), symbols) import math def calc(expr): return safe_eval(expr, vars(math)) That offers only notional security:

(no subject)

2005-03-15 Thread praveen tayal
Hi Guys, I am having problems in the following C API program where myOtim_system is callable from python function. The module is listed below - static PyObject * myOptim_system(PyObject *self, PyObject *args) { const char *command; double u0, v0, u1, v1, u2, v2, u3, v3; int

Re: Jython Phone Interview Advice

2005-03-15 Thread D H
George Jempty wrote: Also, considering Javascript will be a substantial component of my job, I'm noticing that Javascript's array/hash literal syntax is EXACTLY the same as that for Python lists/dictionaries. This could lead to easily sharing data between the client and server side, though I

Re: Turning String into Numerical Equation

2005-03-15 Thread Steven Bethard
Steven Bethard wrote: Yeah, I was concerned about the same thing, but I realized that I can't actually access any of the func_globals attributes: py eval('(1).__class__.mro()[-1].__subclasses__()[17]' ... '.substitute.func_globals', dict(__builtins__=None)) Traceback (most recent call

Re: Lisp-likeness

2005-03-15 Thread Peter Lewerin
Kay Schluehr [EMAIL PROTECTED] wrote Maybe You can answer my question what this simple LISP function does ? It obviously returns a function adding n to the function's parameter, n being bound into the functions's closure during the call to ADDN. It's simple and straightforward. This is

Re: Question about string.printable and non-printable characters

2005-03-15 Thread Michael Hoffman
Daniel Alexandre wrote: CheckPrintable(self,message): printablemessage = for char in message: if char in string.printable: printablemessage = printablemessage + char return printablemessage That would probably be best written (using Python 2.4) as: def check_printable(self,

Re: Lisp-likeness

2005-03-15 Thread Michael Hoffman
Peter Lewerin wrote: Kay Schluehr [EMAIL PROTECTED] wrote Maybe You can answer my question what this simple LISP function does ? It obviously returns a function adding n to the function's parameter, n being bound into the functions's closure during the call to ADDN. It's simple and

Re: Python becoming less Lisp-like

2005-03-15 Thread Brandon J. Van Every
James Graves wrote: So with Python 3000, you're going to end up with a language just as big as CL, but without the most fundamental building blocks. Ah well, to each his own. Preventing people from building things from scratch is probably an industrial advantage. Look how fragmented the

Why tuple with one item is no tuple

2005-03-15 Thread Gregor Horvath
Hi, type(['1']) type 'list' type(('1')) type 'str' I wonder why ('1') is no tuple Because I have to treat this special case differently in my code. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-15 Thread Fuzzyman
('1',) is a tuple... you need the comma to make it a tuple. regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: Jython Phone Interview Advice

2005-03-15 Thread George Jempty
D H wrote: George Jempty wrote: Also, considering Javascript will be a substantial component of my job, I'm noticing that Javascript's array/hash literal syntax is EXACTLY the same as that for Python lists/dictionaries. This could lead to easily sharing data between the client and server

RE: Why tuple with one item is no tuple

2005-03-15 Thread Batista, Facundo
Title: RE: Why tuple with one item is no tuple [Gregor Horvath] #- type(('1')) #- type 'str' #- #- I wonder why ('1') is no tuple The parentheses don't create the tuple, the comma does: ('1') '1' ('1',) ('1',) '1', ('1',) . Facundo Bitácora De Vuelo:

Re: Why tuple with one item is no tuple

2005-03-15 Thread Bill Mill
On Tue, 15 Mar 2005 16:16:34 GMT, Gregor Horvath [EMAIL PROTECTED] wrote: Hi, type(['1']) type 'list' type(('1')) type 'str' I wonder why ('1') is no tuple because, syntactically, those parens are for grouping, and do not unambiguously define a tuple. It's a python gotcha. To

Re: Why tuple with one item is no tuple

2005-03-15 Thread deelan
Gregor Horvath wrote: Hi, type(['1']) type 'list' type(('1')) type 'str' I wonder why ('1') is no tuple Because I have to treat this special case differently in my code. you need to tell python that ('1') isn't a string inside a couple parens but a tuple, look: t = ('1', ) type(t) type

Re: Why tuple with one item is no tuple

2005-03-15 Thread Roy Smith
Gregor Horvath [EMAIL PROTECTED] wrote: Hi, type(['1']) type 'list' type(('1')) type 'str' I wonder why ('1') is no tuple You need to say ('1',). In just plain ('1'), the parens are interpreted as grouping, not as tuple creation. Depending on your point of view, this is either a

unicode converting

2005-03-15 Thread Maxim Kasimov
there are a few questions i can find answer in manual: 1. how to define which is internal encoding of python unicode strings (UTF-8, UTF-16 ...) 2. how to convert string to UCS-2 (Python 2.2.3 on freebsd4) -- Best regards, Maxim -- http://mail.python.org/mailman/listinfo/python-list

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Bengt Richter) wrote: Did you mean type(x).__getitem__(x,y)? Not if x is a classmethod, Oh yeah, right. Duh! And where is this documented? Between the lines in my previous post ;-) I see. I guess I wasn't asking a stupid question then

Re: Convert python to exe

2005-03-15 Thread [EMAIL PROTECTED]
Thanks. I'll try it . -- http://mail.python.org/mailman/listinfo/python-list

Re: unicode converting

2005-03-15 Thread Diez B. Roggisch
Maxim Kasimov wrote: there are a few questions i can find answer in manual: 1. how to define which is internal encoding of python unicode strings (UTF-8, UTF-16 ...) It shouldn't be your concern - but you can specify it using ./configure --enable-unicode=ucs2 or --enable-unicode=ucs4. You

Re: distutils setup ignoring scripts

2005-03-15 Thread Raseliarison nirinA
Jack Orenstein wrote: I'm using Python 2.2 on RH9. I have a set of Python modules organized into a root package and one other package named foobar. setup.py looks like this: from distutils.core import setup setup( name = 'foobar', version = '0.3',

Re: Listbox fill=BOTH expand=YES (Tkinter)

2005-03-15 Thread Raseliarison nirinA
Harlin Seritt wrote: either YES, True, or 1 should work. yes, indeed. import Tkconstants 'True' and 'YES' in dir(Tkconstants) True thanks Harlin, -- nirinA -- http://mail.python.org/mailman/listinfo/python-list

Re: __getitem__ method on (meta)classes

2005-03-15 Thread Ron Garret
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Bengt Richter) wrote: On Mon, 14 Mar 2005 23:44:46 -0700, Steven Bethard [EMAIL PROTECTED] wrote: Ron Garret wrote: What I'm really trying to do is to create enumerated types such that if: e1 = enum(lst) and v = e1(x) then

Re: unicode converting

2005-03-15 Thread Maxim Kasimov
Diez B. Roggisch wrote: Maxim Kasimov wrote: there are a few questions i can find answer in manual: 1. how to define which is internal encoding of python unicode strings (UTF-8, UTF-16 ...) It shouldn't be your concern - but you can specify it using ./configure --enable-unicode=ucs2 or

Re: Why tuple with one item is no tuple

2005-03-15 Thread Gregor Horvath
thanks are given to all problem solved... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-15 Thread El Pitonero
Fernando wrote: The real problem with Python is ... Python is going the C++ way: piling feature upon feature, adding bells and whistles while ignoring or damaging its core design. I totally agree. Look at a recent thread Compile time evaluation (aka eliminating default argument hacks)

Re: [perl-python] unicode study with unicodedata module

2005-03-15 Thread Brian McCauley
Xah Lee wrote: i don't know what's the state of Perl's unicode. perldoc perlunicode -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp-likeness

2005-03-15 Thread Fernando
On 15 Mar 2005 00:43:49 -0800, Kay Schluehr [EMAIL PROTECTED] wrote: Maybe You can answer my question what this simple LISP function does ? (defun addn (n) #'(lambda (x) (+ x n))) The same as def addn(n): def fn(x): return n + x return fn

  1   2   3   >