当前位置:首页 » 编程语言 » python327

python327

发布时间: 2022-12-13 09:08:54

python中我用pyinstaller打包的exe文件打不开,报错如下 是什么问题啊 F

  • 被打包的文件:helloworld.py, 人人皆知.

  • 打包的命令:pyinstaller -D helloworld.py

  • 打包的console提示: 见随后的引述块

  • 打包发布exe时的纪律(注意事项):

  • 很简单的py脚本. Simple is better than complex. 应该遵守Python的规则.

  • 所以在打包为exe时, 应该尽量减少没有必要的python包的导入. 否则吃的太胖

  • 可以运行的exe文件位于:dist目录下, 而不是build目录下的.

  • 运行后的结果:

  • D:DBfz>pyinstaller -D helloworld.py155 INFO: PyInstaller: 3.2.1155 INFO: Python: 2.7.11155 INFO: Platform: Windows-XP-5.1.2600-SP3155 INFO: wrote D:DBfzhelloworld.spec155 INFO: UPX is not available.155 INFO: Extending PYTHONPATH with paths

  • ['D:\DB', 'D:\DB\fz']155 INFO: checking Analysis155 INFO: Building Analysis because out00-Analysis.toc is non existent155 INFO: Initializing mole dependency graph...155 INFO: Initializing mole graph hooks...312 INFO: running Analysis out00-Analysis.toc327 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable required by d:anaconda2python.exe327 INFO: Found C:WINDOWSWinSxSPoliciesx86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f759.0.30729.1.policy327 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww ...327 INFO: Found manifest C:WINDOWSWinSxSManifestsx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e.manifest327 INFO: Searching for file msvcr90.dll327 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcr90.dll327 INFO: Searching for file msvcp90.dll327 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcp90.dll327 INFO: Searching for file msvcm90.dll343 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcm90.dll343 INFO: Found C:WINDOWSWinSxSPoliciesx86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f759.0.30729.1.policy343 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,30729, 1)484 INFO: Caching mole hooks...500 INFO: Analyzing D:DBfzhelloworld.py500 INFO: Loading mole hooks...500 INFO: Loading mole hook "hook-encodings.py"...5405 INFO: Loading mole hook "hook-httplib.py"...5421 INFO: Looking for ctypes DLLs5437 INFO: Analyzing run-time hooks ...5452 INFO: Looking for dynamic libraries6155 INFO: Looking for eggs6155 INFO: Using Python library d:anaconda2python27.dll6171 INFO: Found binding redirects:[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 1), publicKeyToken=u'1fc8b3b9a1e18e3b')]6187 INFO: Warnings written to D:DBfzuildhelloworldwarnhelloworld.txt6280 INFO: checking PYZ6296 INFO: Building PYZ because out00-PYZ.toc is non existent6296 INFO: Building PYZ (ZlibArchive) D:DBfzuildhelloworldout00-PYZ.pyz6968 INFO: Building PYZ (ZlibArchive) D:DBfzuildhelloworldout00-PYZ.pyz completed successfully.7062 INFO: checking PKG7062 INFO: Building PKG because out00-PKG.toc is non existent7077 INFO: Building PKG (CArchive) out00-PKG.pkg7125 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.7140 INFO: Bootloader d:anaconda2libsite-packagesPyInstallerootloaderWindows-32bit un.exe7140 INFO: checking EXE7155 INFO: Building EXE because out00-EXE.toc is non existent7155 INFO: Building EXE from out00-EXE.toc7171 INFO: Appending archive to EXE D:DBfzuildhelloworldhelloworld.exe7171 INFO: Building EXE from out00-EXE.toc completed successfully.7187 INFO: checking COLLECT7202 INFO: Building COLLECT because out00-COLLECT.toc is non existent7202 INFO: Building COLLECT out00-COLLECT.toc7218 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7375 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7390 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitpython27.dll7405 INFO: Updating resource type 24 name 2 language 10337468 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7484 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitunicodedata.pyd7500 INFO: Updating resource type 24 name 2 language 10337546 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7562 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_hashlib.pyd7562 INFO: Updating resource type 24 name 2 language 10337609 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7625 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_ctypes.pyd7640 INFO: Updating resource type 24 name 2 language 10337687 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7702 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_ssl.pyd7718 INFO: Updating resource type 24 name 2 language 10337812 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7827 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_socket.pyd7843 INFO: Updating resource type 24 name 2 language 10337875 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7890 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitselect.pyd7905 INFO: Updating resource type 24 name 2 language 10337952 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7968 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitz2.pyd7968 INFO: Updating resource type 24 name 2 language 10338046 INFO: Building COLLECT out00-COLLECT.toc completed successfully.D:DBfz>

