Tk.iconname still there?

2006-05-21 Thread Gary Wessle
Hi I am going through a tutorial on Tkinter http://doctormickey.com/python/pythontutorial_201.html, it referees to Tk.iconname() but I could not locate one after googleing and browsed and searched the Tkinter On-line reference material in the Tkinter reference: a GUI for Python, 84 pp. pdf from

getting the value of an attribute from pdb

2006-05-17 Thread Gary Wessle
Hi how can I using pdb get a value of an attribute?, read the docs and played around with pdb 'p' for no avail. thanks class main: def __init__(self, master): self.master = master self.master.title('parent') self.master.geometry('200x150+300+225') ... root = Tk()

continue out of a loop in pdb

2006-05-14 Thread Gary Wessle
Hi using the debugger, I happen to be on a line inside a loop, after looping few times with n and wanting to get out of the loop to the next line, I set a break point on a line after the loop structure and hit c, that does not continue out of the loop and stop at the break line, how is it down, I

Re: copying files into one

2006-05-14 Thread Gary Wessle
thanks, I was able 'using pdb' to fix the problem as per Edward's suggestion. -- http://mail.python.org/mailman/listinfo/python-list

Re: continue out of a loop in pdb

2006-05-14 Thread Gary Wessle
Paul McGuire [EMAIL PROTECTED] writes: Gary Wessle [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi using the debugger, I happen to be on a line inside a loop, after looping few times with n and wanting to get out of the loop to the next line, I set a break point on a line

retain values between fun calls

2006-05-13 Thread Gary Wessle
Hi the second argument in the functions below suppose to retain its value between function calls, the first does, the second does not and I would like to know why it doesn't? and how to make it so it does? thanks # it does def f(a, L=[]): L.append(a) return L print f('a') print f('b')

copying files into one

2006-05-13 Thread Gary Wessle
Hi I am looping through a directory and appending all the files in one huge file, the codes below should give the same end results but are not, I don't understand why the first code is not doing it. thanks combined = open(outputFile, 'wb') for name in flist: if os.path.isdir(file):

TkTable for info gathering

2006-05-12 Thread Gary Wessle
Hi I just finished with 1.5 tutorials about Tkinter, my thought is to use a table maybe TkTable to gather info from the user as to what file to chart data from, as well as info provided by the TkTable properties. each cell of the table will be either empty or contains a file path, let x=1 be

2 books for me

2006-05-11 Thread Gary Wessle
Hi I am about to order 2 books, and thought I should talk to you first. I am getting Python Cookbook by Alex Martelli, David Ascher, Anna Martelli Ravenscroft, Anna Martelli Ravenscroft, since Bruce Eckel's Thinking in Python is not finished and didn't have any new revisions since some time in

Re: installing numpy

2006-05-10 Thread Gary Wessle
Robert Kern [EMAIL PROTECTED] writes: Raymond L. Buvel wrote: Since you are a new Linux user, you should definitely follow Robert's advice about building as an ordinary user separately from the install. I sometimes take a shortcut and just do the install as user root. However, I then

Re: combined files together

2006-05-10 Thread Gary Wessle
Eric Deveaud [EMAIL PROTECTED] writes: Gary Wessle wrote: I need to traverse those files in the order they were created chronologically. listdir() does not do it, is there a way besides build a list then list.sort(), then for element in list_of_files open element? are the name

Re: installing numpy

2006-05-10 Thread Gary Wessle
thanks I followed your suggestions, it built the package ok, while it was building, I noticed lots of lines going by the screen in groups of different colors, white, yellow, red. the red got my attention: Could not locate executable gfortran Could not locate executable f95

two of pylab.py

2006-05-09 Thread Gary Wessle
Hi I use debian/testing linux Linux debian/testing 2.6.15-1-686 I found some duplicate files in my system, I don't if the are both needed, should I delete one of the groups below and which one? -rw-r--r-- 1 root root 80375 2006-01-24 00:28 /usr/lib/python2.3/site-packages/matplotlib/pylab.py

installing numpy

2006-05-09 Thread Gary Wessle
Hi I am trying to install NumPy in my debian/testing linux 2.6.15-1-686. with no numpy for debian/testing, I am left alone, since the experimental version available by debian will result in a dependency nightmares, so after unpacking the downloaded file numpy-0.9.6.tar.gz which crated a

Re: installing numpy

2006-05-09 Thread Gary Wessle
Christoph Haas [EMAIL PROTECTED] writes: On Tue, May 09, 2006 at 09:03:31PM +1000, Gary Wessle wrote: I am trying to install NumPy in my debian/testing linux 2.6.15-1-686. with no numpy for debian/testing, I am left alone, since the experimental version available by debian

Re: installing numpy

2006-05-09 Thread Gary Wessle
Raymond L. Buvel [EMAIL PROTECTED] writes: Gary Wessle wrote: Hi I am trying to install NumPy in my debian/testing linux 2.6.15-1-686. snip When installing from source on a Debian system, you want the installed package to wind up in /usr/local/lib/python2.x/site-packages (where

Re: python rounding problem.

2006-05-07 Thread Gary Wessle
Erik Max Francis [EMAIL PROTECTED] writes: chun ping wang wrote: Hey i have a stupid question. How do i get python to print the result in only three decimal place... Example round (2.9954254, 3) 2.9951 but i want to get rid of all trailing 0's..how would i do

Numerical Python Tutorial errors

2006-05-07 Thread Gary Wessle
Hi is the Numerical Python tutorial maintained? http://www.pfdubois.com/numpy/html2/numpy.html seams to have some errors and no email to mail them to when found. if interested, read about the errors below (1)

evaluation of

2006-05-07 Thread Gary Wessle
Hi what does the i a in this code mean. because the code below is giving False for all the iteration. isn't suppose to evaluate each value of i to the whole list? thanks a = range(8) i = 0 while i 11: print i a i = i + 1 False False False False False False False False False False

Re: Numerical Python Tutorial errors

2006-05-07 Thread Gary Wessle
Robert Kern [EMAIL PROTECTED] writes: Gary Wessle wrote: Hi is the Numerical Python tutorial maintained? http://www.pfdubois.com/numpy/html2/numpy.html seams to have some errors and no email to mail them to when found. No, it is not since Numeric itself is no longer maintained

reading a column from a file

2006-05-07 Thread Gary Wessle
Hi I have a file with data like location pressure temp str flootfloot I need to read pressure and temp in 2 different variables so that I can plot them as lines. is there a package which reads from file with a given formate and returns desired variables? or I need to open, while not

combined files together

2006-05-06 Thread Gary Wessle
Hi is there a module to do things like concatenate all files in a given directory into a big file, where all the files have the same data formate? name address phone_no. or do I have to open each, read from old/write-or-append to new ... thanks --

sort a list of files

2006-05-06 Thread Gary Wessle
Hi I am trying to print out the contents of a directory, sorted. the code 1 import os, sys 2 3 if len(sys.argv) 2: 4 sys.exit(please enter a suitable directory.) 5 6 print os.listdir(sys.argv[1]).sort()

os.isfile() error

2006-05-06 Thread Gary Wessle
Hi could someone help me to find out whats wrong with this code? code import os, sys if len(sys.argv) 2: sys.exit(please enter a suitable directory.) dpath = sys.argv[1] for name in os.listdir(dpath): if os.isfile(dpath+name): infile =

Re: combined files together

2006-05-06 Thread Gary Wessle
Gary Herron [EMAIL PROTECTED] writes: Gary Wessle wrote: Hi is there a module to do things like concatenate all files in a given directory into a big file, where all the files have the same data formate? name address phone_no. or do I have to open each, read from old/write-or-append

print formate

2006-05-05 Thread Gary Wessle
Hi import string import re accumulator = [] pattern = '(\S*)\s*(\S*)\s*(\S*)' for each text file in dir openfile and read into text data = re.compile(pattern, re.IGNORECASE).findall(text) accumulator = accumulator + data gives a list of tuples which when printed looks like ('jack',

Re: scope of variables

2006-05-04 Thread Gary Wessle
Ryan Forsythe [EMAIL PROTECTED] writes: Gary Wessle wrote: the example was an in-accuretlly representation of a the problem I am having. my apologies. a = [] def prnt(): print len(a) prnt function prnt at 0xb7dc21b4 I expect to get 0 the length of list a You want

Re: scope of variables

2006-05-04 Thread Gary Wessle
thank you -- http://mail.python.org/mailman/listinfo/python-list

scope of variables

2006-05-03 Thread Gary Wessle
Hi is the code below correct? b = 3 def adding(a) print a + b it seams not to see the up-level scope where b is defined. thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of variables

2006-05-03 Thread Gary Wessle
Steve R. Hastings [EMAIL PROTECTED] writes: On Thu, 04 May 2006 07:02:43 +1000, Gary Wessle wrote: b = 3 def adding(a) print a + b it seams not to see the up-level scope where b is defined. Assuming you put a ':' after the def adding(a), this should work in recent versions

string.find first before location

2006-05-02 Thread Gary Wessle
Hi I have a string like this text = abc abc and Here and there I want to grab the first abc before Here import string string.find(text, Here) # type int I am having a problem with the next step. thanks -- http://mail.python.org/mailman/listinfo/python-list

redemo.py with Tkinter

2006-05-02 Thread Gary Wessle
Hi I was reading the Regular Expression HowTo, it refers to redemo.py if you have Tkinter installed. a quick #locate redemo.py returned none on my debian/testing, however #locate Tkinter returned many. any body out there is using it, is it a separate download? thanks --

data regex match

2006-05-02 Thread Gary Wessle
Hi I am having an issue with this match tx = now 04/30/2006 then data = re.compile('(\d{2})/\1/\1\1', re.IGNORECASE) d = data.search(tx) print d Nono I was expecting 04/30/2006, what went wrong? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: string.find first before location

2006-05-02 Thread Gary Wessle
Serge Orlov [EMAIL PROTECTED] writes: Peter Otten wrote: Gary Wessle wrote: These days str methods are preferred over the string module's functions. text = abc abc and Here and there here_pos = text.find(Here) text.rfind(abc, 0, here_pos) 4 Peter and what

assignment in if

2006-05-02 Thread Gary Wessle
Hi is there a way to make an assignment in the condition of if and use it later, e.g. nx = re.compile('regex') if nx.search(text): funCall(text, nx.search(text)) nx.search(text) is evaluated twice, I was hoping for something like nx = re.compile('regex') if x = nx.search(text):

file open no such file

2006-04-30 Thread Gary Wessle
I am getting this error when I try to run the code below f = open(~/m, r) print f.read() :~$ python python/my.py Traceback (most recent call last): File python/my.py, line 1, in ? f = open(~/m, r) IOError: [Errno 2] No such file or

TypeError: 'module' object is not callable

2006-04-28 Thread Gary Wessle
dear python users I am not sure why I am getting Traceback (most recent call last): File my.py, line 3, in ? urlparse('http://www.cwi.nl:80/%7Eguido/Python.html') TypeError: 'module' object is not callable

convert a int to a list

2006-04-28 Thread Gary Wessle
Hi can type conversion work to convert an int to a list? I am trying to solve an problem in one tutorial. a = ['spam!', 1, ['Brie', 'Roquefort', 'Pol le Veq'], [1, 2, 3]] As an exercise, write a loop that traverses the

raw_input passing to fun

2006-04-27 Thread Gary Wessle
the output of this code below is not what one would expect, it outputs all kind of numbers and it never stops, I want to ask the user for a number and then print out the multiplication table up to that number. thanks import math

Re: raw_input passing to fun

2006-04-27 Thread Gary Wessle
John Machin [EMAIL PROTECTED] writes: On 28/04/2006 2:04 PM, Gary Wessle wrote: the output of this code below is not what one would expect, it outputs all kind of numbers and it never stops, I want to ask the user for a number and then print out the multiplication table up to that number

print out each letter of a word

2006-04-27 Thread Gary Wessle
I am going through this tut from http://ibiblio.org/obp/thinkCS/python/english/chap07.htm I am getting errors running those 2 groups as below as is from the tut thanks index = 0 while index len(fruit): letter = fruit[index] print letter index = index + 1 or for char in fruit:

help finding

2006-04-25 Thread Gary Wessle
Hi I am going through some tutorials, how do I find out about running a script from the python prompt? is there a online ref and how to access it? thank you -- http://mail.python.org/mailman/listinfo/python-list

debugging in emacs

2006-04-23 Thread Gary Wessle
Hi python users I am using emacs and python-mode.el under dabian testing. is there a way to debug python code where I can step over each line and watch the value of all the variables and be able to change any during debugging. say you have a loop structure and want to see what the values of your

Re: debugging in emacs

2006-04-23 Thread Gary Wessle
Gary Wessle [EMAIL PROTECTED] writes: Hi python users I am using emacs and python-mode.el under dabian testing. is there a way to debug python code where I can step over each line and watch the value of all the variables and be able to change any during debugging. say you have a loop

charting

2006-04-20 Thread Gary Wessle
Dear python users I am just wondering if python is the language to use to build a custom charting package which is live updated from live data stream coming through a socket. as well as dynamically execute data analysis code on the data being fed. I have been looking at SpecTix. thank you --