Re: (n00b) Tkinter trouble

2011-11-13 Thread Jason Swails
On Sun, Nov 13, 2011 at 1:27 PM, Jason Swails wrote: > Hello, > > I'm trying my hand at creating a Tkinter application, but not having much > luck. I'm trying to have my top level window be a series of buttons with > different options on them. Every time a button is pressed, it opens up a > new

Re: Get keys from a dicionary

2011-11-13 Thread alex23
On Nov 11, 11:31 pm, macm wrote: > > I pass a nested dictionary to a function. > > def Dicty( dict[k1][k2] ): > print k1 > print k2 > > There is a fast way (trick) to get k1 and k2 as string. It might be possible to do something using a reverse dictionary and getting rid of the ne

Re: Get keys from a dicionary

2011-11-13 Thread alex23
On Nov 11, 11:31 pm, macm wrote: > > I pass a nested dictionary to a function. > > def Dicty( dict[k1][k2] ): > print k1 > print k2 > > There is a fast way (trick) to get k1 and k2 as string. It might be possible to do something using a reverse dictionary and getting rid of the ne

Re: Uninstalling Py 2.5.2 from Windows 7 (Invalid on Win 32 app)

2011-11-13 Thread W. eWatson
I just pushed aside the python25 folder by renaming it, and installed py 2.5.2. However, when I try to open the simplest of py programs with IDLE, I get an error from Win7. c:\Users\blah\...\junk.py is not a valid Win 32 app. Here's one: def abc(one): print "abc: ", one, " is one" def duh

Re: all() is slow?

2011-11-13 Thread Devin Jeanpierre
> It states equivalence for two values _based on the name_. I don't know what you mean. "Based on the name" doesn't mean anything in particular to me in this context. > So you're outright ignoring the comments that this behaviour is to > make CPython more performant? I don't see how I'm ignoring

Re: all() is slow?

2011-11-13 Thread alex23
On Nov 13, 4:28 pm, Devin Jeanpierre wrote: > > which implies that getattr(x, 'a!b') should be equivalent to x.a!b > > No, it does not. The documentation states equivalence for two > particular values It states equivalence for two values _based on the name_. "If the string is the name of one of

Re: Slave to master auto linking.

2011-11-13 Thread Chris Angelico
2011/11/14 Богун Дмитрий : > m = master() > s = m.slave() > s.master is m > Can you simply have m.slave() pass a parameter to the slave's constructor? class Master(object): class Slave(object): def __init__(self,master): self.master=master print 'Slave.__init__: se

Slave to master auto linking.

2011-11-13 Thread Богун Дмитрий
Hello. I try make some weird thing. I want to get from code like this: class master: ... class slave: ... m = master() s = m.slave() s.master is m Last expression must be true. I want link "master" to be set automatically by master object while creating slave object. Additional

[ANN] PikoTest.py - a small testing library

2011-11-13 Thread Makoto Kuwata
I released PikoTest.py 0.1.0. http://pypi.python.org/pypi/PicoTest PikoTest.py is a samll testing library for Python. Features: * Structured Test * Setup/Teardown * Fixture Injection * Skip Test * TODO Example:: from __future__ import with_statement import picotest test = picotest.

Re: Uninstalling Py 2.5.2 from Windows 7

2011-11-13 Thread W. eWatson
Well, let be a careful a little more. I have PIL, numpy, scipy, pymatplotlib and pyephem installed, I think. There are Removeexe files in the python25 folder for them. There's also a Removepy2exe.exe. Probably that was somehow used to get out py2.5. -- http://mail.python.org/mailman/listin

Re: Uninstalling Py 2.5.2 from Windows 7

2011-11-13 Thread W. eWatson
On 11/13/2011 2:08 PM, Terry Reedy wrote: On 11/13/2011 12:46 PM, W. eWatson wrote: For many months I had sporadically used 2.5.2 under Win 7, then something went awry. I tried an uninstall/install and it didn't get any better. I thought I'd take another shot at it today. The uninstall went OK,

Re: Trying to write beautifulsoup result to a file and get error message

2011-11-13 Thread MRAB
On 13/11/2011 22:37, goldtech wrote: If I try: ... soup = BeautifulSoup(ft3) f = open(r'c:\NewFolder\clean4.html', "w") f.write(soup) f.close() I get error message: Traceback (most recent call last): File "C:\Documents and Settings\user01\Desktop\py\tb1a.py", line 203, in f.write(soup)

Trying to write beautifulsoup result to a file and get error message

2011-11-13 Thread goldtech
If I try: ... soup = BeautifulSoup(ft3) f = open(r'c:\NewFolder\clean4.html', "w") f.write(soup) f.close() I get error message: Traceback (most recent call last): File "C:\Documents and Settings\user01\Desktop\py\tb1a.py", line 203, in f.write(soup) TypeError: expected a character buffer o

