Tkinter

2007-09-03 Thread vijayca
i tried to use python gui module Tkinter in solaris,aix,hpux.
while importing the module it  shows an error...

import Tkinter
error says that your python may not be configured for Tk()...
how to get out of this...

-- 
http://mail.python.org/mailman/listinfo/python-list


Tkinter(2)

2007-09-04 Thread vijayca
my python installation is:Active python 2.5.1
i am using Red Hat Linux
i have the Tkinter module installed but any simple script produces an
error

script:
from Tkinter import Label
widget = Label(None, text='Hello GUI world!')
widget.pack()
widget.mainloop()


error:
Traceback (most recent call last):
  File "guy.py", line 2, in 
widget = Label(None, text='Hello GUI world!')
  File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 2464, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
  File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1923, in __init__
BaseWidget._setup(self, master, cnf)
  File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1898, in _setup
_default_root = Tk()
  File "/root/Desktop/pythonall/ActivePython-2.5.1.1-linux-x86/
INSTALLDIR/lib/python2.5/lib-tk/Tkinter.py", line 1636, in __init__
self.tk = _tkinter.create(screenName, baseName, className,
interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment
variable


please help me
i hate those error messages...
vijay

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Looping through File Question

2007-09-05 Thread vijayca
On Sep 5, 3:58 pm, planetmatt <[EMAIL PROTECTED]> wrote:
> I am a Python beginner.  I am trying to loop through a CSV file which
> I can do.  What I want to change though is for the loop to start at
> row 2 in the file thus excluding column headers.
>
> At present I am using this statement to initiate a loop though the
> records:
>
> for line in f.readlines():
>
> How do I start this at row 2?

just use readline() method...this will move the file pointer to the
next line
example:
fd=open("/tmp.txt","r")
fd.readline()##THIS MOVES THE FILE POINTER TO THE
SECOND LINE

now carry on with...
for line in f.readlines():   #THIS WILL BEGIN WITH THE SECOND ROW AS
THE FILE POINTER IS IN 2NDLINE
  

-- 
http://mail.python.org/mailman/listinfo/python-list


threads

2007-09-05 Thread vijayca
i have written a script that spawns some threads
all run in parallel
now i need to stop all the threads once i press a key(example: "\n")
how to do it...

-- 
http://mail.python.org/mailman/listinfo/python-list