Re: Something in the function tutorial confused me.

2007-08-06 Thread Marc 'BlackJack' Rintsch
On Sun, 05 Aug 2007 23:50:24 -0700, Lee Fleming wrote: > But this, the code that "fixes" the list accumulation confounds me: > def f(x, y=None): > if y is None: y = [] > y.append(x) > return y > > print f(23) # prints [23] > print f(42) # prints [42] > > Why didn't the second call

Re: Relative-importing *

2007-08-06 Thread Ben Finney
[EMAIL PROTECTED] writes: > (In addition, it probably would make the program somewhat slower to > have an internal class inside every module, and performance is > important to me, as I'm planning to use this project in a future > game. This is known as "premature optimisation", and it's harmful.

Re: Global package variable, is it possible?

2007-08-06 Thread Bruno Desthuilliers
Chris Allen a écrit : > Hello fellow pythoneers. I'm stumped on something, and I was hoping > maybe someone in here would have an elegant solution to my problem. > This is the first time I've played around with packages, so I'm > probably misunderstanding something here... > > Here's what I'd lik

Re: (no) fast boolean evaluation ?

2007-08-06 Thread Bruno Desthuilliers
Ed Leafe a écrit : > On Aug 3, 2007, at 11:57 AM, Bruno Desthuilliers wrote: > >> Sorry, I forgot to mention the language did not allow to have else & if >> in the same statement. IOW : >> >> if some_condition then >>do_sometehing >> else >>if some_other_condition then >> do_something

Re: A question on plugin design

2007-08-06 Thread Bruno Desthuilliers
John J. Lee a écrit : > [EMAIL PROTECTED] (John J. Lee) writes: > >> Grzegorz Słodkowicz <[EMAIL PROTECTED]> writes: >> [...] >>> I'd also be grateful for pointers to a well designed Pythonic plugin >>> architecture but I'd much prefer a small project with a simple API. >> Google for setuptools an

Re: Best programs written completly in Python

2007-08-06 Thread Bruno Desthuilliers
markacy a écrit : > On 5 Sie, 12:14, Franz Steinhäusler <[EMAIL PROTECTED]> > wrote: >> Hello NG, >> >> wWhat are the best programs in your opinion, written entirly >> in pyhton, divided into categories like: >> a) Games >> b) Utilities/System >> c) Office >> d) Web/Newsreader/Mail/Browser >> ... >

Python/C API, Numeric Python, Type Conversion

2007-08-06 Thread ronysk
Hi, I am posting here to seek for help on type conversion between Python (Numeric Python) and C. Attachment A is a math function written in C, which is called by a Python program. I had studied SWIG and Python/C API a bit. I was able to pass numeric array (Numeric Python) into the C function

Re: Something in the function tutorial confused me.

2007-08-06 Thread Stargaming
On Sun, 05 Aug 2007 23:50:24 -0700, Lee Fleming wrote: > Hello, > I have a simple question. Say you have the following function: > > def f(x, y = []): > y.append(x) > return y > > print f(23) # prints [23] > print f(42) # prints [23, 42] > > As far as I understand, the default value y

Re: Best programs written completly in Python

2007-08-06 Thread Ant
On Aug 5, 12:31 pm, Campbell Barton <[EMAIL PROTECTED]> wrote: ... > * ubuntu have some of their install tools in python. Gentoo Linux's "Portage" package management tool is written in Python. -- Ant... http://antroy.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: xlrd question

2007-08-06 Thread has
On 5 Aug, 19:43, jay <[EMAIL PROTECTED]> wrote: > So if I'm understanding this correctly, it really only > installs something in '/Library/Python/2.3/site-packages' Correct. > (as well as > an alias to it from '/System/Library/Frameworks/Python.framework/ > Versions/2.3/lib/python2.3/site-pa

Emacs + python.

2007-08-06 Thread Hadron
Sorry to repeat, but I had to reinstall and lost all my news. I am looking for pointers on using emacs with python. I use emacs v 22.0.91 (Ubuntu snapshot). It comes with its own python mode. The problem is that the debugger just hangs when I start it. The interpreter runs fine. Any ideas? Wha

Re: Global package variable, is it possible?

