Re: pyqt and Eric 3

2005-04-28 Thread Phil Thompson
On Thursday 28 April 2005 3:46 am, ChrisH wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Are there any Eric 3 users out there? I've been thinking about trying it. Also, if I write scripts for internal use only at my company, do I have to purchase a Qt or pyqt

Re: Which IDE is recommended?

2005-04-28 Thread Ville Vainio
pydev == Brian Beck [EMAIL PROTECTED] writes: pydev * PyDev isn't yet mature enough to make it practical for me What version? PyDev has increased in maturity quite a bit lately. -- Ville Vainio http://tinyurl.com/2prnb -- http://mail.python.org/mailman/listinfo/python-list

dynamically generating temporary files through python/cgi

2005-04-28 Thread poisondart
Is there a way to dynamically generate temporary files (such as an html, xml or text file) in Python? I'm not sure if I'm explaining myself clearly as I've no clue how to describe this mechanism. I've seen it on certain websites that will generate a file under certain parameters (through forms)

Re: Which IDE is recommended?

2005-04-28 Thread bruno modulix
Dave Cook wrote: (snip) Once upon a time emacs was considered bloated, That was when 640ko ought to be enough ?-) but it's tiny compared to eclipse. Yeps. And a *lot* faster. And in not that much bigger than Vim in fact... -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1] for w in

bytecode non-backcompatibility

2005-04-28 Thread Maurice LING
Martin v. Löwis wrote: Maurice LING wrote: I've emailed to catelog-sig mailing list and is still waiting to hear something. Currently, I have no idea of the structure of PyPI. I hope I can hear from them soon and generate some starting points... Posting questions is not the only way to find

Re: regex over files

2005-04-28 Thread Robin Becker
Skip Montanaro wrote: .. I'm not sure why the mmap() solution is so much slower for you. Perhaps on some systems files opened for reading are mmap'd under the covers. I'm sure it's highly platform-dependent. (My results on MacOSX - see below - are somewhat better.) I'll have a go at doing

Re: pyqt and Eric 3

2005-04-28 Thread lbolognini
http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml Lorenzo -- http://mail.python.org/mailman/listinfo/python-list

Re: interactive web graphics

2005-04-28 Thread Maksim Kasimov
java are also wide-spread browser plugin with interactive and multimedia capabilities, and java-applets can be written with python (jython) Diez B. Roggisch [EMAIL PROTECTED] wrote: news:[EMAIL PROTECTED] you are after _might_ be done using macromedia flash - as that is a wide-spread browser

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Ville Vainio wrote: What version? PyDev has increased in maturity quite a bit lately. PyDev 0.9.2 with Eclipse 3.0.2. It's a nice effort currently, but some of my issues are: * Code completion doesn't work properly for me, and I have no idea why. I have to type the '.' then ADD A SPACE, *then*

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Oh yeah, and what's with not being able to configure the code completion key sequence. How about *no* key sequence? That's the way every other IDE I've used does it. This is more like semi-automatic code completion. -- Brian Beck Adventurer of the First Order --

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Brian Beck wrote: What version? PyDev has increased in maturity quite a bit lately. I realize 0.9.3 is the latest release, but the installation fails through the Eclipse updater: Unable to complete action for feature PyDev for Eclipse due to errors. Unable to create file

Re: dynamically generating temporary files through python/cgi

2005-04-28 Thread Michael Hoffman
poisondart wrote: I've seen it on certain websites that will generate a file under certain parameters (through forms) that will dissapear (i.e. delete itself) after a specified amount of time... Is there a group of library functions that allow this? No. The easiest way, in my mind would be to

Re: Question about python code distribution...

2005-04-28 Thread Stephen Prinster
[EMAIL PROTECTED] wrote: Hi, I am sure that this question might have come up repeatedly. Companies may not want to distribute their python code in source form. Even though pyc files are one option, it gets inconvenient to distribute bunch of them . If there is some way to bundle pyc files

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Brian Beck wrote: I realize 0.9.3 is the latest release, but the installation fails through the Eclipse updater: Unable to complete action for feature PyDev for Eclipse due to errors. Unable to create file

Re: Which IDE is recommended?