Re: Use and usefulness of the as syntax

2011-11-13 Thread Terry Reedy
On 11/13/2011 3:55 AM, 0xfn wrote: On Nov 12, 7:48 am, Rafael Durán Castañeda wrote: El 12/11/11 13:43, Tim Chase escribió:> I hate trying to track down variable-names if one did something like from Tkinter import * +1 Really, this questionable code is always mentioned as example

Re: Uninstalling Py 2.5.2 from Windows 7

2011-11-13 Thread Terry Reedy
On 11/13/2011 12:46 PM, W. eWatson wrote: For many months I had sporadically used 2.5.2 under Win 7, then something went awry. I tried an uninstall/install and it didn't get any better. I thought I'd take another shot at it today. The uninstall went OK, but c:\python25 remained with several py fi

Re: can't decompress data; zlib not available

2011-11-13 Thread Tim Wintle
On Sun, 2011-11-13 at 11:17 -0700, Steve Edlefsen wrote: > > which appears to install zlib when python is reinstalled. Except I > can't run make without errors and there is no configuration file. > > How do I reinstall python to include zlib? Which OS are you on? Linux? BSD? How did you instal

Re: Uninstalling Py 2.5.2 from Windows 7

2011-11-13 Thread Irmen de Jong
On 13-11-11 18:46, W. eWatson wrote: For many months I had sporadically used 2.5.2 under Win 7, then something went awry. I tried an uninstall/install and it didn't get any better. I thought I'd take another shot at it today. The uninstall went OK, but c:\python25 remained with several py files a

(n00b) Tkinter trouble

2011-11-13 Thread Jason Swails
Hello, I'm trying my hand at creating a Tkinter application, but not having much luck. I'm trying to have my top level window be a series of buttons with different options on them. Every time a button is pressed, it opens up a new window with options. While that new window is open, all of the b

can't decompress data; zlib not available

2011-11-13 Thread Steve Edlefsen
Hi, I'm trying to install a tool for Plone called ZopeSkel, but when I run the setup file ez_setup.py, I get dr_shred@merle:~$ ez_setup.py Downloading http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg Traceback (most recent call last): File "/home/dr_shred/python/e

Uninstalling Py 2.5.2 from Windows 7

2011-11-13 Thread W. eWatson
For many months I had sporadically used 2.5.2 under Win 7, then something went awry. I tried an uninstall/install and it didn't get any better. I thought I'd take another shot at it today. The uninstall went OK, but c:\python25 remained with several py files and a folder, Lib. I went ahead with

Re: xmlrpclib date times and a trailing Z

2011-11-13 Thread Travis Parks
On Nov 11, 7:20 pm, Travis Parks wrote: > I am trying to connect to Marchex's a call tracking software using > xmlrpclib. I was able to get some code working, but I ran into a > problem dealing with transfering datetimes. > > When I construct a xmlrpclib.ServerProxy, I am setting the > use_datetim

Re: How to indent blocks when readline completion is on?

2011-11-13 Thread Chris Angelico
On Mon, Nov 14, 2011 at 12:30 AM, Steven D'Aprano wrote: > I thought I could add a wrapper around the rlcompleter method, like this: > import readline import rlcompleter readline.parse_and_bind("tab: complete") completer = readline.get_completer() def wrapped_completer(tex

How to indent blocks when readline completion is on?

2011-11-13 Thread Steven D'Aprano
I have set up readline completion as described here: http://docs.python.org/library/rlcompleter.html Now how do I indent blocks in the interactive interpreter? If I press the TAB key, the completer prompts me instead of indenting: >>> readline.parse_and_bind("tab: complete") >>> while True: ...

socket.socket.makefile

2011-11-13 Thread Matt Joiner
I'm writing an alternative socket module, and have come across the code for the makefile call, which mentions the following: (XXX refactor to share code?) http://hg.python.org/cpython/file/27adb952813b/Lib/socket.py#l149 Has this been refactored elsewhere? Is there something I can use to wrap the S

RE: Dynamically altering __init__

2011-11-13 Thread Kääriäinen Anssi
I wrote: """ I will post a link to a complete example once I have done the AST transformations etc. I hope this will be useful to readers of this list. I didn't find such an example, so maybe the next asker will find it... """ Finally got time to do this. The example can be found at: https://githu

Re: Use and usefulness of the as syntax

2011-11-13 Thread 0xfn
On Nov 12, 7:48 am, Rafael Durán Castañeda wrote: > El 12/11/11 13:43, Tim Chase escribió:>   I hate trying to track down > variable-names if one did something like > > >   from Tkinter import * > > +1 Really, this questionable code is always mentioned as example in Tkinter tuts. IMHO much bette