2007-08-06 Thread Ben Finney
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > I've read all the thread, and it seems that your problem is mostly > to share a single dynamic state (the config) between several > modules. So I do wonder: have you considered the use of the > Singleton pattern (or one of it's variants...) ? Pyth

webbrowser.open question force Firefox

2007-08-06 Thread dimitri pater
Hi, I have a question regarding the use of webbrowser.open. On a windows XP machine, MS-IE is set as the default browser so when I do: webbrowser.open('http://localhost:8080') IE starts with this address. But in stead of launching IE, I want to launch Firefox *without* setting Firefox as the defaul

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Paul Rubin
Carsten Haese <[EMAIL PROTECTED]> writes: > For instance, if you never use print statements in your code, you won't > notice that print is becoming a function. If you do, you'll have to make > appropriate accommodations. Why on earth did they make this change? It just seems gratuitous. Is the as

Sorting Unix mailboxes

2007-08-06 Thread harold barker
Was your mailbox module competed? If so where can i find it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: >> For instance, if you never use print statements in your code, you won't >> notice that print is becoming a function. If you do, you'll have to make >> appropriate accommodations. > > Why on earth did they make this cha

Re: Emacs + python.

2007-08-06 Thread Thomas Jollans
On Monday 06 August 2007, Hadron wrote: > Sorry to repeat, but I had to reinstall and lost all my news. This list is archived at a number of publically accessible sites, for example: http://mail.python.org/pipermail/python-list/ http://dir.gmane.org/gmane.comp.python.general http://www.mail-archi

Re: webbrowser.open question force Firefox

2007-08-06 Thread Thomas Jollans
On Monday 06 August 2007, dimitri pater wrote: > Hi, > I have a question regarding the use of webbrowser.open. > On a windows XP machine, MS-IE is set as the default browser so when I do: > webbrowser.open('http://localhost:8080') IE starts with this address. > But in stead of launching IE, I want

Re: Emacs + python.

2007-08-06 Thread Hadron
Hadron <[EMAIL PROTECTED]> writes: > Sorry to repeat, but I had to reinstall and lost all my news. > > I am looking for pointers on using emacs with python. I use emacs v > 22.0.91 (Ubuntu snapshot). > > It comes with its own python mode. > > The problem is that the debugger just hangs when I star

pygtk how to get treeview row(name) from a popup menu

2007-08-06 Thread kamu
hi all, thanks in advance for your valuable reply. I have a pygtk code. which is a simple tree view. and when i click on any row of the tree view, i get a menu poped up. and i can click on the options in the poped up menu. and it goes to a function. up to this its fine with me. but now from this f

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-06, Paul Rubin wrote: >> Carsten Haese <[EMAIL PROTECTED]> writes: >>> For instance, if you never use print statements in your code, >>> you won't notice that print is becoming a function. If you >>> do, you'll have to make approp

Re: Something in the function tutorial confused me.

2007-08-06 Thread Alex Popescu
Stargaming <[EMAIL PROTECTED]> wrote in news:46b6df49$0$26165 [EMAIL PROTECTED]: > On Sun, 05 Aug 2007 23:50:24 -0700, Lee Fleming wrote: > >> Hello, >> I have a simple question. Say you have the following function: >> >> def f(x, y = []): >> y.append(x) >> return y >> >> print f(23) #

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote: > I have a simple question. Say you have the following function: > > def f(x, y = []): > y.append(x) > return y > > print f(23) # prints [23] > print f(42) # prints [23, 42] > > def f(x, y=None): > if y is None: y = [] > y.app

Re: Eclipse/PyDev question.

2007-08-06 Thread king kikapu
> I like pydev and purchased the extensions ... there are bugs of course but > what stopped me from using it is a project were I had some very large files > (my fault). What do you mean by "very large files" ? Can't PyDev handle such ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Best programs written completly in Python

2007-08-06 Thread Wolfgang Draxinger
Franz Steinh�usler wrote: > wWhat are the best programs in your opinion, written entirly > in pyhton, divided into categories like: > a) Games > b) Utilities/System > c) Office > d) Web/Newsreader/Mail/Browser BitTorrent. It may not seem much but it's a really cool package. Especially you don't h

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote: >> def f(x, y=None): >> if y is None: y = [] >> y.append(x) >> return y > > >>> f(f(23)) > [23, 42] Sorry. That should've been: >>> f(42, f(23)) [23, 42] -- Neil Ceru