2005-04-28 Thread Ville Vainio
Brian == Brian Beck [EMAIL PROTECTED] writes: Brian Oh yeah, and what's with not being able to configure the Brian code completion key sequence. How about *no* key sequence? Brian That's the way every other IDE I've used does it. This is Brian more like semi-automatic code

Re: Which IDE is recommended?

2005-04-28 Thread Ville Vainio
Brian == Brian Beck [EMAIL PROTECTED] writes: Brian Okay, sorry for spamming the newsgroup so much, but I Brian installed 0.9.3 properly and the same issues I mentioned Brian before persist. Code completion for imports or locals don't Brian work at all -- the space thing was

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Ville Vainio wrote: Perhaps you are just being impatient? Also, make sure that Preferences/pydev/code completion has Autocomplete on '.' box checked. Yeah, that option is enabled. I actually just discovered that it does work in the example you give and for other modules in the standard

Re: interactive web graphics

2005-04-28 Thread Fuzzyman
Hello Michael, Eckhoff, Michael A wrote: Hello, I failed to locate a list for pygtk, so I thought I'd ask my question here. Is it possible to write CGI scripts that bring up a GUI (as in GTK+, QT, Tk, ...) or an openGL display that is windowed inside a web browser? The answer would seem

Setting win32 console title from Python

2005-04-28 Thread runes
Hi, I'm trying to set the title of the console window (CMD.EXE) in Windows. I want it set to the basename of the current directory and it should stay after the script has finished. Now, the console title is easily set with the DOS-command 'title NewTitle'. But I'd like to do this from a Python

Re: (PHP or Python) Developing something like www.tribe.net

2005-04-28 Thread Mir Nazim
Ok I get your point. Well actually my application is small in the begining, but then may be will a large one when we want to add more features. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with sending a variable(python) while using html

2005-04-28 Thread Kent Johnson
Hansan wrote: Hi. Sorry forgot to post a non-working example That could be print a href=script.py?id=, variable, ', some text input type=hidden name=eventid value='''+str(variable_name)+''/a I know that it isnt very creative, but I am having a hard time getting html to work together with

Re: (PHP or Python) Developing something like www.tribe.net

2005-04-28 Thread remi
CherryPy and Quixote are for programming in the small May I ask why you say that ? Just because a framework is light and easy doesn't mean it doesn't scale well ... I have not idea how they scale in the large. Well, I do :-) Among many other sites, CherryPy powers the BackOffice system of a

Re: delete will assure file is deleted?

2005-04-28 Thread TZOTZIOY
On Wed, 27 Apr 2005 17:28:04 +0200, rumours say that Fredrik Lundh [EMAIL PROTECTED] might have written: import errno try: ... except OSError, exc: if exc.errno == errno.ENOENT: # file inexistant ... elif exc.errno == errno.EPERM: # no permissions ... make that elif

Re: Internet Explorer, COM+, Javascript and Python

2005-04-28 Thread Roger Upole
Something like this should be close: import win32com.client, pythoncom ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 ie.Navigate('somepagewithjavascript.html') id=ie.Document.Script._oleobj_.GetIDsOfNames('somejsfunction') res=ie.Document.Script._oleobj_.Invoke(id, 0,

Re: Which IDE is recommended?

2005-04-28 Thread Ville Vainio
Brian == Brian Beck [EMAIL PROTECTED] writes: Brian Ville Vainio wrote: Perhaps you are just being impatient? Also, make sure that Preferences/pydev/code completion has Autocomplete on '.' box checked. Brian Yeah, that option is enabled. I actually just discovered

Re: Problem with sending a variable(python) while using html

2005-04-28 Thread Hansan
Thanks for you help, it is working now :D Take care Kent Johnson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hansan wrote: Hi. Sorry forgot to post a non-working example That could be print a href=script.py?id=, variable, ', some text input type=hidden name=eventid

Re: How remove directories with the content in the platform independent way?

2005-04-28 Thread Andy Leszczynski
Jason Mobarak wrote: There's also the shutil module, which is platform independant. http://docs.python.org/lib/module-shutil.html ...see the rmtree function Thanks, this is what I was looking for. A. -- http://mail.python.org/mailman/listinfo/python-list

Getting a list of classes in the current module/auto introspection

2005-04-28 Thread Andy Leszczynski
Hi, I have a following problem. Let's say there is a module which could be imported or run as __main__. It is going to contain hundreds of classes, something like that: import moduleA from moduleB import * class A: pass class B: pass class C: pass [...] I would like to

Re: dynamically generating temporary files through python/cgi

2005-04-28 Thread Michael Hoffman
Michael Hoffman wrote: The easiest way, in my mind would be to store the files in a directory according to the hour they were requested, for example, a file generated between 2 p.m. and 3 p.m. today: http://www.example.com/temp/20050428T14/d41d8cd98f00b204e9800998ecf8427e.html Depending on the

Re: Ron Grossi: God is not a man

2005-04-28 Thread Mike brown
4) I doubt seriously whether God plays a guitar, since guitars are made by men, for men. His Son could theoretically play a guitar. Perhaps He does. Perhaps He doesn't. Only the Father and His Holy Angels know. Perlse. Do you really take this stuf seriously ? It's like the ancient

