抄了wxpython in action的代码.研究下怎么用.
在ubuntu 10.04上.
root@ubuntu:/home/zhangbin/code/wxpy# vi bare.py
root@ubuntu:/home/zhangbin/code/wxpy# ls
bare.py
root@ubuntu:/home/zhangbin/code/wxpy# ./bare.py
bash: ./bare.py: Permission denied
root@ubuntu:/home/zhangbin/code/wxpy# chmod +x bare.py
root@ubuntu:/home/zhangbin/code/wxpy# ls
bare.py
root@ubuntu:/home/zhangbin/code/wxpy# ./bare.py
bash: ./bare.py: /bin/env python : bad interpreter: No such file or directory
root@ubuntu:/home/zhangbin/code/wxpy# python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
KeyboardInterrupt
>>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
>>>
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
>>> dir
<built-in function dir>
>>> cd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'cd' is not defined
>>> cd /
File "<stdin>", line 1
cd /
^
SyntaxError: invalid syntax
>>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
>>> pwd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'pwd' is not defined
>>> python bare.py
File "<stdin>", line 1
python bare.py
^
SyntaxError: invalid syntax
>>>
KeyboardInterrupt
>>>
KeyboardInterrupt
>>>
KeyboardInterrupt
>>> help
Type help() for interactive help, or help(object) for help about object.
>>> help(exit)
>>>
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>>
缩进错误,哪怕缩进一个空格也ok了。。。。囧~~~
root@ubuntu:/home/zhangbin/code/wxpy# ./bare.py File "./bare.py", line 5 frame=wx.Frame(parent=None,title='bare') ^ IndentationError: unindent does not match any outer indentation level
参考
|
否则会出错
也就是说那个语句快中,第一行语句的缩进是多少个字符,其他后面的就应该是多少个字符
/usr/bin 下的python是个链接吧。可以链接到python2。6上去。