Re: Newbie Threading Question

2008-07-13 Thread Lev Elbert
On Jul 13, 8:33 am, Sparky <[EMAIL PROTECTED]> wrote: > It seems strange, but I can't find a list of operating systems which > support / don't support threading in Python. Can anyone point me in > the right direction? > > Thanks, > Sam Here is the list (from Python documentation of thread module):

Need help in writing up a Python Syntax checker

2008-07-13 Thread Kinokunya
Hi guys, My group and I will be working on our final year project, the scope to do a program/web-based application similar areas of functionalities like the PyLint and PyChecker; a Python syntax checker. We have no Python background, equipped only with some knowledge of Java and Dot net. We did s

Re: while var, but var ==16 != true

2008-07-13 Thread Tim Roberts
maestro <[EMAIL PROTECTED]> wrote: > >why does this work? "while p" = "while p != 0" ? 1 is True and 0 is >false in python but other numbers have no boolean value so why doesnt >it abort. Because your statement is incorrect. Everything has a boolean value in Python. 0, None, False, '' (empty st

Re: iterator clone

2008-07-13 Thread Marc 'BlackJack' Rintsch
On Sun, 13 Jul 2008 18:51:19 -0700, Yosifov Pavel wrote: >> Well, I think Python's iterators, especially the generators, are beautiful. >> More importantly, I think there is no general way to make iterators >> copyable, regardless of the programming language. The problem is that most >> of the use

Re: About wmi

2008-07-13 Thread Larry Bates
patrol wrote: > On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> wrote: >> patrol wrote: >>> I want to prevent some process from running. The code is in the >>> following. I encounter some unexpected troubles. >>> Probelm1: This program cannot terminate "scrcons.exe" and >>> "FNPLicensingServic

Re: while var, but var ==16 != true

2008-07-13 Thread Larry Bates
maestro wrote: why does this work? "while p" = "while p != 0" ? 1 is True and 0 is false in python but other numbers have no boolean value so why doesnt it abort. p=16 p 16 while p: print p p -= 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 i can also do: k=[] while k:

Re: Dictionary bidirectional

2008-07-13 Thread bukzor
On Jul 13, 6:53 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > bukzor: > >> You need to use two dictionaries. Here's a class that someone's > >> written that wraps it up into a single dict-like object for you: > >>http://www.faqts.com/knowledge_base/view.phtml/aid/4376 >

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread bukzor
On Jul 13, 6:31 pm, Miles <[EMAIL PROTECTED]> wrote: > On Sun, Jul 13, 2008 at 8:35 PM, bukzor <[EMAIL PROTECTED]> wrote: > > The problem only manifests about 1 in 20 runs. Below there's code for > > a client that shows the problem 100% of the time. > > > The two URL's that I seem to be "confused"

Amazon: "Practical Django Projects" by James Bennett (June 2008)

2008-07-13 Thread Dave U. Random
http://snipr.com/PracticalDjango -- http://mail.python.org/mailman/listinfo/python-list

importing from .pyd

2008-07-13 Thread moijes12
hi there is a .pyd file present in the same folder as the script abc.py by the name foo.pyd .I don't have foo.py .In the script abc.py I try import foo Error i get is ImportError: DLL load failed: The specified module could not be found. I have tried placing .pyd under C:\python25\DLLs but it d

Question about Stackless Python

2008-07-13 Thread Fisher
Hi, I have some question about Stackless Python. What is main tasklet? Usually we call stackless.run() to mainloop all the schedule tasklets. But if we just call sometaklet.channel.send(None) in main thread after all the necessary tasklets are created, what would happen? Thanks in adva

Re: Malaysia python user group

2008-07-13 Thread Tim Cook
Marcus, You should probably contact the Malaysian Public Sector Open Source Competency Centre (OSCC) in Cyberjaya. http://www.oscc.org.my HTH, Tim On Mon, 2008-07-14 at 10:57 +0800, Marcus.CM wrote: > Hi, > > I am thinking of promoting Python for the local developers here in > Malaysia, vi

while var, but var ==16 != true

2008-07-13 Thread maestro
why does this work? "while p" = "while p != 0" ? 1 is True and 0 is false in python but other numbers have no boolean value so why doesnt it abort. >>> p=16 >>> p 16 >>> while p: print p p -= 1 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 >>> i can also do: >>> k=[] >>> while k:

Malaysia python user group

2008-07-13 Thread Marcus.CM
Hi, I am thinking of promoting Python for the local developers here in Malaysia, via Universities , seminars etc . Is there already a user group here in Malaysia? Any pointers would help. Marcus. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Threading Question

2008-07-13 Thread Sparky
On Jul 13, 1:30 pm, Nick Dumas <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > I'm not an expert on Python threading, so don't take my word as low, > however, I believe that there's no need for a list of systems which > support it because the Python virtual machine

Re: wxPython Tab

2008-07-13 Thread Sparky
On Jul 13, 10:32 am, Uwe Schmitt <[EMAIL PROTECTED]> wrote: > On Jul 13, 6:20 pm, Sparky <[EMAIL PROTECTED]> wrote: > > > Is there a way to get wxPython to change the visible tab in a notebook > > (like I have tab 1 open but the computer will automatically change to > > tab 2)? > > > Thanks, > > Sa

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 10:29 PM, Miles <[EMAIL PROTECTED]> wrote: > On Sat, Jul 12, 2008 at 11:23 PM, bukzor <[EMAIL PROTECTED]> wrote: >> Anyone know a general reason this might happen? Even better, a way to >> fix it? > > Maybe your client has an unusually low socket timeout for some reason, > t

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread Miles
On Sat, Jul 12, 2008 at 11:23 PM, bukzor <[EMAIL PROTECTED]> wrote: > Anyone know a general reason this might happen? Even better, a way to > fix it? Another reason that a socket can hang in the SYN_SENT state (besides trying to connect to an unreachable host without getting an ICMP destination-un

Re: Dictionary bidirectional

2008-07-13 Thread Akathorn Greyhat
-- Forwarded message -- From: Akathorn Greyhat <[EMAIL PROTECTED]> Date: 2008/7/14 Subject: Re: Dictionary bidirectional To: Kless <[EMAIL PROTECTED]> 2008/7/14 Kless <[EMAIL PROTECTED]>: I need a dictionary where get the result from a 'key' (on left), but > also from a 'value'

Re: heapq question

2008-07-13 Thread Giampaolo Rodola'
On 13 Lug, 22:35, Miles <[EMAIL PROTECTED]> wrote: > On Sun, Jul 13, 2008 at 3:05 PM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > On 13 Lug, 19:31, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> > I understand that heapq is not that efficient to implement timeouts as > >> > I thought at fir

Re: How to package a logging.config file?

2008-07-13 Thread Larry Bates
Matthew Wilson wrote: I'm working on a package that uses the standard library logging module along with a .cfg file. In my code, I use logging.config.fileConfig('/home/matt/mypackage/matt.cfg') to load in the logging config file. However, it seems really obvious to me that this won't work when

Re: Dictionary bidirectional

2008-07-13 Thread Larry Bates
[EMAIL PROTECTED] wrote: bukzor: You need to use two dictionaries. Here's a class that someone's written that wraps it up into a single dict-like object for you: http://www.faqts.com/knowledge_base/view.phtml/aid/4376 It contains code like: try: del self.data[item] except KeyError: pa

Re: iterator clone

2008-07-13 Thread Yosifov Pavel
> Well, I think Python's iterators, especially the generators, are beautiful. > More importantly, I think there is no general way to make iterators > copyable, regardless of the programming language. The problem is that most > of the useful ones depend on external state. > > Peter Hmm, but tee() d

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 9:31 PM, Miles <[EMAIL PROTECTED]> wrote: > On Sun, Jul 13, 2008 at 8:35 PM, bukzor <[EMAIL PROTECTED]> wrote: >> The problem only manifests about 1 in 20 runs. Below there's code for >> a client that shows the problem 100% of the time. >> >> The two URL's that I seem to be

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 8:35 PM, bukzor <[EMAIL PROTECTED]> wrote: > The problem only manifests about 1 in 20 runs. Below there's code for > a client that shows the problem 100% of the time. > > The two URL's that I seem to be "confused" about point to the same IP. > Maybe this will make it clear:

Re: About wmi

2008-07-13 Thread patrol
On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> wrote: > patrol wrote: > > I want to prevent some process from running. The code is in the > > following. I encounter some unexpected troubles. > > Probelm1: This program cannot terminate "scrcons.exe" and > > "FNPLicensingService.exe",which are

Re: Dictionary bidirectional

2008-07-13 Thread bearophileHUGS
bukzor: > You need to use two dictionaries. Here's a class that someone's > written that wraps it up into a single dict-like object for you: > http://www.faqts.com/knowledge_base/view.phtml/aid/4376 It contains code like: try: del self.data[item] except KeyError: pass Exceptions are usef

Re: Using Groups inside Braces with Regular Expressions

2008-07-13 Thread John Machin
On Jul 14, 9:05 am, Chris <[EMAIL PROTECTED]> wrote: Misleading subject. [] brackets or "square brackets" {} braces or "curly brackets" () parentheses or "round brackets" > I'm trying to delimit sentences in a block of text by defining the > end-of-sentence marker as a period followed by a spac

Re: Using Groups inside Braces with Regular Expressions

2008-07-13 Thread Chris
On Jul 13, 8:14 pm, MRAB <[EMAIL PROTECTED]> wrote: > On Jul 14, 12:05 am, Chris <[EMAIL PROTECTED]> wrote:> I'm trying to delimit > sentences in a block of text by defining the > > end-of-sentence marker as a period followed by a space followed by an > > uppercase letter or end-of-string. > > >

Re: Dictionary bidirectional

2008-07-13 Thread bukzor
On Jul 13, 4:21 pm, Kless <[EMAIL PROTECTED]> wrote: > I need a dictionary where get the result from a 'key' (on left), but > also from a 'value' (on right), how to get it? > > I know that dictionaries aren't bidirectional, but is there any way > without use two dictionaries? > > Thanks in advance!

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread bukzor
On Jul 13, 1:08 pm, Miles <[EMAIL PROTECTED]> wrote: > On Sun, Jul 13, 2008 at 2:32 PM, bukzor <[EMAIL PROTECTED]> wrote: > > On Jul 13, 1:14 am, Miles <[EMAIL PROTECTED]> wrote: > >> On Sat, Jul 12, 2008 at 11:23 PM, bukzor <[EMAIL PROTECTED]> wrote: > >> > I'm connecting to an apache2 process on

How to package a logging.config file?

2008-07-13 Thread Matthew Wilson
I'm working on a package that uses the standard library logging module along with a .cfg file. In my code, I use logging.config.fileConfig('/home/matt/mypackage/matt.cfg') to load in the logging config file. However, it seems really obvious to me that this won't work when I share this package wit

Re: Using Groups inside Braces with Regular Expressions

2008-07-13 Thread MRAB
On Jul 14, 12:05 am, Chris <[EMAIL PROTECTED]> wrote: > I'm trying to delimit  sentences in a block of text by defining the > end-of-sentence marker as a period followed by a space followed by an > uppercase letter or end-of-string. > > I'd imagine the regex for that would look something like: > [^

Re: Dictionary bidirectional

2008-07-13 Thread WDC
On Jul 13, 4:21 pm, Kless <[EMAIL PROTECTED]> wrote: > I need a dictionary where get the result from a 'key' (on left), but > also from a 'value' (on right), how to get it? > > I know that dictionaries aren't bidirectional, but is there any way > without use two dictionaries? > > Thanks in advance!

Re: wxPython code giving strange errors.

2008-07-13 Thread Mike Driscoll
On Jul 13, 10:18 am, teh_sAbEr <[EMAIL PROTECTED]> wrote: > I'm busy trying to learn wxPython, and i'm trying to run the following > piece of code (its from the wxPyWiki tutorial): > > import wx > > ID_ABOUT = 101 > ID_EXIT = 110 > > class MainWindow(wx.Frame): >     def __init__(self,parent,id,tit

Dictionary bidirectional

2008-07-13 Thread Kless
I need a dictionary where get the result from a 'key' (on left), but also from a 'value' (on right), how to get it? I know that dictionaries aren't bidirectional, but is there any way without use two dictionaries? Thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread John Machin
On Jul 14, 5:30 am, John Roth <[EMAIL PROTECTED]> wrote: > On Jul 13, 11:55 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > > > > > I started off with a module that defined a class Vehicle, and then > > subclasses Car and Motorcycle. > > > In the Car class, for some bizarre reason, I instantiated

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread John Machin
On Jul 14, 3:55 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I started off with a module that defined a class Vehicle, and then > subclasses Car and Motorcycle. > > In the Car class, for some bizarre reason, I instantiated a Motorcycle. > Please pretend that this can't be avoided for now. > > M

Using Groups inside Braces with Regular Expressions

2008-07-13 Thread Chris
I'm trying to delimit sentences in a block of text by defining the end-of-sentence marker as a period followed by a space followed by an uppercase letter or end-of-string. I'd imagine the regex for that would look something like: [^(?:[A-Z]|$)]\.\s+(?=[A-Z]|$) However, Python keeps giving me an

Re: Functional/Best?

2008-07-13 Thread Paul Hankin
On Jul 13, 7:00 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Tim Cook wrote: > > I guess I can classify my application(s) as more procedural than > > anything else.  But I have a question about the best way to handle > > something in Python. > > > When given a mapping of keywords, I want to call a

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-13 Thread sukkopera
On 13 Lug, 19:42, [EMAIL PROTECTED] wrote: > I expect it's because default values for parameters are evaluated and > bound at definition time. So once "def m (self, param = a):" line > executes, the default value for parameter is forever bound to be 1. > What you can do is for example: Yes, that's

Re: SAX XML Parse Python error message

2008-07-13 Thread goldtech
On Jul 13, 5:30 pm, Waldemar Osuch <[EMAIL PROTECTED]> wrote: > On Jul 13, 3:00 pm, goldtech <[EMAIL PROTECTED]> wrote: > > > I would be grateful for support with the code I cited. It's not long > > and fairly standard. I'm sure my error(s) would be glaring to more > > experienced coders. I appreci

Re: SAX XML Parse Python error message

2008-07-13 Thread Waldemar Osuch
On Jul 13, 3:00 pm, goldtech <[EMAIL PROTECTED]> wrote: > I would be grateful for support with the code I cited. It's not long > and fairly standard. I'm sure my error(s) would be glaring to more > experienced coders. I appreciated the "heads-up" about other options > but I would be grateful for he

Re: Magic?

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 12:55 PM, mk <[EMAIL PROTECTED]> wrote: > So my updated question is where does this lstr() instance keep the original > value ('abcdef')? It obviously has smth to do with inheriting after str > class, but I don't get the details of the mechanism. Through the str.__new__ met

Re: numeric emulation and the rich comparison operators

2008-07-13 Thread Ethan Furman
Gabriel Genellina wrote: En Thu, 10 Jul 2008 17:37:42 -0300, Ethan Furman <[EMAIL PROTECTED]> escribi�: Greetings, List! Still working on my Measure class, and my next question is... (drum roll please ;) What are the advantages of using __[eq|ne|lt|gt|le|ge]__ vs __cmp__? If your obje

Re: SAX XML Parse Python error message

2008-07-13 Thread goldtech
I would be grateful for support with the code I cited. It's not long and fairly standard. I'm sure my error(s) would be glaring to more experienced coders. I appreciated the "heads-up" about other options but I would be grateful for help getting this code to run. Thanks On Jul 13, 11:47 am, Stef

Re: heapq question

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 4:16 PM, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: >> I understand that heapq is not that efficient to implement timeouts as >> I thought at first. >> It would have been perfect if there were functions to remove arbitrary >> ele

Re: heapq question

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 3:05 PM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 13 Lug, 19:31, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> > I understand that heapq is not that efficient to implement timeouts as >> > I thought at first. >> > It would have been perfect if there were functions

logging via SocketHandler and TCPserver

2008-07-13 Thread Larry Bates
Every time I look at the logging module (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able to monitor LOTS of running programs/processes and thought it would be nice to hav

Re: heapq question

2008-07-13 Thread Duncan Booth
"Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > Thanks, that's what I wanted to know. > I understand that heapq is not that efficient to implement timeouts as > I thought at first. > It would have been perfect if there were functions to remove arbitrary > elements withouth needing to re-heapify()

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread Miles
On Sun, Jul 13, 2008 at 2:32 PM, bukzor <[EMAIL PROTECTED]> wrote: > On Jul 13, 1:14 am, Miles <[EMAIL PROTECTED]> wrote: >> On Sat, Jul 12, 2008 at 11:23 PM, bukzor <[EMAIL PROTECTED]> wrote: >> > I'm connecting to an apache2 process on the same machine, >> > for testing. When looking at netstat,

Generating Lip-Synched animation?

2008-07-13 Thread Miki
Hello, I'm trying to write something like http://blabberize.com/, generating a video file with lip-sync. Currently the general idea is: * Generate animation images using GIMP * Sample voice and detect when there is sound and when there is silence - Still working on details for this one, will pr

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread John Roth
On Jul 13, 11:55 am, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I started off with a module that defined a class Vehicle, and then > subclasses Car and Motorcycle. > > In the Car class,  for some bizarre reason, I instantiated a Motorcycle. > Please pretend that this can't be avoided for now. > >

Re: Newbie Threading Question

2008-07-13 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I'm not an expert on Python threading, so don't take my word as low, however, I believe that there's no need for a list of systems which support it because the Python virtual machine handles it. Thus, any system which supports Python (or at least Pytho

Re: heapq question

2008-07-13 Thread Giampaolo Rodola'
On 13 Lug, 19:31, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > I understand that heapq is not that efficient to implement timeouts as > > I thought at first. > > It would have been perfect if there were functions to remove arbitrary > > elements withouth needing to re-heapify() the heap every t

RE: Terminate a python script from linux shell / bash script

2008-07-13 Thread Gros Bedo
Thank you guys for your help. My problem is that I project to use this command to terminate a script when uninstalling the software, so I can't store the PID. This command will be integrated in the spec file of the RPM package. Here's the script I'll use, it may help someone else: #!/bin/sh #

spam

2008-07-13 Thread rickman
spam -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket problems

2008-07-13 Thread Jonathon Sisson
SSL objects use "write", not "send". You also need to change this: self.sock.write('NICK %s\r\n') % self.nick to this: self.sock.write('NICK %s\r\n' % self.nick) If you don't, the interpreter will bomb on trying to concatenate the return value for "write" (an integer) with the string self.ni

Re: socket.connect() hangs in SYN_SENT state.

2008-07-13 Thread bukzor
On Jul 13, 1:14 am, Miles <[EMAIL PROTECTED]> wrote: > On Sat, Jul 12, 2008 at 11:23 PM, bukzor <[EMAIL PROTECTED]> wrote: > > I'm connecting to an apache2 process on the same machine, > > for testing. When looking at netstat, the socket is in the SYN_SENT > > state, like this: > > > $netstat -a -t

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread Carl Banks
On Jul 13, 1:55 pm, Matthew Wilson <[EMAIL PROTECTED]> wrote: > I started off with a module that defined a class Vehicle, and then > subclasses Car and Motorcycle. > > In the Car class,  for some bizarre reason, I instantiated a Motorcycle. > Please pretend that this can't be avoided for now. > > M

Re: Mutually referencing imports -- impossible?

2008-07-13 Thread Gary Herron
Matthew Wilson wrote: I started off with a module that defined a class Vehicle, and then subclasses Car and Motorcycle. In the Car class, for some bizarre reason, I instantiated a Motorcycle. Please pretend that this can't be avoided for now. Meanwhile, my Motorcycle class instantiated a Car a

Re: Functional/Best?

2008-07-13 Thread Terry Reedy
Tim Cook wrote: I guess I can classify my application(s) as more procedural than anything else. But I have a question about the best way to handle something in Python. When given a mapping of keywords, I want to call a function based on a certain keyword found when parsing a text file. The m

Mutually referencing imports -- impossible?

2008-07-13 Thread Matthew Wilson
I started off with a module that defined a class Vehicle, and then subclasses Car and Motorcycle. In the Car class, for some bizarre reason, I instantiated a Motorcycle. Please pretend that this can't be avoided for now. Meanwhile, my Motorcycle class instantiated a Car as well. Then I moved th

Re: Beginner Question : Iterators and zip

2008-07-13 Thread Terry Reedy
[EMAIL PROTECTED] wrote: What is this *lis operation called? I am having trouble finding any reference to it in the python docs or the book learning python. One might call this argument unpacking, but Language Manual / Expressions / Primaries / Calls simply calls it *expression syntax. "If the

Re: Unexpected default arguments behaviour (Maybe bug?)

2008-07-13 Thread marek . rocki
[EMAIL PROTECTED] napisał(a): > Hi, I have just encountered a Python behaviour I wouldn't expect. Take > the following code: > > > class Parent: > a = 1 > > def m (self, param = a): > print "param = %d" % param

Re: heapq question

2008-07-13 Thread Martin v. Löwis
> I understand that heapq is not that efficient to implement timeouts as > I thought at first. > It would have been perfect if there were functions to remove arbitrary > elements withouth needing to re-heapify() the heap every time. It is efficient for that - you just need to use it correctly. To

Socket problems

2008-07-13 Thread jjbutler88
I am trying to write a simple python IRC client, roughly following this guide: http://www.devshed.com/c/a/Python/Python-and-IRC/ I have written some code, which uses the same commands as the guide, but I get this error: Traceback (most recent call last): File "/Library/Frameworks/Python.framewor

Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-13 Thread Arne Vajhøj
donald wrote: Arne Vajhøj wrote: Google does not accept spam complaints. Go ahead, try it. That's why they've been the #1 Usenet spamming tool for years now. What you're seeing is the spam slowly expanding into the software development groups. uk.railway is probably a random group added

Re: like py2exe, but on a mac

2008-07-13 Thread Tommy Nordgren
On 13 jul 2008, at 00.39, Alexnb wrote: Hi All I am wondering what I can do to turn a python app (.py) into a mac OSX applicaiton (.app). Just like py2exe does. But I am also wondering since in your applications folder on macs it usually doesn't have an actual folder for each app. Rather

Re: spam

2008-07-13 Thread Arne Vajhøj
[EMAIL PROTECTED] wrote: rickman wrote: I love the way that people who plonk others feel the need to inform everyone of it. That ranks up there with, "I know what you are, but what am I?" It is a matter of basic politeness and common courtesy. Without the plonk, the killfiled poster is left

Re: Magic?

2008-07-13 Thread mk
However, it appears that somehow this object prints the value of 's' attribute without me setting any specific methods to do that: >>> astr = lstr('abcdef') >>> astr 'abcdef' >>> astr.swapcase() 'ABCDEF' Correction: it doesn't really get the value from _s attribute: >>> astr = lstr('abcd

Re: spam

2008-07-13 Thread INVALID
rickman wrote: >I love the way that people who plonk others feel the need to inform >everyone of it. That ranks up there with, "I know what you are, but >what am I?" It is a matter of basic politeness and common courtesy. Without the plonk, the killfiled poster is left hanging in the wind, w

Magic?

2008-07-13 Thread mk
So I was playing around with properties and wrote this: class lstr(str): def __init__(self, initval): self._s = initval self._len = len(self._s) def fget_s(self): return str(self._s) def fset_s(self, val): self._s = val self._len

Re: Building a Python app with Mozilla

2008-07-13 Thread happybrowndog
Is that why Komodo is so damned slow Brian Quinlan wrote: Kevin Walzer wrote: Komodo is not a Python application. It is a Mozilla application that supports Python development. Komodo is more akin to Thunderbird and Firefox than anything else; it uses the XUL framework for rendering widge

Re: wxPython Tab

2008-07-13 Thread Uwe Schmitt
On Jul 13, 6:20 pm, Sparky <[EMAIL PROTECTED]> wrote: > Is there a way to get wxPython to change the visible tab in a notebook > (like I have tab 1 open but the computer will automatically change to > tab 2)? > > Thanks, > Sam look at http://docs.wxwidgets.org/stable/wx_wxnotebook.html#wxnotebooks

wxPython Tab

2008-07-13 Thread Sparky
Is there a way to get wxPython to change the visible tab in a notebook (like I have tab 1 open but the computer will automatically change to tab 2)? Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

Unexpected default arguments behaviour (Maybe bug?)

2008-07-13 Thread sukkopera
Hi, I have just encountered a Python behaviour I wouldn't expect. Take the following code: class Parent: a = 1 def m (self, param = a): print "param = %d" % param class Child (Parent):

Re: SAX XML Parse Python error message

2008-07-13 Thread Stefan Behnel
goldtech wrote: > My first attempt at SAX, but have an error message I need help with. Just in case you prefer writing readable code over debugging SAX code into existence, try lxml. http://codespeak.net/lxml/ Here is a presentation you might find interesting. http://codespeak.net/lxml/s5/lxml-

Newbie Threading Question

2008-07-13 Thread Sparky
It seems strange, but I can't find a list of operating systems which support / don't support threading in Python. Can anyone point me in the right direction? Thanks, Sam -- http://mail.python.org/mailman/listinfo/python-list

SAX XML Parse Python error message

2008-07-13 Thread goldtech
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me what the fix is. Thanks. >>> Traceback (most recent call last): File "C:\Python24\Lib\site-packages\python

Re: wxPython code giving strange errors.

2008-07-13 Thread Thin Myrna
teh_sAbEr wrote: > I'm busy trying to learn wxPython, and i'm trying to run the following > piece of code (its from the wxPyWiki tutorial): > > import wx > > ID_ABOUT = 101 > ID_EXIT = 110 > > class MainWindow(wx.Frame): > def __init__(self,parent,id,title): > wx.Frame.__init__(self

Re: Someone enlightened me

2008-07-13 Thread Gary Herron
Marcus Low wrote: Opps here is the mail again, incase my formatting is lost, can someone explain to me why this code behaves differently when "lister" and "self.lister" is swap remarked. class abc : # remark this later and unremark "self.lister" lister = [] def __init__ (self, val):

wxPython code giving strange errors.

2008-07-13 Thread teh_sAbEr
I'm busy trying to learn wxPython, and i'm trying to run the following piece of code (its from the wxPyWiki tutorial): import wx ID_ABOUT = 101 ID_EXIT = 110 class MainWindow(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,parent,wx.ID_ANY,title,size=(200,100))

Re: heapq question

2008-07-13 Thread Giampaolo Rodola'
On 13 Lug, 11:35, Duncan Booth <[EMAIL PROTECTED]> wrote: > "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > > Having said that I'd like to understand if there are cases where > > deleting or moving an element of the heap, causes heappop() to return > > an element which is not the smallest one. > >

Re: spam

2008-07-13 Thread Lew
rickman wrote: On Jul 12, 9:21 am, Scott in SoCal <[EMAIL PROTECTED]> wrote: In message <[EMAIL PROTECTED]>, rickman <[EMAIL PROTECTED]> wrote: spam *PLONK!* I love the way that people who plonk others feel the need to inform everyone of it. That ranks up there with, "I know what you are,

Re: About wmi

2008-07-13 Thread Larry Bates
patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate "scrcons.exe" and "FNPLicensingService.exe",which are system processes. Problem2:After a while, this program will abort by error

Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-13 Thread donald
Arne Vajhøj wrote: Google does not accept spam complaints. Go ahead, try it. That's why they've been the #1 Usenet spamming tool for years now. What you're seeing is the spam slowly expanding into the software development groups. uk.railway is probably a random group added to confuse spam

Re: Correct use of try,except and raise?

2008-07-13 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > Which "original class" are you referring to? The one posted by the > original poster of this thread had no "original list"; it gathered the > positional arguments (using '*items') into an 'items' parameter, which > *doesn't e

Re: spam <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

2008-07-13 Thread Arne Vajhøj
Kevin McMurtrie wrote: In article <[EMAIL PROTECTED]>, Lew <[EMAIL PROTECTED]> wrote: WDC wrote: BTW I reported it, yo should too. To whom did you report it, so that we may also report it there? Google does not accept spam complaints. Go ahead, try it. That's why they've been the #1 Usen

Re: Correct use of try,except and raise?

2008-07-13 Thread Ben Finney
Roy Smith <[EMAIL PROTECTED]> writes: > Ben Finney <[EMAIL PROTECTED]> wrote: > > > If you are passing a sequence conceptually, then it's more Pythonic to > > pass it as a sequence explicitly:: > > > > def __init__(self, items): > > """ Call with e.g. Stack(["foo", "bar"]) """ > >

Re: Why is this blowing the stack, thought it was tail-recursive...

2008-07-13 Thread Fuzzyman
On Jul 13, 7:56 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 12 Jul 2008 19:25:18 -0400, Terry Reedy wrote: > > ssecorp wrote: > >> def fib(n): > >>     def fibt(a, b, n): > >>         if n <= 1: > >>             return b > >>         else: > >>             return fib

Re: Correct use of try,except and raise?

2008-07-13 Thread Roy Smith
Ben Finney <[EMAIL PROTECTED]> wrote: > If you are passing a sequence conceptually, then it's more Pythonic to > pass it as a sequence explicitly:: > > def __init__(self, items): > """ Call with e.g. Stack(["foo", "bar"]) """ > self.stack = list(items) I don't get this. You'

Functional/Best?

2008-07-13 Thread Tim Cook
I guess I can classify my application(s) as more procedural than anything else. But I have a question about the best way to handle something in Python. When given a mapping of keywords, I want to call a function based on a certain keyword found when parsing a text file. The mapping looks like th

spam

2008-07-13 Thread rickman
On Jul 12, 9:21 am, Scott in SoCal <[EMAIL PROTECTED]> wrote: > In message > <[EMAIL PROTECTED]>, > > rickman <[EMAIL PROTECTED]> wrote: > >spam > > *PLONK!* I love the way that people who plonk others feel the need to inform everyone of it. That ranks up there with, "I know what you are, but wha

Re: Problems with curses

2008-07-13 Thread Clay Hobbs
> On Sat, 12 Jul 2008 20:49:56 -0400, Clay Hobbs wrote: > > > Unfortunately, the error message isn't very helpful. > > But it would be helpful to tell it. If you get exceptions, always > copy'n'paste the traceback here. People might know what the exception > means and share their wisdom. H

Re: why is "self" used in OO-Python?

2008-07-13 Thread satoru
On Jul 13, 12:32 am, ssecorp <[EMAIL PROTECTED]> wrote: > I first learned about OO from Java. > > I much prefer to program in Python though. > > However I am consufed about 2 things. > > 1. Why do I have to pass self into every method in a class? Since I am > always doing why cant this be automated

About wmi

2008-07-13 Thread patrol
I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate "scrcons.exe" and "FNPLicensingService.exe",which are system processes. Problem2:After a while, this program will abort by error File "C:\Pytho

Dynamic Invocation Interface

2008-07-13 Thread Ilan
Is there any python CORBA ORB that support Dynamic Invocation Interface? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is there no GUI-tools like this for Windows?

2008-07-13 Thread GHZ
There is http://www.codeplex.com/IronPythonStudio -- http://mail.python.org/mailman/listinfo/python-list

Re: Correct use of try,except and raise?

2008-07-13 Thread Ben Finney
Bart Kastermans <[EMAIL PROTECTED]> writes: > Roy Smith <[EMAIL PROTECTED]> writes: > > The defensive thing to do is catch exactly the exception you > > expect to happen. In this case, that means IndexError. > > And you do that by > > except IndexError: >raise TheErrorYouNowWantToRaise You

  1   2   >