Re: Addressing the last element of a list

2005-11-16 Thread Antoon Pardon
Op 2005-11-15, Bengt Richter schreef <[EMAIL PROTECTED]>: > On 15 Nov 2005 08:51:59 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >>Op 2005-11-14, Bengt Richter schreef <[EMAIL PROTECTED]>: > [...] >>> You may be interested in reviewing >>> >>> >>> http://groups.google.com/group/comp.lang.py

Re: Is there any Iterator type example?

2005-11-16 Thread Fredrik Lundh
Thomas Moore wrote: > But what I really want to know is how to use __iter()__ and next() in a > class with an example. here's a simple iterator class that iterators over itself once: class Iterator1: def __init__(self, size=10): self.count = 0 self.size = size def __iter_

Re: Proposal for adding symbols within Python

2005-11-16 Thread Pierre Barbier de Reuille
Rocco Moretti a écrit : [...] > > > I did, but I still don't see why it is an argument against using > strings. The point you may not appreciate is that (C)Python already uses > strings to represent names, as an important part of its introspective > abilities. > Well, I'm well aware of that, bu

Re: Python/ASP local characters and 500 server error

2005-11-16 Thread Fredrik Lundh
Martin wrote: > Using Python / ASP on a IIS server with Mark Hammond's win32 extensions, > i have the following problem. > > All occurences of local characters (fx. danish æøå) in comments or in > strings result in a HTTP/1.1 500 Server Error. > > Is there a solution to this problem? the first th

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-16 Thread Tim Roberts
"Roger Erens" <[EMAIL PROTECTED]> wrote: > >I remember that the first time I read about Python as a programming >language was when reading the W3C's HTML 4.01 specification a few years >ago. In the section on objects, images and applets >(http://www.w3.org/TR/html401/struct/objects.html) an example

Re: Sending an event from a python COM server to a VB COM client

2005-11-16 Thread Gary Kshepitzki
Thank you Steve. I have already went over that book, I didn't find there an example of sending events from a python server to a VB client (just direct function calls from the VB client to the Python server, which is trivial). And in any case, since I am a newbie both in VB and in Python, I am re

Re: how to bypass firewall

2005-11-16 Thread Fuzzyman
Parth wrote: > Hello everyone, > I need some help regrading byassing firewalls.My college has internet > aces but it prevents us from dowloading music(*.mp3,*.mid,etc.)from the > net.I use a win xp sp2 and browse using ie 6. Is there any way how i > can dowload music on my computer using this conn

Re: Shutdown hook

2005-11-16 Thread Duncan Booth
Lawrence Oluyede wrote: > Il 2005-11-15, Ben Finney <[EMAIL PROTECTED]> ha > scritto: >> Steve <[EMAIL PROTECTED]> wrote: >>> Does any one know if python has the ability to run a shutdown hook. >> >> When the Python runtime system wants to exit, it raises a SystemExit >> exception. >> >> Catch th

Is there any Iterator type example?

2005-11-16 Thread Thomas Moore
Hi: Is there any example about how to use the Iterator type? --Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: how to bypass firewall

2005-11-16 Thread Fredrik Lundh
Gregory Bond wrote: > I need help getting my college degree. I downloaded a hack to bypass > the college internet firewall and the college system admins found out > and I got expelled. http://www.google.com/search?q=buy+a+degree (if not else, that link will show you how many sponsored links goo

using openurl to log into Yahoo services

2005-11-16 Thread joe_public34
Hello all, I'm trying to write a script to log into Yahoo! (mail, groups, etc), but when I pass the full URL with all form elements via Python, I get a resutling 400 - Bad Request page. When I just plop the full URL into a browser, it works perfectly. Is there something I need to specify in pytho

Re: Default method arguments

2005-11-16 Thread [EMAIL PROTECTED]
What you want is essentially : if parm_x is not supplied, use self.val_x So why not just express it clearly at the very beginning of the function : def f(self, parm_x=NotSupplied, parm_y=NotSupplied ,,,) if parm_x is NotSupplied: parm_x = self.val_x if parm_y is NotSupplied: parm_y = self.va