Ⅱ python中**是啥什么意思

1、两个值相加,然后返回值给符号左侧的变量

举例如下:

>>> a=1

>>> b=3

>>> a+=b(或者a+=3)

>>> a

4

2、用于字符串连接(变量值带引号,数据类型为字符串)

>>> a='1'

>>> b='2'

>>> a+=b

>>> a

'12'

8、运算符优先级

以下所列优先级顺序按照从低到高优先级的顺序;同行为相同优先级。

Lambda #运算优先级最低

逻辑运算符: or

逻辑运算符: and

逻辑运算符:not

成员测试: in, not in

同一性测试: is, is not

比较: <,<=,>,>=,!=,==

按位或: |

按位异或: ^

按位与: &

移位: << ,>>

加法与减法: + ,-

乘法、除法与取余: *, / ,%

正负号: +x,-x

具有相同优先级的运算符将从左至右的方式依次进行,用小括号()可以改变运算顺序。

参考资料来源:网络-Python

Ⅲ 美国ba专业排名大学有哪些

1、MIT——BA
MIT的BA项目2016年秋季开设,2018届的class size 30人,录取者的平均GPA达到了3.9+,GRE
quant部分168+,平均工作经验0-2年。超过80%以上的学生具有科学、数学、工程、计算机的专业背景。如果是文商社科专业的申请同学,建议一定补充CS语言和编程类的课程,其次,GT成绩争取刷到110+和750+或330+,才会有竞争力。M根据官网上提供的信息,录取者的本科大多出自名校,如Berkeley、brown、combridge、ke、Harvard、Stanford等,如果本科学校非985、211的同学,我们不建议申请。
2、UT Austin——BA
UT的BA项目隶属于McCombs商学院,为期仅10个月,夏季入学,次年夏季毕业。UT综排在美国虽然不算特别高,但是McCombs商学院在德州可以说是女神般的存在,毕业生水平在整个美国也是有口皆碑的。项目的课程设置会有三分之一的business课程,包括finance、marketing、supply
chain等方面的知识;三分之一的CS方面的课程,目前主要是Java和数据库;另外三分之一是stats的课程。这样的设置基本涵盖了做BA所需要的skillsets,到毕业的时候Java、Python、Hadoop、SAS、R、Matlab、sql等这些基本的技能应该都能掌握了。
这个学校的项目喜欢录取有理工科背景的申请者,项目size50-60人左右,中国学生10人左右,毕竟UT是个以白哥白姐为主的学校,因此不会像UCLA、USC等出现大规模的中国人。2017届的录取平均GPA3.61,GMAT719,数学和统计的相关课程分数高的申请者录取几率较大。项目就业率100%,一是项目本身有capstone,可以和大企业合作(walmart、visa、home
depot、Dell、IBM、intel等)以及当地的传统和咨询公司(四大);二是UT的商学院校友资源丰富,找工作的时候往届校友非常乐意帮助新毕业的学弟学妹们。
3、USC--BA
USC的BA隶属于Marshall school of
business,于2014年开设,在加州的BA中可以说是元老级别,因此无论是课程设置还是校友资源、业界联系可以说是目前比较成熟的体系。USC的BA项目是一个为期18个月的课程,但是大部分中国学生选择延长到两年,以更好地适应项目。33credit的毕业学分要求里面,19.5是必修,13.5是选修,如果本科修过某个特定课程的情况下,必修课程也可以waive掉换成相应的选修课程。项目的课程分为三类:general
BA,常规的BA课程设置;statistical learning
method,适合想往finance和consulting方向发展的同学;statistics modeling,适合想往更tech方向发展的同学。
USC位于LA
downtown,占据地利但也绝不限于LA地区,往届毕业的学长学姐也有很多relocate去别的地区。USC的中国同学是不少的,课程上、毕业后都可有大量的校友资源可以使用。这个学校喜欢录取GT分数高的,2016年的录取学生平均GPA达到3.63,GMAT722+,GRE320+。如果申请人又在四大或是其他big
name的公司实习或者工作过,也是个大优势。USC并不卡申请者的本科学校,有很多国内211、985,一些普通美本的同学就读,因此感兴趣的同学们GPA、GT分数够高的话,都是很有希望的。
4、Fordham--BA
福特汉姆大学位于纽约曼哈顿中心,地利位置极好,纽约市有很多世界知名公司和企业,对于毕业后想在当地找实习和工作的同学来说是个巨大的优势。2017级项目有70个人,中国学生比重高达80%,多数人本科是学会计和金融的。TG成绩需要100+和320+,项目对申请者的技术背景要求不高,成绩达到了基本录取线希望是很大的,申请时上过statistics、forecasting、modeling等课程可以加分。需要注意的是这个项目的成绩提交需要WES认证,同学们需要花一些时间做认证的准备。其次,Fordham的BA项目会有面试,网上也有很多Fordham
BA面筋总结,这里我们就不展开讲了。Fordham大学的教授和学生都很务实,比如大家会相互分享交流面试经验等,教授也会耐心地解答学生的求职问题,指导找工作等。
5、UMN--BA
UMN的BA硕士开设在其Carlson管理学院下,学制一年,共45学分,一学期要上5门课,curriculum相当intensive。暑假课程集中补习一些programming和data
analysis的知识,包括Python,R的基础,以确保学生在之后的分析课程中熟练使用。BA项目属于department of information and
decision science,UMN本身就是MIS和stat强校,再加上carlson管理学院名声在外也不错,因此UMN的BA
program的professors有很多大牛,career方面先天优势十分明显。根据去年的统计数据,项目有25人,其中大陆本3人,预计2018年会扩招。虽然UMN综排位于top50之外,可每年依然吸引着众多的申请者,建议GPA3.5+
T100+ G320+的同学可以申请。
6、GWU--BA
GWU综排56,商排30+,它的BA是由商学院department of decision
science主导的一个项目,full-time的项目时长10个月,part-time时长可达两年,项目总共40人左右,中国人大概4-5人。项目的curriculum比较偏应用,但是相关软件比如R,python,C++等等,同学们还是需要自行掌握。由于优越的地理位置,DC地区有很多私企和世界性组织的实习机会,暑假找到实习的同学还是比较多的,大部分毕业生最后都能在实习的公司留下来。