Re: Setting win32 console title from Python

2005-04-28 Thread Duncan Booth
runes wrote: I'm trying to set the title of the console window (CMD.EXE) in Windows. I want it set to the basename of the current directory and it should stay after the script has finished. Any ideas? I don't think you can do that. Whenever you start an application from the command prompt

Re: Shutting down twisted reacotr

2005-04-28 Thread Operation Latte Thunder
Jason Mobarak [EMAIL PROTECTED] wrote: Why do you want to do this in a thread? What's wrong with reactor.callLater? import time from twisted.internet import reactor def shutdown(): time.sleep(3) print stopping reactor.callFromThread(reactor.stop)

Re: Can .py be complied?

2005-04-28 Thread monkey
Thx very much, I got the point now ( ; The latter. It's not completely self contained, there is an ..exe and some dll files that need to be distributed together. It's explained very clearly by the py2exe web site: http://starship.python.net/crew/theller/py2exe/ Never used google before?

Re: Can .py be complied?

2005-04-28 Thread Pajo
I've just tried to build both console and windows exe and it works just fine monkey wrote: Thx very much, I got the point now ( ; -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about python code distribution...

2005-04-28 Thread Larry Bates
You didn't say what platform, but if it is Windows take a look at Inno Installer. It is a complete installation framework that allows you to package everything into a single setup.exe file. I use a combination of py2exe and Inno to do my apps that are to be distributed. Nothing could be

Re: (PHP or Python) Developing something like www.tribe.net

2005-04-28 Thread Michele Simionato
talking about programming in the large and in the small Well, let me specialize my sentence CherryPy and Quixote are for programming in the small in CherryPy and Quixote are good for programming in the small meaning that these frameworks help you when programming in the small. This

Re: Ron Grossi: God is not a man

2005-04-28 Thread MC05
Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are made by men, for men. His Son could theoretically play a guitar. Perhaps He does. Perhaps He doesn't. Only the Father and His Holy Angels know.

Re: mysql.h: No such file or directory when building MySQL-python

2005-04-28 Thread Andy Dustman
[EMAIL PROTECTED] wrote: I'm trying to build 'MySQL-python-1.2.0' on my Linux FC2: ... gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -march=i386 -mcpu=i686 -D_GNU_SOURCE -fPIC -fPIC -I/usr/include/python2.3 -c _mysql.c -o build/temp.linux-i686-2.3/_mysql.o -I'/usr/include/mysql'

Re: Setting win32 console title from Python

2005-04-28 Thread jay graves
Hmm. From an interactive interpreter this works for me. import os os.system('title Jay') but the title returns to its previous value when I Ctrl-Z out of the process. If I save this as a file and run it, it seems to work without spawning a new window but resets it the title after the program

Re: Getting a list of classes in the current module/auto introspection

2005-04-28 Thread Michele Simionato
Any class has a .__module__ attribute giving the name of the module where the class was defined, so you need something like [c for c in globals() if inspect.isclass(c) and c.__module__ == __main__] Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-28 Thread beliavsky
IMO the fact that so many people ask How can I create executables in Python on Windows indicates that standard batteries included Windows Python distribution is missing a vital battery. There are tools such as py2exe, but this functionality should be built-in, so that a newbie to Python can just

Re: pyqt and Eric 3

2005-04-28 Thread Brian Elmegaard
[EMAIL PROTECTED] writes: http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml Which, afaics, unfortunately requires either that you have msvc or that you compile python and every addon with mingw :-( -- Brian (remove the sport for mail)

Re: Fast plotting?

2005-04-28 Thread Paul F. Kunz
William Park [EMAIL PROTECTED] writes: Russell E. Owen [EMAIL PROTECTED] wrote: Can anyone recommend a fast cross-platform plotting package for 2-D plots? Our situation: We are driving an instrument that outputs data at 20Hz. Control is via an existing Tkinter application (which

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Whenever you start an application from the command prompt the title is modified by appending a dash and the name of the program you started. When the application terminates the title is reset (to remove the name of the running program). So any change to the title will only last until the next

Job openings for scientifically-oriented programmers

2005-04-28 Thread bior_jobs
Positions: Scientific Programmers Location: Department of Radiation Oncology, Division of Bioinformatics and Outcomes Research, Washington University School of Medicine, St. Louis, Missouri Our newly created Division of Bioinformatics and Outcomes Research has immediate openings for

anybody have a CGIXMLRPCRequestHandler example?

2005-04-28 Thread ccurvey
I see the ones in the docs, but I really (apparently) need some usage notes. Something as simple as an echo would probably do the trick. -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Hi Jay. It seems like my requirement is a light edition of your. I like having many console windows open, and to make it easier to switch between them, I like to name them. Todays solution is rather tedious - a batch file that calls a python script that isolates the directory name and stores it

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLE·NEWSGROUP·POST·152

2005-04-28 Thread Please
Report to [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-28 Thread steve.leach
python -o foo.exe foo.py at the command line, and get an executable, without any further effort. Hence making the resulting program useless to users of most operating systems. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting the sender widget's name in function (Tkinter)

2005-04-28 Thread Cameron Laird
In article [EMAIL PROTECTED], Eric Brunel [EMAIL PROTECTED] wrote: On 26 Apr 2005 13:37:29 -0700, infidel [EMAIL PROTECTED] wrote: from Tkinter import Tk, Button def say_hello(event): print 'hello!' print event.widget['text'] root = Tk() button1 = Button(root, text='Button 1')

anonymous functions/expressions without lambda?

2005-04-28 Thread Paul Miller
I see lambda is going away, so I want to use something that will be around for awhile. All I want to do is provide an inline function as an argument to another function. For example, let's say I have a function which binds a key to a function call. I want to do something simple in this

Re: Setting win32 console title from Python

2005-04-28 Thread jay graves
Cool. Let me know if you want a copy of p.py (in all of it's hard-coded glory). I can easily put it under Public Domain and you can copy whatever you want out of it. ... jay -- http://mail.python.org/mailman/listinfo/python-list

Re: Job openings for scientifically-oriented programmers

2005-04-28 Thread Joe Deasy
Email was scrambled by google: Correct email address is: bior _jobs @ yahoo.com (remove spaces). I apologize for that. - Joe Deasy -- http://mail.python.org/mailman/listinfo/python-list

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Michael Hoffman
Paul Miller wrote: I see lambda is going away, so I want to use something that will be around for awhile. All I want to do is provide an inline function as an argument to another function. That's what lambda does. But it's going away, you'll have to use def when it does, unless the

Re: Why Python does *SLICING* the way it does??

2005-04-28 Thread Bjrn Lindstrm
Antoon Pardon [EMAIL PROTECTED] writes: The problem is that the fields in lst are associated with a number that is off by one as they are normally counted. If I go and ask my colleague which field contains some specific data and he answers: the 5th, I have to remind my self I want lst[4]

Re: Setting win32 console title from Python

2005-04-28 Thread Duncan Booth
runes wrote: Hi Jay. It seems like my requirement is a light edition of your. I like having many console windows open, and to make it easier to switch between them, I like to name them. Todays solution is rather tedious - a batch file that calls a python script that isolates the directory

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Paul Miller
Michael Hoffman wrote: That's what lambda does. But it's going away, you'll have to use def when it does, unless the language designers come up with something better. Yeah, I'm using lamda now it works nicely/cleanly. If a lot of the bindings are actually setting variables, you could do

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Michael Hoffman wrote: Paul Miller wrote: I see lambda is going away, so I want to use something that will be around for awhile. All I want to do is provide an inline function as an argument to another function. That's what lambda does. But it's going away, you'll have to use def when

Re: Which IDE is recommended?

2005-04-28 Thread Brian Beck
Ville Vainio wrote: Does this help? Not really, my PYTHONPATH is fine. I found out that modules imported in the format import mx work fine, but from mx import DateTime doesn't work -- it will still only auto-complete when I type mx. instead of realizing that it's in the local scope now. So it's

Re: Which IDE is recommended?

2005-04-28 Thread Matt
Sorry about that Frank. You have to create a project (New -- Project) and add your file to it then Run--Run. This is a bug that slipped past because we do all of our development using projects and hadn't even tried the obvious: open file and run. That fix has made its way to the wx folks, but

Re: Which IDE is recommended?

2005-04-28 Thread Matt
Franz, To ask for help otherwise, use the forums link from http://sourceforge.net/projects/activegrid/ --Matt -- http://mail.python.org/mailman/listinfo/python-list

split question

2005-04-28 Thread alexk
I've a simple question. Why the following: words = [EMAIL PROTECTED]@^%[wordA] [EMAIL PROTECTED].split('[EMAIL PROTECTED]*()_+-=[]{},./') doesn't work? The length of the result vector is 1. I'm using ActivePython 2.4 Alex -- http://mail.python.org/mailman/listinfo/python-list

Re: split question

2005-04-28 Thread Grant Edwards
On 2005-04-28, alexk [EMAIL PROTECTED] wrote: I've a simple question. Why the following: words = [EMAIL PROTECTED]@^%[wordA] [EMAIL PROTECTED].split('[EMAIL PROTECTED]*()_+-=[]{},./') doesn't work? But it does work. Your input string (the one on the left) does not contain the delimiter

Re: Ron Grossi: God is not a man

2005-04-28 Thread Donald L McDaniel
MC05 wrote: Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are made by men, for men. His Son could theoretically play a guitar. Perhaps He does. Perhaps He doesn't. Only the Father and His Holy

Re: creating very small types

2005-04-28 Thread Bengt Richter
On Thu, 28 Apr 2005 05:07:34 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: ... some not quite correct code ;-/ (I copy/pasted and created an illusion. My code dict has no EOS, so I decode pad zero bits as code that a single zero stands for ('a' in this case) so that was an oversight. I should

Re: Python or PHP?

2005-04-28 Thread Alan Little
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... John Bokma wrote: Alan Little wrote: Steve Holden [EMAIL PROTECTED] wrote: Your statement then becomes select * from foo where bar=1; drop table foo which is clearly not such a good idea. I'm sure

Re: split question

2005-04-28 Thread Michael Spencer
alexk wrote: I've a simple question. Why the following: words = [EMAIL PROTECTED]@^%[wordA] [EMAIL PROTECTED].split('[EMAIL PROTECTED]*()_+-=[]{},./') doesn't work? The length of the result vector is 1. I'm using ActivePython 2.4 Alex Do you mean, why doesn't it split on every character in

Re: Ron Grossi: God is not a man

2005-04-28 Thread MC05
Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] MC05 wrote: Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are made by men, for men. His Son could theoretically play

OOP

2005-04-28 Thread demon_slayer2839
Hey yall, I'm new to Python and I love it. Now I can get most of the topics covered with the Python tutorials I've read but the one thats just stumping me is Object Orientation. I can't get the grasp of it. Does anyone know of a good resource that could possibly put things in focus for me? Thanks.

Re: Getting the sender widget's name in function (Tkinter)

2005-04-28 Thread tiissa
Cameron Laird wrote: In article [EMAIL PROTECTED], Eric Brunel [EMAIL PROTECTED] wrote: Unfortunately, making a binding to Button-1 on Button widgets does not have the same behavior as setting their 'command' option. Without unraveling my own confusion about who has said what to whom, does

Re: OOP

2005-04-28 Thread beliavsky
[EMAIL PROTECTED] wrote: Hey yall, I'm new to Python and I love it. Now I can get most of the topics covered with the Python tutorials I've read but the one thats just stumping me is Object Orientation. I can't get the grasp of it. Does anyone know of a good resource that could possibly put

Re: split question

2005-04-28 Thread alexk
Yes, all of you are right. Thank you all for your answers - I'll use a regex. -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I sort a bunch of lists over multiple fields?

2005-04-28 Thread googleboy
I'd be just such a newbie; I don't understand why it would matter if I left the book instance referencing itself However these wonderful responses have gotten me a very long way towards my goal. I just have a couple of quick questions. firstly, I am trying hard to figure out how to create

Re: OOP

2005-04-28 Thread Charles Krug
On 28 Apr 2005 10:34:44 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hey yall, I'm new to Python and I love it. Now I can get most of the topics covered with the Python tutorials I've read but the one thats just stumping me is Object Orientation. I can't get the grasp of it. Does anyone

Re: how can I sort a bunch of lists over multiple fields?

2005-04-28 Thread Philippe C. Martin
How about using the csv module instead of splitting ? [EMAIL PROTECTED] wrote: What you want I guess is to read first all lines of the file into a string as you did, and then let the split method split it based on newlines only - see example below. Then you use split again to put all

why import wx doesn't work?

2005-04-28 Thread monkey
I just learn to make a blank windows frame with python and wxpython. I found the statment import wx cannot work as the original from wxPython.wx import *. I see in the readme file of wxpython that if I install it as the default one, I can use import wx instead of the long one. What is wrong? The

Re: Getting the sender widget's name in function (Tkinter)

2005-04-28 Thread infidel
Here's a slight variation of tiissa's solution that gives the callable a reference to the actual widget instead of just it's name: from Tkinter import Tk, Button class say_hello: def __init__(self, widget): self.widget = widget def __call__(self): print 'Hello,',

Re: how can I sort a bunch of lists over multiple fields?

2005-04-28 Thread Steven Bethard
googleboy wrote: firstly, I am trying hard to figure out how to create a new file with the list rather than print to standard out. I haev done this: for book in books: print book # just to be sure it works as I expect sort1 = open(r'D:\path to\sort1.csv', 'w+') print

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Michael Hoffman
Dave Benjamin wrote: I think you meant to write something like this: def attrsetter(obj, name, value): def _return_func(): return setattr(obj, name, value) return _return_func Sure did. Sorry. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I sort a bunch of lists over multiple fields?

2005-04-28 Thread Lonnie Princehouse
I'd be just such a newbie; I don't understand why it would matter if I left the book instance referencing itself It's just kind of sloppy and unnecessary to have self.self firstly, I am trying hard to figure out how to create a new file with the list rather than print to standard out.

Re: Getting the sender widget's name in function (Tkinter)

2005-04-28 Thread Cameron Laird
In article [EMAIL PROTECTED], tiissa [EMAIL PROTECTED] wrote: . . . So far, the OP is proposed the choice to either use the event/bind mecanism or use different callbacks for his different buttons (either with the method I

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Cameron Laird
In article [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] wrote: Paul Miller wrote: For example, let's say I have a function which binds a key to a function call. I want to do something simple in this function call, and I have a lot of bindings, so I don't want to have a ton of tiny

Re: Getting the sender widget's name in function (Tkinter)

2005-04-28 Thread tiissa
Cameron Laird wrote: In article [EMAIL PROTECTED], tiissa [EMAIL PROTECTED] wrote: So far, the OP is proposed the choice to either use the event/bind mecanism or use different callbacks for his different buttons (either with the method I proposed or not). Is there general understanding that use

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Paul Miller
Michael Hoffman wrote: Dave Benjamin wrote: I think you meant to write something like this: def attrsetter(obj, name, value): def _return_func(): return setattr(obj, name, value) return _return_func Sure did. Sorry. You guys have been very helpful! While on the subject, is there

Re: Setting win32 console title from Python

2005-04-28 Thread runes
Hi Duncan, sorry, I was unprecise. I'm thinking of a script, called t.py that can be used in the console like an ordinary command. Som if I change directory from S:\scripts to d:\projects and execute the script the title changes to projects etc. I have that functionality today with a

embedding an interactive console

2005-04-28 Thread Paul Miller
I did this YEARS ago with Python 1.5, and I recall it being slightly painful. I have an embedded Python interpreter and I want to provide an interactive console (implemented in my GUI application with a Qt TextEdit widget). I can handle the GUI part of it, but I'm wondering what the latest

Can't run BLT program more than once?

2005-04-28 Thread Todd Krein
I'm running activestate Python 2.4 for windows, and the latest BLT, under XP. I'm using pythonWin as my environment. When I run my plotting program the first time, it works just fine. If I exit out (normally), and then run it again from PythonWin, I get the following error. It's as if something

Can'r run BLT twice?

2005-04-28 Thread Todd Krein
I'm running PythonWin on XP. When I run my plotter program the first time, it works fine. The second time I run it, I get the following error. If I exit PythonWin, and restart, I can again run it once. Any ideas? Error: 1 TclError Exception in Tk callback Function: bound method

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Paul Miller wrote: Michael Hoffman wrote: Dave Benjamin wrote: I think you meant to write something like this: def attrsetter(obj, name, value): def _return_func(): return setattr(obj, name, value) return _return_func Sure did. Sorry. You guys have been very helpful! While on the

Re: Internet Explorer, COM+, Javascript and Python

2005-04-28 Thread J Correia
Roger Upole [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Something like this should be close: import win32com.client, pythoncom ie=win32com.client.Dispatch('internetexplorer.application') ie.Visible=1 ie.Navigate('somepagewithjavascript.html')

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Michael Hoffman
Paul Miller wrote: While on the subject, is there an equivalent for methodcaller? ie. if I want to bind a function which calls a specific method of an object with a specific parameter? def funccaller(func, *args, **kwargs): def _return_func(): return func(*args, **kwargs) return

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Dave Benjamin wrote: You could use a combination of bound methods and the curry function defined in the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549 The examples in the discussion do just that. Also, in the CVS version of Python, there's a new module called

Re: why import wx doesn't work?

2005-04-28 Thread Peter Hansen
monkey wrote: I just learn to make a blank windows frame with python and wxpython. I found the statment import wx cannot work as the original from wxPython.wx import *. I see in the readme file of wxpython that if I install it as the default one, I can use import wx instead of the long one. What

Re: dynamically generating temporary files through python/cgi

2005-04-28 Thread Tiziano Bettio
poisondart wrote: Is there a way to dynamically generate temporary files (such as an html, xml or text file) in Python? I'm not sure if I'm explaining myself clearly as I've no clue how to describe this mechanism. I've seen it on certain websites that will generate a file under certain parameters

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Dave Benjamin
Cameron Laird wrote: In article [EMAIL PROTECTED], Peter Hansen [EMAIL PROTECTED] wrote: This meets your requirements as stated: def temp(): foo.var = 1 bind('a', temp) def temp(): foo.var = 2 bind('b', temp) del temp Ewww! *When* is lambda going bye-bye? I apparently haven't been paying

Re: anonymous functions/expressions without lambda?

2005-04-28 Thread Paul Miller
Michael Hoffman wrote: Paul Miller wrote: While on the subject, is there an equivalent for methodcaller? ie. if I want to bind a function which calls a specific method of an object with a specific parameter? def funccaller(func, *args, **kwargs): def _return_func(): return

Re: Is this a bug?

2005-04-28 Thread Aahz
In article [EMAIL PROTECTED], Fredrik Lundh [EMAIL PROTECTED] wrote: mapping += to extend is a design mistake (I guess someone got a little carried away). There were two use cases that drove augmented assignment (I know you know this -- but other people probably do not): reallylongvariablename

Re: Working with method-wrapper objects

2005-04-28 Thread Dr. Peer Griebel
Peer Dr. Griebel wrote: I think I was a little bit unspecific in my last mail. I would like to see some description about method-wrapper and wrapper_descriptor objects. I dont' understand the following behaviour: type([].__str__) type 'method-wrapper' type(object.__str__) type

Re: Can .py be complied?

2005-04-28 Thread jfj
[EMAIL PROTECTED] wrote: IMO the fact that so many people ask How can I create executables in Python on Windows indicates that standard batteries included Windows Python distribution is missing a vital battery. There are tools such as py2exe, but this functionality should be built-in, so that a

Re: regex over files

2005-04-28 Thread Skip Montanaro
Bengt To be fairer, I think you'd want to hoist the re compilation out Bengt of the loop. The re module compiles and caches regular expressions, so I doubt it would affect the runtime of either version. Bengt But also to be fairer, maybe include the overhead of splitting Bengt

  1   2   >