Re: Python obfuscation

2005-11-16 Thread Ben Sizer
Mike Meyer wrote: > "Ben Sizer" <[EMAIL PROTECTED]> writes: > > In my > > case, providing a free download of any lost executables or data upon > > presentation of a legitimate license key should be adequate. > > My special handling for such > things - and *especially* for entertainment software, wh

Re: how to bypass firewall

2005-11-16 Thread Frithiof Andreas Jensen
"Parth" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello everyone, > I need some help regrading byassing firewalls.My college has internet > aces but it prevents us from dowloading music(*.mp3,*.mid,etc.)from the > net. Then Don't - The firewall, being lame as those things are,

How to write an API for a Python application?

2005-11-16 Thread Gary Kshepitzki
Hello I would like to create an API for a piece of Python code. The API is for use by non Python code. It should support interaction in both directions, both accessing functions on the API and the ability for the API to raise events on its client. What is the best way to do that? I though of doin

Re: Default method arguments

2005-11-16 Thread Duncan Booth
Steven D'Aprano wrote: > I would like to see _marker put inside the class' scope. That prevents > somebody from the outside scope easily passing _marker as an argument > to instance.f. It also neatly encapsulates everything A needs within > A. Surely that makes it easier for someone outside the s

Re: Sending an event from a python COM server to a VB COM client

2005-11-16 Thread Josef Meile
Hi Gary, > I am trying to send an event from a Python COM server to a VB (or VB.NET) > COM client. > I am a newbie both in VB and in python. > Can anyone give me a simple (but complete) code example both of the Python > server side and the VB client side for raising a single event. Do you mean i

Re: Python/ASP local characters and 500 server error

2005-11-16 Thread Martin
Fredrik Lundh wrote: > > http://www.python.org/peps/pep-0263.html > Using the info from pep-0263, adding a line in the start for the file: # -*- coding: -*- works for .py files, but the error i get is from an .asp file. The logfile contains this info: ASP_0147|500_Server_Error 500 A so

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread Paul Boddie
Neal Norwitz wrote: > Valgrind actually runs on PPC (32 only?) and amd64, but I don't think > that's the way to go for this problem. +1 for understatement of the week. > Here's a really screwy thought that I think should be portable to all > Unixes which have dynamic linking. LD_PRELOAD. Simila

JMS yet again

2005-11-16 Thread [EMAIL PROTECTED]
I've seen various posts over the years asking if python can be used to communicate with JMS queues (whether MQ series, Jboss queues etc etc). I've seen solutions such as pymqi (good for MQ, but not for jboss I believe), and JPype. This must seem an obvious question, but has anyone actually tried

Re: newbie - How do I import automatically?

2005-11-16 Thread Claudio Grondi
Just edit the first lines of %SystemDrive%\Python24\Lib\idlelib\PyShell.py yourself (not tested, but I have customized Idle intitial message using it and it worked ok - after new Python installation I overwrite this file with my own version to keep this customization.) Hope this helps. Claudio <

Re: is parameter an iterable?

2005-11-16 Thread Steven D'Aprano
On Tue, 15 Nov 2005 21:54:07 -0500, Dan Sommers wrote: > On Wed, 16 Nov 2005 13:12:38 +1100, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> try: >> for item in obj: >> do_stuff(item) >> except TypeError, msg: >> if msg == "iteration over non-sequence": >> handle_non

Re: Default method arguments

2005-11-16 Thread Steven D'Aprano
On Wed, 16 Nov 2005 02:59:15 +, Bengt Richter wrote: > On Tue, 15 Nov 2005 23:51:18 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >>> I would like to see _marker put inside the class' scope. That prevents >>> somebody from the outside scope easily passing _marker as an argument >>> to ins

Re: Addressing the last element of a list

2005-11-16 Thread Antoon Pardon
Op 2005-11-15, Mike Meyer schreef <[EMAIL PROTECTED]>: > Antoon Pardon <[EMAIL PROTECTED]> writes: Like having an assignment operator (let use @= for it) next to a (re)bind operator. We could then have something like the following. a = 5 b = a a @= 7 b ==> would r

