我在Ubuntu Maverick Meerkat(10.10)上从Python 2.6升级到Python 2.7,我无法导入PyQt4.
austin@gerald:~$ python2.7
Python 2.7.0+ (r27:82500, Sep 15 2010, 18:04:55)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
Run Code Online (Sandbox Code Playgroud)
我从Ubuntu存储库安装了Python 2.7(python2.7)和PyQt4(python-qt4).我一段时间安装了PyQt,但最近我安装了Python 2.7.
如果我尝试使用Python 2.6(因为它随Ubuntu一起提供,命令只是python),它可以完美运行.看:
austin@gerald:~$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Run Code Online (Sandbox Code Playgroud)
我知道问题是什么:Python 2.6可以访问PyQt4模块,但不能访问2.7.我的问题是,如何让Python …
是否有OR sqlite语句?我一直试图谷歌它,但谷歌似乎过滤了OR.
例如,如果我想在此表中找到某人(人)
people:
+--fname--+--lname--+--has_squirrel--+
|Eric |Schmidt |0 |
+---------+---------+----------------+
|Elvis |Presley |1 |
+---------+---------+----------------+
|Richard |Stallman |0 |
+---------+---------+----------------+
Run Code Online (Sandbox Code Playgroud)
用Elvis或Richard的名字命名,我的疑问是什么?
我已经尝试了类似的东西select * from people where fname=('Elvis' or 'Richard'),但这总是让Eric Schmidt回归(与我想要的完全相反的行)!
我也试过select * from people where fname='Elvis' or 'Richard'但是返回表中的所有行!
我在Ubuntu 10.10上使用Python 2.6 sqlite3模块.有人能给我一个关于sqlite OR语句的快速解释,还是告诉我它是否不存在?我试过RTFM而且找不到任何东西(在sqlite网站上搜索OR会发出一堆错误!).
谢谢!