Ⅳ python2.7中如果脚本文件放在中文目录下,pymysql连接数据库会报错,怎么解决(不要修改中文目录名为英文)

解决方法为:

创建数据表时指定charset=utf8,如:

usehongxiudb;
createtableifnotexistshongxiu(
nametext,
authortext,
introtext
)engine=InnoDBdefaultcharset=utf8;

Ⅳ Python AttributeError: '_XMLTestResult' object has no attribute 'skipped'

这个代码好熟悉。差点儿就以为是我10年前写的一个自动测试框架了。

应该是你运行的结果有问题。也就是结果这个类XMLTestResult。它少了一个skipped的属性。

原因应该可能是是代码版本问题。或者是itersuite里的XMLTestResult的实例的__init__函数里的少了设计skipped这个数组。

你只要打开XMLTestResult这个类检查一下就可以。如果它是用C++实现的。那么你自己在构造测试用python类时,自己加一个skipped空数组就可以。

Ⅵ Python里面的BlockWindow是个什么东西啊我学wxpython的时候提示no mole named blockwindow

BlockWindow 出现在wx教程wxpython in action书中,关于Sizer部分大量使用到BlockWindow模块。
这不是一个标准模块,而是书中之前介绍的一个自定义类,见书中327页。
源代码如下:

import wx
class BlockWindow(wx.Panel):
def __init__(self, parent, ID=-1, label=””, pos=wx.DefaultPosition, size=(100, 25)):
wx.Panel.__init__(self, parent, ID, pos, size, wx.RAISED_BORDER, label)
self.label = label
self.SetBackgroundColour(“white”)
self.SetMinSize(size)
self.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, evt):
sz = self.GetClientSize()
dc = wx.PaintDC(self)
w,h = dc.GetTextExtent(self.label)
dc.SetFont(self.GetFont())
dc.DrawText(self.label, (sz.width-w)/2, (sz.height-h)/2)

Ⅶ python pyinstaller问题

打包python脚本为exe的坎坷经历, by pyinstaller方法

又应验了那句歌词. 不经历风雨, 怎么见得了彩虹.

安装过程略去不提, 仅提示: pip install pyinstaller

打包指令

