Python tk Listbox: -listvariable class (on win XP)

2010-01-11 Thread Looney, James B
I mentioned that I figured out how to use a variable with a Python TK Listbox in my post (http://www.mail-archive.com/python-list@python.org/msg271288.html). Now, I'm trying to make a class, ListVar, that allows me to operate on a Listbox's listvariable as if it were a list. The problem is, it

Python tk Listbox: -listvariable

2010-01-06 Thread Looney, James B
Yesterday, I searched all over trying to figure out how to properly use the listvariable argument with tk's Listbox class. Unfortunately, no amount of searching (online) could come up with anything more useful than telling me the variable needed to be a list, and nothing built-in exists. I

Confused about error: invalid Python installation: unable to open ..../python2.4/config/Makefile

2008-07-18 Thread Looney, James B (N-ULA)
I built and installed Python 2.4 on 12/12/2007. Recently, I tried installing python-ldap-2.3.4. The error I received was: error: invalid Python installation: unable to open /usr/local/openSource/architectureIndependent:/usr/local/openSource/IRIX 6/lib/python2.4/config/Makefile (No such file or

Building Python2.4.1 with idle on HPUX11

2007-12-11 Thread Looney, James B
I've been trying to build Python 2.4.1 on an HPUX11. Python builds ok, but idle has issues. And what I don't know is how to determine whether or not Python discovers the tcl/tk libraries (.sl) and headers, or if there's some other problem. If someone has thoughts on either how to invoke

Optimized Python bytecode

2007-11-28 Thread Looney, James B
I'm using SCons to build all kinds of things, and part of our build process involves creating a release version of our software. In the case of Python, that means compiling the .py into a .pyc or .pyo. Because I'm placing the compiled script into a different location from the .py, I have to

RE: the annoying, verbose self

2007-11-21 Thread Looney, James B
There are always tricks. If 5 characters is really too much to type, how about 2 characters s.. Though I would recommend against that since it violates standard Python convention. def foo( self ): becomes def foo( s ): Otherwise, if you happen to be using self.something a lot, just assign it

RE: Writing Error in program

2007-11-20 Thread Looney, James B
There could be any number of issues in your code that could cause that problem. Can you post some of the code in question? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, November 20, 2007 2:03 PM To:

RE: formated local time

2007-11-15 Thread Looney, James B
You could use: import time time.strftime( %Y-%m-%d %H:%M:%S ) or time.strftime( %Y-%m-%d %H:%M:%S, time.localtime() ) Output: '2007-11-15 11:02:34' Both strftime calls are equivalent, in this case. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf

RE: global name is not defined

2007-11-06 Thread Looney, James B
Looks like you forgot to import EMR_globals, EMR_main, etc. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] ] On Behalf Of barronmo Sent: Tuesday, November 06, 2007 2:57 PM To: python-list@python.org Subject: global name is not defined I'm getting an error

RE: shouldn't 'string'.find('ugh') return 0, not -1 ?

2007-10-31 Thread Looney, James B
I believe most programming languages evaluate 0 to mean False, and anything else to be True (for the purposes of boolean evaluation). Python is no exception. From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jelle feringa Sent:

Python equivalent to *nix 'banner' problem

2007-10-23 Thread Looney, James B
banner.dat I have written a Python script to duplicate the 'banner' program from IRIX. Attached is the generated data file. This data is generated the first time by using 'banner' on my IRIX machine. Thereafter, the data is simply used (and can be run from anywhere). The data is a marshaled

Manipulating raw data in Python

2007-08-21 Thread Looney, James B
How do I get access to a data buffer in Python so that I can directly view/modify the data? My buffer size is 256 (for this specific case) bytes. Most of the time, I access want to access that data in 4-byte chunks, sometimes in single byte chunks. How do I go about doing so? I'm certain

Client - web server communication

2007-06-25 Thread Looney, James B
I'm trying to understand how to write an app that runs on my local machine, and talks to a hosted website to get access to the MySQL database I have stored there. I've read a few articles on Basic Authentication, so at least that part I partially understand (I plan on having username/password

RE: DFW Pythoneers Meeting THIS Saturday

2007-06-20 Thread Looney, James B
Short answer: DFW = Dallas-Fort Worth Longer answer: I'm not pointing fingers or making opinions, I just wanted to point out that after reading Jeff's original email (in its entirity), I found: Jeff wrote: snip at the usual location of Nerdbooks.com bookstore in Richardson. For /snip So, after

RE: Please help on Binary file manipulation

2007-06-05 Thread Looney, James B
Pieter, I've found when I have questions like this, that thinking about how I'd do it in C/C++, then searching on some of those key words leads me to a Python equivalent solution, or at least heading down the right path. In this case, I believe you'll find the file module helpfull. You can

RE: os.listdir(file specifications) doesn't work ??

2007-05-14 Thread Looney, James B
The case sensitivity has to do with the OS you're on. So, using glob from Un*x is case sensitive, but from Windows it isn't. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stef Mientki Sent: Monday, May 14, 2007 3:39 PM To: python-list@python.org

RE: preferred windows text editor?

2007-05-09 Thread Looney, James B
I'm using Vim (http://www.vim.org/). -JB -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of T. Crane Sent: Wednesday, May 09, 2007 12:07 PM To: python-list@python.org Subject: preferred windows text editor? Right now I'm using Notepad++. What are other

Using os.popen and os.chdir together

2007-05-08 Thread Looney, James B
Within a script on a *nix machine, I use os.chdir then os.popen, and it appears to me as though the os.chdir had no effect so far as the os.popen is concerned. Why's that? Here's what I'm doing: import os os.path.realpath( os.curdir ) '/home/jlooney' print os.popen( echo $PWD ).readlines()

RE: Using os.popen and os.chdir together

2007-05-08 Thread Looney, James B
ok, nevermind. My coworker pointed out part of what's wrong. Guess I'll need to do more spelunking in my script to figure out what I'm messing up. -JB From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Looney, James B Sent: Tuesday, May 08, 2007 4