Re: Best programs written completly in Python

2007-08-06 Thread Paul Rubin
Franz Steinhäusler <[EMAIL PROTECTED]> writes: > b) Utilities/System I'm not sure if anyone has mentioned mercurial in this thread. It's a distributed source control system, sort of the next generation after systems like CVS/SVN. See www.selenic.com/mercurial > d) Web/Newsreader/Mail/Browser M

Re: Best programs written completly in Python

2007-08-06 Thread Sönmez Kartal
On 5 A ustos, 13:14, Franz Steinhäusler <[EMAIL PROTECTED]> wrote: > Hello NG, > > wWhat are the best programs in your opinion, written entirly > in pyhton, divided into categories like: > a) Games > b) Utilities/System > c) Office > d) Web/Newsreader/Mail/Browser > ... > > I don't want to start a

Re: Something in the function tutorial confused me.

2007-08-06 Thread Stargaming
On Mon, 06 Aug 2007 11:13:45 +, Alex Popescu wrote: > Stargaming <[EMAIL PROTECTED]> wrote in news:46b6df49$0$26165 > [EMAIL PROTECTED]: > [snip] >> >> You're just unluckily shadowing the name `y` in the local scope of > your >> function. Your code snippet could be rewritten as:: >> >> de

Re: Misleading wikipedia article on Python 3?

2007-08-06 Thread Paul Boddie
On 6 Aug, 12:11, Paul Rubin wrote: > Carsten Haese <[EMAIL PROTECTED]> writes: > > For instance, if you never use print statements in your code, you won't > > notice that print is becoming a function. If you do, you'll have to make > > appropriate accommodations. > > Why

RE:xlrd question

2007-08-06 Thread JYOUNG79
Hi Has, >> (as well as >> an alias to it from '/System/Library/Frameworks/Python.framework/ >> Versions/2.3/lib/python2.3/site-packages') >No, /System.../python2.3/site-packages is a symlink to /Library/Python/ >2.3/site-packages set up by Apple. DistUtils makes no modification to >anything und

Scope question

2007-08-06 Thread Nitro
Hello, today I wrote this piece of code and I am wondering why it does not work the way I expect it to work. Here's the code: y = 0 def func(): y += 3 func() This gives an UnboundLocalError: local variable 'y' referenced before assignment If I change the function like this: y = 0 def f

Re: (Re)announcing APL 2007