粗看包里的文档, 然后开始打包:

  • 打开console

  • 就用了这个命令: pyinstaller monitor_rt_quotes.py

  • 结果就是比预期麻烦的多的多的: 干活, 硬盘不停地balabala叫, 漫长
    这里记录一下控制台显示的提示信息:

  • 官方文档对上述指令的解释为:
    |PyInstaller| analyzesmyscript.pyand:

  • Writesmyscript.specin the same folder as the script.

  • Creates a folderbuildin the same folder as the script if it does not exist.

  • Writes some log files and working files in thebuildfolder.

  • Creates a folderdistin the same folder as the script if it does not exist.

  • Writes themyscriptexecutable folder in thedistfolder.

  • In thedistfolder you find the bundled app you distribute to your users.

    巨长的提示后, 得到了exe文件, 有18Mb的大小(太庞大了, 肥肥肥!!!), 但是结果很悲剧:

    D:DBfzuildmonitor_rt_quotes>monitor_rt_quotes.exe sz000911

    Error loading Python DLL: D:DBfzuildmonitor_rt_quotespython27.dll (error code 126)

    估计是没有添加必要的打包选项造成的. 继续努力.

    不死心! 解决问题需要由简到繁, 先从hellowworld.py做起. 搞定了.

  • 被打包的文件:helloworld.py, 人人皆知.

  • 打包的命令:pyinstaller -D helloworld.py

  • 打包的console提示: 见随后的引述块

  • 打包发布exe时的纪律(注意事项):

  • 很简单的py脚本. Simple is better than complex. 应该遵守Python的规则.

  • 所以在打包为exe时, 应该尽量减少没有必要的python包的导入. 否则吃的太胖

  • 可以运行的exe文件位于:dist目录下, 而不是build目录下的.

  • 运行后的结果:

  • D:DBfz>pyinstaller -D helloworld.py155 INFO: PyInstaller: 3.2.1155 INFO: Python: 2.7.11155 INFO: Platform: Windows-XP-5.1.2600-SP3155 INFO: wrote D:DBfzhelloworld.spec155 INFO: UPX is not available.155 INFO: Extending PYTHONPATH with paths

  • ['D:\DB', 'D:\DB\fz']155 INFO: checking Analysis155 INFO: Building Analysis because out00-Analysis.toc is non existent155 INFO: Initializing mole dependency graph...155 INFO: Initializing mole graph hooks...312 INFO: running Analysis out00-Analysis.toc327 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable required by d:anaconda2python.exe327 INFO: Found C:WINDOWSWinSxSPoliciesx86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f759.0.30729.1.policy327 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww ...327 INFO: Found manifest C:WINDOWSWinSxSManifestsx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963e.manifest327 INFO: Searching for file msvcr90.dll327 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcr90.dll327 INFO: Searching for file msvcp90.dll327 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcp90.dll327 INFO: Searching for file msvcm90.dll343 INFO: Found file C:WINDOWSWinSxSx86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.1_x-ww_6f74963emsvcm90.dll343 INFO: Found C:WINDOWSWinSxSPoliciesx86_policy.9.0.Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_x-ww_b7353f759.0.30729.1.policy343 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,30729, 1)484 INFO: Caching mole hooks...500 INFO: Analyzing D:DBfzhelloworld.py500 INFO: Loading mole hooks...500 INFO: Loading mole hook "hook-encodings.py"...5405 INFO: Loading mole hook "hook-httplib.py"...5421 INFO: Looking for ctypes DLLs5437 INFO: Analyzing run-time hooks ...5452 INFO: Looking for dynamic libraries6155 INFO: Looking for eggs6155 INFO: Using Python library d:anaconda2python27.dll6171 INFO: Found binding redirects:[BindingRedirect(name=u'Microsoft.VC90.CRT', language=None, arch=u'x86', oldVersion=(9, 0, 21022, 8), newVersion=(9, 0, 30729, 1), publicKeyToken=u'1fc8b3b9a1e18e3b')]6187 INFO: Warnings written to D:DBfzuildhelloworldwarnhelloworld.txt6280 INFO: checking PYZ6296 INFO: Building PYZ because out00-PYZ.toc is non existent6296 INFO: Building PYZ (ZlibArchive) D:DBfzuildhelloworldout00-PYZ.pyz6968 INFO: Building PYZ (ZlibArchive) D:DBfzuildhelloworldout00-PYZ.pyz completed successfully.7062 INFO: checking PKG7062 INFO: Building PKG because out00-PKG.toc is non existent7077 INFO: Building PKG (CArchive) out00-PKG.pkg7125 INFO: Building PKG (CArchive) out00-PKG.pkg completed successfully.7140 INFO: Bootloader d:anaconda2libsite-packagesPyInstallerootloaderWindows-32bit un.exe7140 INFO: checking EXE7155 INFO: Building EXE because out00-EXE.toc is non existent7155 INFO: Building EXE from out00-EXE.toc7171 INFO: Appending archive to EXE D:DBfzuildhelloworldhelloworld.exe7171 INFO: Building EXE from out00-EXE.toc completed successfully.7187 INFO: checking COLLECT7202 INFO: Building COLLECT because out00-COLLECT.toc is non existent7202 INFO: Building COLLECT out00-COLLECT.toc7218 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7375 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7390 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitpython27.dll7405 INFO: Updating resource type 24 name 2 language 10337468 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7484 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bitunicodedata.pyd7500 INFO: Updating resource type 24 name 2 language 10337546 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7562 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_hashlib.pyd7562 INFO: Updating resource type 24 name 2 language 10337609 INFO: Redirecting Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0, 30729, 1)7625 INFO: Updating manifest in C:Documents and Datapyinstallerincache00_py27_32bit\_ctypes.pyd7640 INFO: Updating resource type 24 name 2 language 10337687 INFO: Redirecting Microsoft.VC90

