
python
surayang
The man who has made up his mind to win will never say "Impossible".
展开
-
Python获取电脑用户信息
pwd 模块仅适用于 Linux 环境。但是 os 适用于 Windows 和 Linux。原创 2023-06-01 15:53:41 · 2347 阅读 · 0 评论 -
Ubuntu20安装wxPython
Ubuntu20 安装wxPython报错问题原创 2022-10-06 14:02:20 · 1572 阅读 · 1 评论 -
pip查看当前系统安装了哪些模块
使用pip列出当前所安装的package。原创 2021-11-24 16:50:49 · 1549 阅读 · 0 评论 -
python pip的使用
pip安装、卸载、查询python库pip install package_name # pip安装python库pip uninstall package_name # 卸载指定的Python库pip list # pip列出系统当前安装的Python库pip list --outdated # pip列出所有过期的Python库pip freeze # pip列出系统当前安装的Python库名和版本原创 2021-07-28 11:21:53 · 579 阅读 · 0 评论 -
wxPython Gtk-WARNING **: Negative content height -5 (allocation 5, extents 5x5) ...
wxPython画界面时,提示如下错误:wxPython Gtk-WARNING **: Negative content height -5 (allocation 5, extents 5x5) while allocating gadget (node button, owner GtkButton)这表示Button控件没有高度,可把窗口界面的大小放大一点就可以了。...原创 2021-07-21 11:27:11 · 1287 阅读 · 0 评论 -
pyinstaller参数介绍以及总结详解
pyinstaller参数介绍以及总结详解来源:https://www.jb51.net/article/165251.htm一、pyinstaller相关参数-F, –onefile 打包一个单个文件,如果你的代码都写在一个.py文件的话,可以用这个,如果是多个.py文件就别用 -D, –onedir 打包多个文件,在dist中生成很多依赖文件,适合以框架形式编...原创 2019-08-27 14:25:58 · 2460 阅读 · 2 评论 -
UnicodeDecodeError: 'gb2312' codec can't decode byte 0xb2 in position 935: illegal multibyte sequenc
fp = open(filename_src, 'r', encoding='gb2312')汉字字符集范围 gb2312 < gbk < gb18030fp = open(filename_src, 'r', encoding='gbk')原创 2019-08-16 19:14:53 · 3750 阅读 · 0 评论 -
Python selenium ElementNotVisibleException: Message: element not visible
对于这种情况,可以用driver_path = r".\tool\chromedriver.exe"driver = webdriver.Chrome(executable_path=driver_path)driver.get(url)script = 'document.getElementById("ID").value' # 这是JavaScript语句,访问知道ID的值。...原创 2019-08-15 16:18:40 · 417 阅读 · 0 评论 -
Vim for Python setup
CentOS 7sudo yum install git cscope ctags-etags vim-X11Ubuntu 16sudo apt-get install exuberant-ctags cscope vim-gtk gitInstall vim plugin managergit clone https://github.com/VundleVim/Vun...原创 2019-03-27 17:21:48 · 183 阅读 · 0 评论 -
Python_网络爬虫(新浪新闻抓取)
https://www.cnblogs.com/zengbojia/p/7220190.html转载 2019-03-22 16:05:02 · 801 阅读 · 0 评论 -
python 解析 XML文件
https://www.cnblogs.com/benxintuzi/p/5136476.html转载 2018-04-06 17:38:08 · 395 阅读 · 0 评论 -
Python开发WebService
WebService是一种跨编程语言和跨操作系统平台的远程调用技术。理解WebService1.从表面上看,WebService就是一个应用程序向外界暴露出一个能通过Web进行调用的API,也就是说能用编程的方法通过Web来调用这个应用程序。我们把调用这个WebService的应用程序叫做客户端,而把提供这个WebService的应用程序叫做服务端。2.从深层次看,WebServi...原创 2018-08-15 17:08:49 · 4070 阅读 · 0 评论 -
Python suds
用suds.client创建Client对象。并在控制节点抓包,会有缓存记录,保存路径可以通过suds.cache中的ObjectCache查看。默认保存一天。缓存路径:from suds.cache import ObjectCacheoc = ObjectCache()print(oc.location) # print cache path参考:https:/...原创 2018-08-31 17:22:46 · 1676 阅读 · 0 评论 -
Linux Python GUI module
Python install Tkinteryum install python-tools原创 2018-09-24 23:32:37 · 655 阅读 · 0 评论 -
CentOS 7 install Python 3 and wxPython
目录Install Python 3Install epel and IUS rpm package sources. Install python36Install wxPython for Python 3Prepare a CentOS 7, update OS when installed it, then install the “Development tools”...原创 2018-10-18 23:27:49 · 1305 阅读 · 0 评论 -
解决pip install慢的方法
更改pip源即可,修改为pip国内源:新版ubuntu要求使用https源,要注意。清华:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi...原创 2018-10-19 08:26:07 · 12075 阅读 · 6 评论 -
安装或升级Python依赖包报错
有以下两种方法可供参考:Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.强制升级: # ...转载 2018-10-19 09:32:47 · 670 阅读 · 0 评论 -
清除python文件运行后产生的pyc文件
在windows下可用如下代码清除:@echo offfor /r . %%a in (*.pyc) do ( del /a /f "%%a" echo %%a)for /r . %%a in (__pycache__) do ( rd /s /q "%%a" echo %%a)原创 2019-03-02 17:19:17 · 2474 阅读 · 0 评论 -
远端连接PostgreSQL数据库
在服务器上装了一PostgreSQL的数据库,在本地使用其他用户(非postgres)连接数据库时,总是报错,一直连不上,修改PostgreSQL安装目录下的data文件夹中的pg_hba.conf和postgresql.conf文件。postgresql.conf文件:查找listen_addresses字符串,然后修改成listen_addresses='*'。pg_hba.conf...原创 2019-03-21 16:15:20 · 404 阅读 · 0 评论 -
在Linux CentOS 6.8上安装Python 2.7.12
CentOS 6.8自带的是Python 2.6.6,yum中最新的也是Python 2.6.6,只能下载Python 2.7.12的源代码自己编译安装。原创 2016-10-15 13:17:50 · 2338 阅读 · 0 评论