2007-08-06 Thread Paul Mansour
On Aug 5, 11:54 pm, Mike Kent <[EMAIL PROTECTED]> wrote: > APL 2007 conference on Array Programming > > co-located with OOPSLA 2007 > > Sponsor: ACM SIGAPL > > Where:Montreal > > When: October 21 (tutorials) >October 22/23 (

I need help speeding up an app that reads football scores andgenerates rankings

2007-08-06 Thread Lincoln Rozelle
Hey Terry I got your name from the following page: http://mail.python.org/pipermail/python-list/2007-May/438521.html I'm interested in producing a web-app for football games that runs in python. When I talk about football, since I'm in Europe though, I mean soccer. Which football do you mea

Re: wxpython with python 2.5

2007-08-06 Thread PPGOES
Try with this: import wxversion wxversion.select("2.8") import wx G-18 wrote: > > Hello, > > > I am trying to get wxpython to run with python 2.5 without any > success. > wx works prefectly in python 2.4. below is the error code i get when i try > to run the code. > File "demo.py", l

Re: Scope question

2007-08-06 Thread Diez B. Roggisch
Nitro wrote: > Hello, > > today I wrote this piece of code and I am wondering why it does not work > the way I expect it to work. Here's the code: > > y = 0 > def func(): > y += 3 > func() > > This gives an > > UnboundLocalError: local variable 'y' referenced before assignment > > If I c

Re: Script that Navigates Page needs Javascript Functionality

2007-08-06 Thread Dave Borne
> in order to view the results I need I need python to "navigate to" > this Javascript link: > javascript:__doPostBack('ctl00$cpMain$pagerTop','4') This basically > translates into "go to page 4." > I read the posts on this group, and from what I understand, the > functionality I need is with simp

Re: Scope question

2007-08-06 Thread Nitro
Thanks a lot for clearing this up, Diez! -Matthias -- http://mail.python.org/mailman/listinfo/python-list

Announcing Wing IDE 101 for teaching intro programming courses

2007-08-06 Thread Wingware
Hi, We're pleased to announce the first public beta release of Wing IDE 101, a free scaled back edition of Wing IDE that was designed for teaching introductory programming courses. We are releasing Wing IDE 101 to the general public in the hopes that it may help others teach with or learn Python.

Re: webbrowser.open question force Firefox

2007-08-06 Thread kyosohma
On Aug 6, 5:42 am, Thomas Jollans <[EMAIL PROTECTED]> wrote: > On Monday 06 August 2007, dimitri pater wrote: > > > Hi, > > I have a question regarding the use of webbrowser.open. > > On a windows XP machine, MS-IE is set as the default browser so when I do: > > webbrowser.open('http://localhost:80

Importing * From a Package

2007-08-06 Thread Patrick Doyle
Reading through the Python tutorial, I got to section 6.4.1, "Importing * From a Package", which states: "If __all__ is not defined, the statement from Sound.Effects import * does not import all submodules from the package Sound.Effects into the current namespace; ..." It then goes on to state:

boolean operations on sets

2007-08-06 Thread Flavio
Hi, I have been playing with set operations lately and came across a kind of surprising result given that it is not mentioned in the standard Python tutorial: with python sets, intersections and unions are supposed to be done like this: In [7]:set('casa') & set('porca') Out[7]:set(['a', 'c'])

Re: Tkinter or wxpython?

2007-08-06 Thread kyosohma
On Aug 2, 7:00 pm, "wang frank" <[EMAIL PROTECTED]> wrote: > Hi, > > I want to build a GUI to execut python script. I found TKinter and > wxpython. Which one is easier for a newbie? and which one is better? > > Thanks > > Frank > > _ >

Re: Importing * From a Package

2007-08-06 Thread Jean-Paul Calderone
On Mon, 6 Aug 2007 10:06:51 -0400, Patrick Doyle <[EMAIL PROTECTED]> wrote: >Reading through the Python tutorial, I got to section 6.4.1, >"Importing * From a Package", which states: > >"If __all__ is not defined, the statement from Sound.Effects import * >does not import all submodules from the pa

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I've read that Tkinter doesn't scale well if you're writing complex > GUIs. I haven't been able to test this hypothesis though. However, > since I had to rewrite VBA apps into Python, to get the right "look > and feel" I needed the widgets that wxPython provided. Since

Re: Scope question

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Nitro <[EMAIL PROTECTED]> wrote: > Hello, > > today I wrote this piece of code and I am wondering why it does > not work the way I expect it to work. Here's the code: > > y = 0 > def func(): > y += 3 > func() > > This gives an > > UnboundLocalError: local variable 'y' reference

Re: Tkinter or wxpython?

2007-08-06 Thread kyosohma
On Aug 6, 9:39 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > I've read that Tkinter doesn't scale well if you're writing complex > > GUIs. I haven't been able to test this hypothesis though. However, > > since I had to rewrite VBA apps into Python, to get the rig

Re: Tkinter or wxpython?

2007-08-06 Thread Chris Mellon
On 06 Aug 2007 07:39:12 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > [EMAIL PROTECTED] writes: > > I've read that Tkinter doesn't scale well if you're writing complex > > GUIs. I haven't been able to test this hypothesis though. However, > > since I had to rewrite VBA apps into Pyth

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I agree that making web apps is probably the way of the future. > However, there are lots of security risks involved with it that need > to be understood. One of the problems that raging is about AJAX, see > here: > http://arstechnica.com/news.ars/post/20070802-security

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
"Chris Mellon" <[EMAIL PROTECTED]> writes: > No native look and feel - constrained by the browser. Might or might not matter for the application, especially considering that tkinter is part of the discussion. > No control over browser UI idioms. I had to write this post twice > because the text c

Re: Tkinter or wxpython?

2007-08-06 Thread kyosohma
On Aug 6, 9:58 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 06 Aug 2007 07:39:12 -0700, Paul Rubin > > > > <"http://phr.cx"@nospam.invalid> wrote: > > [EMAIL PROTECTED] writes: > > > I've read that Tkinter doesn't scale well if you're writing complex > > > GUIs. I haven't been able to test t

computer, printer, and another

2007-08-06 Thread angga_cute
Hi guys I have some information for you... I would like you to invite to visiting my web, may be you need some information about newest information about computer, laptop, and than printer. I have little bit information on my web http://www.komputer-djogja.blogspot.com/ I hope my web can give

Re: boolean operations on sets

2007-08-06 Thread Steve Holden
Flavio wrote: > Hi, I have been playing with set operations lately and came across a > kind of surprising result given that it is not mentioned in the > standard Python tutorial: > > with python sets, intersections and unions are supposed to be done > like this: > In [7]:set('casa') & set('porc

Re: computer, printer, and another

2007-08-06 Thread kyosohma
On Aug 6, 10:21 am, angga_cute <[EMAIL PROTECTED]> wrote: > Hi guys > I have some information for you... > I would like you to invite to visiting my web, may be you need some > information about newest information about computer, laptop, and than > printer. I have little bit information on my

Re: Tkinter or wxpython?

2007-08-06 Thread Kevin Walzer
Paul Rubin wrote: > > Tkinteger (dang, I always end up typing it that way, I won't even > bother fixing the error) is easy to use for simple gui's, and it's > part of the standard python distro which for me is a big advantage (no > extra crap to download). However, the widget set is rather ugly

Re: boolean operations on sets

2007-08-06 Thread Thomas Jollans
On Monday 06 August 2007, Flavio wrote: > So My question is: Why has this been implemented in this way? I can > see this confusing many newbies... I did not implement this, so I cannot say, but it does have useful side-effects, for example: x = A or B is equivalent to: if A: x = A else: x

Re: boolean operations on sets

2007-08-06 Thread Diez B. Roggisch
Flavio wrote: > Hi, I have been playing with set operations lately and came across a > kind of surprising result given that it is not mentioned in the > standard Python tutorial: > > with python sets, intersections and unions are supposed to be done > like this: > In [7]:set('casa') & set('por

Re: Tkinter or wxpython?

2007-08-06 Thread Chris Mellon
On 06 Aug 2007 08:20:20 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > No native look and feel - constrained by the browser. > > Might or might not matter for the application, especially considering > that tkinter is part of the discussion

udp, datagram sockets

2007-08-06 Thread 7stud
I'm trying to understand datagrams. My client program sends a message to the server, and then the server infinitely loops over the recv() to make sure all the data was received. I'm trying to use an * to signal the end of the message, so that the server can break out of the infinite while loop us

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
Paul Rubin writes: > > No native integration - no "open file", no "browse the filesystem", no > > rich drag and drop, no copy/paste. > > File i/o and file system browsing are available from javascript if the > user grants permission. File system browsing for the limited

Re: boolean operations on sets

2007-08-06 Thread Stargaming
On Mon, 06 Aug 2007 14:13:51 +, Flavio wrote: > Hi, I have been playing with set operations lately and came across a > kind of surprising result given that it is not mentioned in the standard > Python tutorial: > > with python sets, intersections and unions are supposed to be done > like t

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
"Chris Mellon" <[EMAIL PROTECTED]> writes: > > Might or might not matter for the application, especially considering > > that tkinter is part of the discussion. > The point is that you have no option with the browser - even Tkinter > has platform theming support now. Hmm, I don't know anything abo

Re: udp, datagram sockets

2007-08-06 Thread Thomas Jollans
On Monday 06 August 2007, 7stud wrote: > I'm trying to understand datagrams. My client program sends a message > to the server, and then the server infinitely loops over the recv() to > make sure all the data was received. I'm trying to use an * to signal > the end of the message, so that the ser

Re: udp, datagram sockets

2007-08-06 Thread Jean-Paul Calderone
On Mon, 06 Aug 2007 09:03:45 -0700, 7stud <[EMAIL PROTECTED]> wrote: >I'm trying to understand datagrams. My client program sends a message >to the server, and then the server infinitely loops over the recv() to >make sure all the data was received. I'm trying to use an * to signal >the end of th

Re: Something in the function tutorial confused me.

2007-08-06 Thread Lee Fleming
On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: Because when the function is called, the line > if y is None: y = [] is executed, binding a brand new empty list to y. This "rebinding" happens every time the function is called, unless you provide an argument for y that is not Non

Re: Tkinter or wxpython?

2007-08-06 Thread kyosohma
On Aug 6, 10:27 am, Kevin Walzer <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > > Tkinteger (dang, I always end up typing it that way, I won't even > > bother fixing the error) is easy to use for simple gui's, and it's > > part of the standard python distro which for me is a big advantage (no >

RE: Something in the function tutorial confused me.

2007-08-06 Thread Hamilton, William
> From: Lee Fleming > > On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Because when the function is called, the line > > > > if y is None: y = [] > > > is executed, binding a brand new empty list to y. This > "rebinding" happens every time the function is called, unless you

Re: Tkinter or wxpython?

2007-08-06 Thread Chris Mellon
On 06 Aug 2007 09:44:15 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > > Might or might not matter for the application, especially considering > > > that tkinter is part of the discussion. > > The point is that you have no option with the

is it possible to improve traceback messages ?

2007-08-06 Thread Stef Mientki
hello, Most of time I get an error message, it is sufficient to solve to problem. Sometimes it's not clear to me what the problem is like this one: N = int (log10(self.Value)) + 1 TypeError: int() argument must be a string or a number In order to solve it, in general I put some print statem

Re: Tkinter or wxpython?

2007-08-06 Thread Kevin Walzer
[EMAIL PROTECTED] wrote: > > I tried the PMW widget toolkit. It was ok, but it seemed kind of > buggy. I found out about Tix on a forum of some sort. When I tried to > find out how to get it and use it, all I found was conflicting > information. I finally got it downloaded only to find I had to c

Re: is it possible to improve traceback messages ?

2007-08-06 Thread Chris Mellon
On 8/6/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > Most of time I get an error message, it is sufficient to solve to problem. > Sometimes it's not clear to me what the problem is > like this one: > > N = int (log10(self.Value)) + 1 > TypeError: int() argument must be a string or a

Re: Something in the function tutorial confused me.

2007-08-06 Thread Lee Fleming
On Aug 6, 12:30 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > When you call f(23), the variable y within it gets created and points at > None. When f(23) exits, the y that it created gets destroyed. (Well, > goes out of scope, but even if it's not garbage collected it won't ever > come ba

wxWindows - incorrect path on installation?

2007-08-06 Thread frikk
This should be a very simple one, sorry! I installed wxWindows on my OS X box but I am unable to get my python install to recognize the module. Unfortunately I don't know a whole lot about where modules install to or how to configure python to see them. IE: 'import wx' does not work - it says un

Re: wxWindows - incorrect path on installation?

2007-08-06 Thread Kevin Walzer
frikk wrote: > This should be a very simple one, sorry! > > I installed wxWindows on my OS X box but I am unable to get my python > install to recognize the module. Unfortunately I don't know a whole > lot about where modules install to or how to configure python to see > them. IE: 'import wx' d

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote: > On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Because when the function is called, the line > > >> if y is None: y = [] > > > is executed, binding a brand new empty list to y. This > "rebinding" happens every time the funct

can't import SimpleXMLRPCDisptacher from SimpleXMLRPCServer

2007-08-06 Thread bhamdeveloper
from my server I can't import SimpleXMLRPCDispatcher. please see http://intertubewaypoint.com/metaweblog/ for the stacktrace/error message. This onle happens on my server; I am trying to integrate the metaweblog api into my blog and it is barfing when trying to get that dispatcher. Anyone seen t

Re: Something in the function tutorial confused me.

2007-08-06 Thread Neil Cerutti
On 2007-08-06, Lee Fleming <[EMAIL PROTECTED]> wrote: > On Aug 6, 12:30 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: >> When you call f(23), the variable y within it gets created and points at >> None. When f(23) exits, the y that it created gets destroyed. (Well, >> goes out of scope, but

Re: Something in the function tutorial confused me.

2007-08-06 Thread Marc 'BlackJack' Rintsch
On Mon, 06 Aug 2007 10:51:20 -0700, Lee Fleming wrote: > why isn't the y in def f (x, y = []): something > garbage-collected? `y` is a name. Only objects are garbage collected. There is no `y` in that ``def`` in the sense that a local name `y` exists when the ``def`` is executed. The line just

RE: Something in the function tutorial confused me.

2007-08-06 Thread Hamilton, William
> From: Lee Fleming > On Aug 6, 12:30 pm, "Hamilton, William " <[EMAIL PROTECTED]> wrote: > > When you call f(23), the variable y within it gets created and points at > > None. When f(23) exits, the y that it created gets destroyed. (Well, > > goes out of scope, but even if it's not garbage collec

Re: Tkinter or wxpython?

2007-08-06 Thread Steve Holden
Chris Mellon wrote: > On 06 Aug 2007 09:44:15 -0700, Paul Rubin > <"http://phr.cx"@nospam.invalid> wrote: >> "Chris Mellon" <[EMAIL PROTECTED]> writes: [...] >> Again, it all depends on what you're trying to do. For data entry >> stuff you probably want the data on a remote server anyway, and you

Re: Tkinter or wxpython?

2007-08-06 Thread Bryan Hepworth
Chris Mellon wrote: > On 06 Aug 2007 09:44:15 -0700, Paul Rubin > <"http://phr.cx"@nospam.invalid> wrote: > >> "Chris Mellon" <[EMAIL PROTECTED]> writes: >> Might or might not matter for the application, especially considering that tkinter is part of the discussion.

Conspiracies Revealed! Shadow governments

2007-08-06 Thread conspiracy . black6
http://nasaconspiracy.net/conspiracy - Find out who really shot JFK!, learn how they faked the lunar landing, see what they are putting in our milk to enlarge young womens breasts in a goal to raise the declining birth rate. Proof of extraterrestrial life and much more revealed here. -- http://m

Re: Something in the function tutorial confused me.

2007-08-06 Thread Lee Fleming
Thanks for all the help, everyone. I guess I was confused with default arguments that were mutable and immutable. I will continue to look over these posts until I understand what is happening. I cannot believe the number of helpful responses I got! -- http://mail.python.org/mailman/listinfo/pyth

Re: Something in the function tutorial confused me.

2007-08-06 Thread Steve Holden
Lee Fleming wrote: > On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > Because when the function is called, the line > > >> if y is None: y = [] > > > is executed, binding a brand new empty list to y. This > "rebinding" happens every time the function is called, unless you > pro

automatically setting platform-dependent location for Distutils "install-scripts"?

2007-08-06 Thread jomorcsi
Hello all, I am developing a Python-based tool that will be deployed both in a Windows and in a Linux environment, and I have a question concerning the use of the Distutils module to manage the installation of the tool in a transparent manner. A bit of background info: 1. (I am using Python versi

Re: udp, datagram sockets

2007-08-06 Thread 7stud
On Aug 6, 10:59 am, Thomas Jollans <[EMAIL PROTECTED]> wrote: > > You don't make any attempt to break out of the outer loop. (break breaks the > innermost loop) > By design. My server stands ready to process any and all messages forever. The problem I'm having is that my server processes the sam

Re: Tkinter or wxpython?

2007-08-06 Thread kyosohma
On Aug 6, 12:49 pm, Kevin Walzer <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > I tried the PMW widget toolkit. It was ok, but it seemed kind of > > buggy. I found out about Tix on a forum of some sort. When I tried to > > find out how to get it and use it, all I found was conflicting

Re: udp, datagram sockets

2007-08-06 Thread 7stud
On Aug 6, 11:05 am, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > > The network is probably dropping some of your data, causing the server > to never see the termination marker. > As far as I can tell, the output disproves that notion. If the termination character were somehow lost in transm

Re: wxWindows - incorrect path on installation?

2007-08-06 Thread kyosohma
On Aug 6, 12:54 pm, frikk <[EMAIL PROTECTED]> wrote: > This should be a very simple one, sorry! > > I installed wxWindows on my OS X box but I am unable to get my python > install to recognize the module. Unfortunately I don't know a whole > lot about where modules install to or how to configure p

Re: Importing * From a Package

2007-08-06 Thread kyosohma
On Aug 6, 9:06 am, "Patrick Doyle" <[EMAIL PROTECTED]> wrote: > Reading through the Python tutorial, I got to section 6.4.1, > "Importing * From a Package", which states: > > "If __all__ is not defined, the statement from Sound.Effects import * > does not import all submodules from the package Soun

Any Good Book To Start ?

2007-08-06 Thread Katie Tam
Please let me know any good book to start ? Thank You Katie Tam CCNP, CCDP LinkWaves Corporation **Leading Provider of Cisco Equipment** http://www.linkwaves.com -- http://mail.python.org/mailman/listinfo/python-list

Re: amra and py2exe

2007-08-06 Thread Larry Bates
vinod wrote: > Hi i am having trouble creating exe using py2exe for amara package > i saw some posts related to this talking about amara cat file but i > dont have any cat file for amara on my machine. > the standalone script runs fine. i am using python on windows > here is the error i am getting

Re: Something in the function tutorial confused me.

2007-08-06 Thread Lee Fleming
On Aug 6, 1:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Lee Fleming wrote: > > On Aug 6, 6:25 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > Because when the function is called, the line > > >> if y is None: y = [] > > > is executed, binding a brand new empty list to y. This > > "rebindi

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Define "functionality". From the rest of your posts, that seems to be > limited to "press buttons" and "type small amounts of non-formatted > text" on the interaction side and "display small amounts of simply > formatted text" on the output side. OK, I

Re: Tkinter or wxpython?

2007-08-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Yeah...I would assume I would enjoy Tkinter more if I knew more tcl. > Until that day arrives though, it will probably still be fairly > confusing for me to figure out. I do like it's "pythonic" style > though. I've managed to program tkinter without knowing anything ab

RTF 2 Tiff

2007-08-06 Thread cjankowski
Hi all, I am trying to convert an RTF file to a Tiff image using Python. This process will convert several hundred images daily. Currently I am able to get the RTF file into a text format using Rtf2Txt.py, but I loose the images contained in the RTF file. I have the same problem when I convert t

Re: Any Good Book To Start ?

2007-08-06 Thread kyosohma
On Aug 6, 2:02 pm, Katie Tam <[EMAIL PROTECTED]> wrote: > Please let me know any good book to start ? Thank You > > Katie Tam > CCNP, CCDP > LinkWaves Corporation > **Leading Provider of Cisco Equipment**http://www.linkwaves.com To start learning Python or what? "Python Programming 3rd Ed." by Lu

Re: Any Good Book To Start ?

2007-08-06 Thread cjankowski
On Aug 6, 3:15 pm, [EMAIL PROTECTED] wrote: > On Aug 6, 2:02 pm, Katie Tam <[EMAIL PROTECTED]> wrote: > > > Please let me know any good book to start ? Thank You > > > Katie Tam > > CCNP, CCDP > > LinkWaves Corporation > > **Leading Provider of Cisco Equipment**http://www.linkwaves.com > > To start

Re: udp, datagram sockets

2007-08-06 Thread Carsten Haese
On Mon, 2007-08-06 at 09:03 -0700, 7stud wrote: > server: > -- > import socket > import sys > > s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > s.bind(("", )) > [...] > #Send messages back to client: > total_sent = 0 > while total_sent < len(messa

Re: encode() question

2007-08-06 Thread Omari Norman
On Tue, Jul 31, 2007 at 09:53:11AM -0700, 7stud wrote: > s1 = "hello" > s2 = s1.encode("utf-8") > > s1 = "an accented 'e': \xc3\xa9" > s2 = s1.encode("utf-8") > > The last line produces the error: > > --- > Traceback (most recent call last): > File "test1.py", line 6, in ? > s2 = s1.encode

  1   2   >