Ⅷ max retries exceeded with url 怎么解决

Traceback (most recent call last):
File "thread072413.py", line 163, in <mole>
File "thread072413.py", line 122, in main
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 55, in get
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 335, in request
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 438, in send
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 327, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='apk.gfan.com', port=80): Max retries exceeded with url: /apps_7_1_78.html (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
ImportError: No mole named fileutils

Original exception was:
Traceback (most recent call last):
File "thread072413.py", line 163, in <mole>
File "thread072413.py", line 122, in main
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 55, in get
File "/usr/local/lib/python2.7/dist-packages/requests/api.py", line 44, in request
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 335, in request
File "/usr/local/lib/python2.7/dist-packages/requests/sessions.py", line 438, in send
File "/usr/local/lib/python2.7/dist-packages/requests/adapters.py", line 327, in send
requests.exceptions.ConnectionError: HTTPConnectionPool(host='apk.gfan.com', port=80): Max retries exceeded with url: /apps_7_1_78.html (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)

Ⅸ Python里import image报错找不到指定的程序

C:Python34Scripts>pipinstallpillow
Collectingpillow
DownloadingPillow-4.1.0-cp34-cp34m-win32.whl(1.2MB)
100%|████████████████████████████████|1.2MB327kB/s
Collectingolefile(frompillow)
Downloadingolefile-0.44.zip(74kB)
100%|████████████████████████████████|81kB748kB/s
Installingcollectedpackages:olefile,pillow
Runningsetup.pyinstallforolefile...done
Successfullyinstalledolefile-0.44pillow-4.1.0

这边是3.4,这么装完没问题

Ⅹ 用PYTHON2做个计算器,只要加减乘除

# encoding: UTF-8
from Tkinter import *
class App:
def __init__(self,master):
frame=Frame(master)
frame.pack()

self.v = StringVar()
self.v.set(" ")
self.entry1=Entry(frame,text="")
self.entry1.grid(row=0,columnspan=2)
self.label0=Label(frame,text="Answer:").grid(row=1,column=0)
self.label1=Label(frame,textvariable=self.v).grid(row=1,column=1)

self.button1=Button(frame,text=" = ",command=self.inputnumber).grid(row=2)

#self.hi_there.pack(side=LEFT)
def inputnumber(self):
self.v.set(eval(self.entry1.get()))

root=Tk()
app=App(root)
root.mainloop()

以上代码拷贝下来保存为一个py文件,然后运行就好。
注意没有任何错误检查的。

热点内容
xlc编译选项 发布:2025-01-23 02:11:25 浏览:720
电脑访问存储服务器硬盘 发布:2025-01-23 02:08:29 浏览:568
lol破解脚本 发布:2025-01-23 02:07:54 浏览:129
算法是步骤 发布:2025-01-23 01:47:22 浏览:237
ip访问控制实验 发布:2025-01-23 01:41:51 浏览:105
crv20万能落地什么配置 发布:2025-01-23 01:35:33 浏览:172
s10手机怎么查配置 发布:2025-01-23 01:34:48 浏览:890
九阴真经3d免费脚本 发布:2025-01-23 01:33:47 浏览:686
gcc编译分为哪几个阶段 发布:2025-01-23 01:33:45 浏览:806
战地5怎么看哪个服务器 发布:2025-01-23 01:33:07 浏览:367