Python is installed
Apparently it's pyGTK2 ( it's 2.6.5 according to Synaptic Package Manager.
this is what shows on the bash terminal (trying to keep the
main directory uncluttered hence the webdev-pp directoy; it's my
main workspace)
Code:
gregory@gregory-laptop:~/webdev-pp$ cd python-pp5
gregory@gregory-laptop:~/webdev-pp/python-pp5$ ls
base.py pygtkconsole.py
gregory@gregory-laptop:~/webdev-pp/python-pp5$ python base.py
File "base.py", line 5
5 import pygtk
^
SyntaxError: invalid syntax
gregory@gregory-laptop:~/webdev-pp/python-pp5$
the base.py script is from a tutorial I am following
this is the script
Code:
1 #!/usr/bin/env python
2
3 # example base.py
4
5 import pygtk
6 pygtk.require('2.0')
7 import gtk
8
9 class Base:
10 def __init__(self):
11 self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
12 self.window.show()
13
14 def main(self):
15 gtk.main()
16
17 print __name__
18 if __name__ == "__main__":
19 base = Base()
20 base.main()
It seems obvious that python is not in the directory path or something like that. I have done the same sort of thing with ruby
and it works fine but think it must be something to do with the installation and if it is a systems wide installation or not
but am not sure what to try next.
Thank you in advance for any input you care to give. I am very new
to Linux and computer languages since late last year though some experience with PHP and MySQL from earlier last year and some Javascript during Multimedia studies while getting my Graphic design diploma. Its very new to me and just back from a long break on Holiday but what I have learned is coming back to me. I would appreciate your help very much.