[Twisted-Python] ssh tunnel

2005-11-16 Thread Yves Glodt
(I asked about this several times in the twisted list but never got an answer, maybe here I'll more happy...) Hi, I'm new to conch and I wonder if somebody could point me to an example of how to create an ssh tunnel with conch to forward a connection (e.g. database or vnc) through that tunnel (i

Re: Default method arguments

2005-11-16 Thread Steven D'Aprano
On Wed, 16 Nov 2005 09:48:47 +, Duncan Booth wrote: > Steven D'Aprano wrote: >> I would like to see _marker put inside the class' scope. That prevents >> somebody from the outside scope easily passing _marker as an argument >> to instance.f. It also neatly encapsulates everything A needs withi

Re: Is there any Iterator type example?

2005-11-16 Thread Thomas Moore
Hi: Thanks, it does help. Besides, I search the web and find several other examples, too. --Thomas - Original Message - From: "Fredrik Lundh" <[EMAIL PROTECTED]> To: Sent: Wednesday, November 16, 2005 4:02 PM Subject: Re: Is there any Iterator type example? > Thomas Moore wrote: > > >

Re: Proposal for adding symbols within Python

2005-11-16 Thread Ben Sizer
Grant Edwards wrote: > On 2005-11-15, Ben Sizer <[EMAIL PROTECTED]> wrote: > > > > myObject.value = 'value1' > > > > #... 100 lines of code elided... > > > > if myObject.value == 'Value1': > > do_right_thing() > > else: > > do_wrong_thing() > > > > I don't actually think string use is 'unte

Re: is parameter an iterable?

2005-11-16 Thread Steven D'Aprano
On Tue, 15 Nov 2005 21:59:44 -0500, Roy Smith wrote: > In article <[EMAIL PROTECTED]>, > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> try: >> for item in obj: >> do_stuff(item) >> except TypeError, msg: >> if msg == "iteration over non-sequence": >> handle_non_iter

Re: Default method arguments

2005-11-16 Thread Fredrik Lundh
Duncan Booth wrote: > What you really want is for the marker to exist only in its own little > universe, but the code for that is even messier: > > class A(object): >def __init__(self, n): >self.data =n >def make_f(): >marker = object() >def f(self, x = _marker): N

Re: Data Transmission Crash Course Required

2005-11-16 Thread Frithiof Andreas Jensen
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > exchange. I am looking for a quick-n-dirty approach, upon which I can > certainly expand by further reading Python documentation. Also, if > anyone can recommend an online resource for learning more about TCP/IP > and the like (a prog

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-16 Thread Simon Brunning
On 16/11/05, Nathan Pinno <[EMAIL PROTECTED]> wrote: > It worked, but unfornately I can't use this line as it brings up errors: > > from Tkinter (or pygame) import * > > Anyway around this little bug? What's the error? -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blo

Re: using openurl to log into Yahoo services

2005-11-16 Thread Dan Sommers
On Tue, 15 Nov 2005 16:08:06 -, "joe_public34" <[EMAIL PROTECTED]> wrote: > Hello all, > I'm trying to write a script to log into Yahoo! (mail, groups, etc), > but when I pass the full URL with all form elements via Python, I get > a resutling 400 - Bad Request page. When I just plop the full

Re: Default method arguments

2005-11-16 Thread Duncan Booth
Steven D'Aprano wrote: > My philosophy is, any time you have an object that has a magic meaning > (e.g. as a sentinel), don't tempt your users to try to use it as if it > were an ordinary object. In that case the simplest thing is to give _marker a more appropriate name such as '_use_late_bound_

Re: Data Transmission Crash Course Required

2005-11-16 Thread The Prophet
Thank you both for the suggestions. I will look into both of them, as I am eager to learn new things about Python. -- http://mail.python.org/mailman/listinfo/python-list

special method in module

2005-11-16 Thread Jan Procházka
Hello, can have modules special methods? althouht i think that no, i tried following example and i don't, why it don't works: file m2.py (imported module) class Module: def __getitem__(self,index): return index module=Module() __getitem__=module.__getitem

Re: Reinvent no more forever

2005-11-16 Thread Fuzzyman
Ben Finney wrote: > Howdy all, > Hello, > On dirtSimple.org[0], PJE wrote: > > "Why is Python "blessed" with so much reinvention? Because it's > often cheaper to rewrite than to reuse. Python code is easy to > write, but hard to depend on. You pretty much have to: > > 1. limit

Re: special method in module

2005-11-16 Thread Fredrik Lundh
Jan Procházka wrote: > can have modules special methods? no, but you can replace the module object with something that can have special methods: $ more module.py import sys class Module: def __getitem__(self, value): return value sys.modules[__name__] = Module() $ python >>> impor

Re: How to write an API for a Python application?

2005-11-16 Thread jmdeschamps
While not sure of the behavior you are trying to achieve, XML-RPC comes to mind. But it's based on HTTP protocol in which the client puts request to the server which has to respond. The server cannot initiate interactions. XML-RPC is both widely avalaible, and very easy to implement. NOTE: in ord

Re: Reinvent no more forever

2005-11-16 Thread Ben Finney
Fuzzyman <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > On dirtSimple.org[0], PJE wrote: > > > > [...] Python code is easy to write, but hard to depend on. You > > pretty much have to: > > > > 1. limit yourself to platforms with a suitable packaging > > system, > >

Re: How to write an API for a Python application?

2005-11-16 Thread Gary Kshepitzki
Thanks Its an interesting solution but I need a more closely coupled solution, with real time events, so the communication really has to be 2 ways, and not by polling. Thanks for putting the time and though. Gary <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > While not sure of th

Re: special method in module

2005-11-16 Thread Jan Procházka
Thanks, probably you are right, hacking python in my situation is not neccessary... >Jan Procházka wrote: > > > >>can have modules special methods? >> >> > >no, but you can replace the module object with something that can have >special methods: > >$ more module.py >import sys > >class Modu

initialising a list of lists

2005-11-16 Thread Peter Kleiweg
This does not what I want it to do: >>> a = [[]] * 6 >>> a[3].append('X') >>> a [['X'], ['X'], ['X'], ['X'], ['X'], ['X']] This does what I want: >>> b = [[] for _ in range(6)] >>> b[3].append('X') >>> b [[], [], [], ['X'], [], []] The first is clear and wrong.

Re: initialising a list of lists

2005-11-16 Thread Fredrik Lundh
Peter Kleiweg wrote: > This does not what I want it to do: > >>>> a = [[]] * 6 >>>> a[3].append('X') >>>> a >[['X'], ['X'], ['X'], ['X'], ['X'], ['X']] > > This does what I want: > >>>> b = [[] for _ in range(6)] >>>> b[3].append('X') >>>> b >[[], [], [], ['X'], [],

Re: initialising a list of lists

2005-11-16 Thread Peter Kleiweg
Fredrik Lundh schreef op de 16e dag van de slachtmaand van het jaar 2005: > Peter Kleiweg wrote: > > > This does not what I want it to do: > > > >>>> a = [[]] * 6 > >>>> a[3].append('X') > >>>> a > >[['X'], ['X'], ['X'], ['X'], ['X'], ['X']] > > > > This does what I want: > > > >

Problem with processing PyCommandEvent

2005-11-16 Thread Karsten
Hello, I've got a question about Python Events. I want to generate a PyCommandEvent (included in the wx Package). This PyCommandEvent ought to be called when a method/function is called. I've seen some examples in the www how I can call the Event when an other Event is called. But this is not

Re: Shutdown hook

2005-11-16 Thread wangminghua
great. It's a good idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: initialising a list of lists

2005-11-16 Thread Cyril Bazin
Hello, >>> b = [[] for _ in xrange(6)] # <- note the xrange! >>> b[3].append('X') >>> b [[], [], [], ['X'], [], []] This syntax might be less hairy but could be better when you use large table. You can hide this syntax by making a function: def buildMatrix(nbRows):     return [[] for _ in xrange

Re: is parameter an iterable?

2005-11-16 Thread Rick Wotnaz
Steven D'Aprano <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > def foo(inputVal): > try: > for val in inputVal: > # do stuff > except TypeError, msg: > if msg == "iteration over non-sequence": > # handle non-iterable case > else: >

Re: initialising a list of lists

2005-11-16 Thread Daniel Dittmar
Peter Kleiweg wrote: > This does not what I want it to do: > > >>> a = [[]] * 6 > >>> a[3].append('X') > >>> a > [['X'], ['X'], ['X'], ['X'], ['X'], ['X']] > > This does what I want: > > >>> b = [[] for _ in range(6)] > >>> b[3].append('X') > >>> b > [[], [], [],

Re: 3-dimensional plot in Python?

2005-11-16 Thread François Pinard
[Frithiof Andreas Jensen] > [EMAIL PROTECTED] >> I want to make a 3d plot. x is a vector(discrete), y is also >> a vector(discrete), for each pairwise x,y I have a value z(x,y)(it is >> not a function, just discrete values for each pair of x,y). I want >> to show them on a two dimensional plo

Re: How to write an API for a Python application?

2005-11-16 Thread Paul Boddie
Gary Kshepitzki wrote: > I would like to create an API for a piece of Python code. The API is for use > by non Python code. > It should support interaction in both directions, both accessing functions > on the API and the ability for the API to raise events on its client. > What is the best way to

Re: Python obfuscation

2005-11-16 Thread Ed Jensen
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I'm not sure if that is meant to be a rhetorical > question or not, but something of the order of 95% of > all software written is never distributed to others, > and so copyright or the lack of copyright is not an issue. Can you cite your source(s) f

newbie - Does IDLE care about sitecustomize.py?

2005-11-16 Thread bobueland
I have the following test script in the file customize.py # C:\Python24\Lib\site-packages\sitecustomize.py print "test text from sitecustomize" If start Python from command prompt I get C:\Python24>python test in sitecustomize Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread Nicola Larosa
> On the subject of memory statistics, I'm surprised no-one has mentioned > "top" in this thread (as far as I'm aware): I would have thought such > statistics would have been available to "top" and presented by that > program. Talking about "top", this article may be useful: On measuring memory u

Re: is parameter an iterable?

2005-11-16 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Rick Wotnaz <[EMAIL PROTECTED]> wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > def foo(inputVal): > > try: > > for val in inputVal: > > # do stuff > > except TypeError, msg: > > if msg ==

Re: Python gui

2005-11-16 Thread batfree
Now GTK can use the local theme.You can choose the local theme to make your application windows style on Winodws and Mac likely on mac os. -- http://mail.python.org/mailman/listinfo/python-list

Creating (rather) generic plugin framework?

2005-11-16 Thread Edvard Majakari
Hi, My idea is to create a system working as follows: each module knows path to plugin directory, and that directory contains modules which may add hooks to some points in the code. Inspired by http://www.python.org/pycon/2005/papers/7/pyconHooking.html I would create a class like this: class P

Re: Python obfuscation

2005-11-16 Thread petantik
Ben Sizer wrote: > Mike Meyer wrote: > > "Ben Sizer" <[EMAIL PROTECTED]> writes: > > > Decompyle (http://www.crazy-compilers.com/decompyle/ ) claims to be > > > pretty advanced. I don't know if you can download it any more to test > > > this claim though. > > > > No, it doesn't claim to be advance

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread Jack Diederich
On Tue, Nov 15, 2005 at 10:10:42PM -0800, Neal Norwitz wrote: > Alex Martelli wrote: > > matt <[EMAIL PROTECTED]> wrote: > > > > > Perhaps you could extend Valgrind (http://www.valgrind.org) so it works > > > with python C extensions? (x86 only) > > > > Alas, if it's x86 only I won't even look in

Re: newbie - How do I import automatically?

2005-11-16 Thread bobueland
I tried to put the line from btools import * in several places in PyShell.py but to now avail. It does not work, IDLE does not execute it??? Bob -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 16)

2005-11-16 Thread Cameron Laird
QOTW: "You can tell everything is well in the world of dynamic languages when someone posts a question with nuclear flame war potential like 'python vs. ruby' and after a while people go off singing hymns about the beauty of Scheme..." - vdrab "ctypes completely rocks." - Grant Edwards Mich

ANN: Django 0.90

2005-11-16 Thread Adrian Holovaty
After a months-long "pre-release" period, we're pleased to announce the first release of Django, the Web framework for perfectionists (with deadlines). Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. It lets you write high-quality Web apps

ANN: Django 0.90

2005-11-16 Thread Adrian Holovaty
After a months-long "pre-release" period, we're pleased to announce the first release of Django, the Web framework for perfectionists (with deadlines). Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. It lets you write high-quality Web apps

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread Alex Martelli
Paul Boddie <[EMAIL PROTECTED]> wrote: > Neal Norwitz wrote: > > Valgrind actually runs on PPC (32 only?) and amd64, but I don't think > > that's the way to go for this problem. > > +1 for understatement of the week. > > > Here's a really screwy thought that I think should be portable to all > >

HTML generation vs PSP vs Templating Engines

2005-11-16 Thread pkassianidis
Hello everybody, I am in the process of writing my very first web application in Python, and I need a way to generate dynamic HTML pages with data from a database. I have to say I am overwhelmed by the plethora of different frameworks, templating engines, HTML generation tools etc that exist. Aft

Re: initialising a list of lists

2005-11-16 Thread Fredrik Lundh
Peter Kleiweg wrote: >> http://www.python.org/doc/faq/programming.html#how-do-i-create-a-multidimensional-list > > In other words: no there isn't. For people who actually knows Python, a list comprehension is clear and obviously correct. For people who actually knows Python, your first solution

Re: Script to export MySQL tables to csv

2005-11-16 Thread Jandre
Thnaks to everybody for their input. I have found a quick fix for now. MySQL dump allows me to export the data to XML which can easily be compared. This will help me for now and the project will have to wait until I have some more time. Regards Jandre -- http://mail.python.org/mailman/listinfo/

Re: A way for closing an app monitor

2005-11-16 Thread elbertlev
//So my solution (need help on this) is that I have been thinking on letting the monitor listen for socket connection. Through this, the main app can tell him to close when the main app closes correctly. Do you think this is well thought? Any suggestions? This is the only solution you have to cons

Re: is parameter an iterable?

2005-11-16 Thread Fredrik Lundh
Rick Wotnaz wrote. > ... which leads me to belive that 'msg' is not type(str). It can be > coerced (str(msg).find works as expected). But what exactly is msg? > It appears to be of , and does not test equal to a > string. it's an instance of the exception type, of course. ::: if you do rai

Re: How to write an API for a Python application?

2005-11-16 Thread Eric Brunel
On 16 Nov 2005 06:18:05 -0800, Paul Boddie <[EMAIL PROTECTED]> wrote: > Gary Kshepitzki wrote: >> I would like to create an API for a piece of Python code. The API is for use >> by non Python code. >> It should support interaction in both directions, both accessing functions >> on the API and the

Re: python and VisualFox dbf

2005-11-16 Thread elbertlev
A hint :) Is ADO supported? -- http://mail.python.org/mailman/listinfo/python-list

Python, Linux, Desktop Environment

2005-11-16 Thread jeremyvoros
So, I've written my first GUI app in python. I've turned it into a binary .exe and .app that runs on Windows and Mac respectively, but on my Linux box, where I wrote the thing, I still have to drop to the command line and ./myscript.py. What can I do to make it a "click and run" sort of applicati

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-16 Thread Alex Martelli
Tim Roberts <[EMAIL PROTECTED]> wrote: ... > Internet Explorer will allow any registered ActiveScript language to be > used in a web page. Python qualifies. In the latest Win32 extensions, > there is a script in win32comext/axscript/client/pyscript.py that will > register Python as an ActiveSc

Re: AJAX => APAX? Or: is there support for python in browsers?

2005-11-16 Thread Michael Schneider
Alex, Good point. Can python be used to write firefox extensions that could be called from javascript? 1) javascript would come in on the HTML page 2) javascript would communication with the Extension API 3) the extension would be written in python That way, you would only need to make your e

Newbie wxPython ListCtrl Question

2005-11-16 Thread Todd7
I am new to python and to wxWindows. I have tried searching google, reading the documentation and trying to figure out some of the examples, but I am stumped as to how to get information out of a listctrl at a certain row and column. I tried to write a simple example to learn to work with the

numarray / gcc woes on Darwin

2005-11-16 Thread Andi Petculescu
Hi all, I am a new convert to Mac OSX. I want to start using python under darwin and I need to install numarray. I've downloaded and extracted "numarray-1.4.1" in the python folder, installed gcc 4.0 from the OSX disc. When I run "python setup.py install" i still get an error message saying that g

Re: Newbie question: string replace

2005-11-16 Thread Don
Diez B. Roggisch wrote: > [EMAIL PROTECTED] wrote: > > I have a config file with the following contents: > > service A = { > > params { > > dir = "c:\test", > > username = "test", > > password = "test" > > } > > } > > > > I want to find username and replace the value with another v

Re: How to write an API for a Python application?

2005-11-16 Thread dwelch
Gary Kshepitzki wrote: > Hello > I would like to create an API for a piece of Python code. The API is for use > by non Python code. > It should support interaction in both directions, both accessing functions > on the API and the ability for the API to raise events on its client. > What is the be

Re: derived / base class name conflicts

2005-11-16 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > so the following would not result in any conflicts > > class A: >def __init__(self): > self.__i= 0 > > class B(A): >def __init__(self): > A.__init__(self) > self.__i= 1 > Be careful here. The above won't result in any conflicts, but related

RE: Reinvent no more forever

2005-11-16 Thread Robert Brewer
Ben Finney wrote: > I hold up all existing public source code repositories as evidence > against your prediction. Reinventing the wheel is distressingly > common, and a dependency tool isn't going to stop that. Is there ever a point at which one decides that "unusable dependency tools" are distres

path module / class

2005-11-16 Thread [EMAIL PROTECTED]
Hi there, I haven't seen this topic pop up in a while, so I thought I'd raise it again... What is the status of the path module/class PEP? Did somebody start writing one, or did it die? I would really like to see something like Jason Orendorff's path class make its way into the python standard

Re: Proposal for adding symbols within Python

2005-11-16 Thread Rocco Moretti
Pierre Barbier de Reuille wrote: > Rocco Moretti a écrit : > [...] > >> >>I did, but I still don't see why it is an argument against using >>strings. The point you may not appreciate is that (C)Python already uses >>strings to represent names, as an important part of its introspective >>abilities.

Re: Cursor Position.

2005-11-16 Thread snoe
This script should be a good start: from ctypes import * import time PUL = POINTER(c_ulong) class KeyBdInput(Structure): _fields_ = [("wVk", c_ushort), ("wScan", c_ushort), ("dwFlags", c_ulong), ("time", c_ulong), ("dwExtraInfo", PUL)] class

Re: is parameter an iterable?

2005-11-16 Thread Rick Wotnaz
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rick Wotnaz wrote. > >> ... which leads me to belive that 'msg' is not type(str). It >> can be coerced (str(msg).find works as expected). But what >> exactly is msg? It appears to be of , and does >> not test equal to a strin

Re: best way to discover this process's current memory usage, cross-platform?

2005-11-16 Thread [EMAIL PROTECTED]
Neal Norwitz wrote: > Here's a really screwy thought that I think should be portable to all > Unixes which have dynamic linking. LD_PRELOAD. > > You can create your own version of malloc (and friends) and free. You > intercept each call to malloc and free (by making use of LD_PRELOAD), > keep tr

Re: newbie - How do I import automatically?

2005-11-16 Thread Claudio Grondi
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:<[EMAIL PROTECTED]>... > I tried to put the line > from btools import * > in several places in PyShell.py > but to now avail. It does not work, IDLE does not execute it??? > Bob I have to give up here :-( . The best solution I am able to come up wit

Re: HTML generation vs PSP vs Templating Engines

2005-11-16 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > Hello everybody, > > I am in the process of writing my very first web application in Python, > and I need a way to > generate dynamic HTML pages with data from a database. (snip) > After some thought I decided to leave the various frameworks > aside for the > time bein

Re: Python, Linux, Desktop Environment

2005-11-16 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > So, I've written my first GUI app in python. I've turned it into a > binary .exe and .app that runs on Windows and Mac respectively, but on > my Linux box, where I wrote the thing, I still have to drop to the > command line and ./myscript.py. What can I do to make it a

Re: newbie - How do I import automatically?

2005-11-16 Thread bobueland
Where do I put def runsource(self, source): if(source == ''): source = 'from btools import *' "Extend base class method: Stuff the source in the line cache first" filename = self.stuffsource(source) Do I put it in Pyshell.py or somewhere else? Bob -- http://

Re: Addressing the last element of a list

2005-11-16 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: > Op 2005-11-15, Mike Meyer schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> writes: > Like having an assignment operator (let use @= for it) next to a > (re)bind operator. > We could then have something like the following.

Re: Python, Linux, Desktop Environment

2005-11-16 Thread Yves Glodt
> [EMAIL PROTECTED] wrote: > >> So, I've written my first GUI app in python. I've turned it into a >> binary .exe and .app that runs on Windows and Mac respectively, but on >> my Linux box, where I wrote the thing, I still have to drop to the >> command line and ./myscript.py. What can I do t

creating package question

2005-11-16 Thread erick_bodine
I have a package directory structure as follows root- | Common (contains __init__.py file) WindowsComponents (contains __init__.py file) ... I would like modules in the WindowsComponents directory to be able to import some modules from the Common directory. In my first pass, I wa

Quitting a Tkinter application with confirmation

2005-11-16 Thread Peter Kleiweg
I have an application written in Tkinter. There is a menu item 'quit' that calls the function 'quit'. If 'quit' is called, it first checks if there is unsaved data. If there is, it won't let the application exit unless you confirm to disregard the changes. So far, so good. I want the program

Re: Python, Linux, Desktop Environment

2005-11-16 Thread Jorgen Grahn
On Wed, 16 Nov 2005 19:56:51 +0100, bruno at modulix <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> So, I've written my first GUI app in python. I've turned it into a >> binary .exe and .app that runs on Windows and Mac respectively, but on >> my Linux box, where I wrote the thing, I sti

Re: Can anyone tell me if pygame and Tkinter can work together?

2005-11-16 Thread Nathan Pinno
It's a warning that says: Can only use * in top level or something like that. It's kind of annoying, but the program still ran after I made the import * lines top level, and removed the def's. Nathan Pinno. -- For great sites go to: http://www.the-web-surfers-store.com MSN Messenger: [EMAIL P

Re: Creating (rather) generic plugin framework?

2005-11-16 Thread bruno at modulix
Edvard Majakari wrote: > Hi, > > My idea is to create a system working as follows: each module knows > path to plugin directory, and that directory contains modules which > may add hooks to some points in the code. > > Inspired by http://www.python.org/pycon/2005/papers/7/pyconHooking.html > > I

Re: creating package question

2005-11-16 Thread erick_bodine
I think I have an answer to my own question. In the WindowsComponents/__init__.py file, I have the following, that feels like a better answer for the problem. Is there a better answer than this? import os, sys sys.path.append(os.path.join(os.getcwd(), 'Common')) --ERick -- http://mail.python

Re: newbie - How do I import automatically?

2005-11-16 Thread Claudio Grondi
Probably you have inbetween already found the 'def runsource(' line in the PyShell.py , but maybe you still wait for a reply, so here it is: yes, you put the two lines at the beginning of in PyShell.py existing runsource() method of the class ModifiedInterpreter(InteractiveInterpreter) If in my

Re: creating package question

2005-11-16 Thread Micah Elliott
On Nov 16, [EMAIL PROTECTED] wrote: > I have a package directory structure as follows > > root- > | > Common (contains __init__.py file) > WindowsComponents (contains __init__.py file) > ... > > I would like modules in the WindowsComponents directory to be able > to import some mo

  1   2   >