草庐IT

PRINT_NAME

全部标签

python - 名称错误 : global name 'execfile' is not defined trying to run an app on Google App Engine Launcher

我在Windows中收到此错误,我有3.2和2.7版本的python。我该如何解决这个问题? 最佳答案 您只需要转到编辑/首选项并指定正确版本的python路径 关于python-名称错误:globalname'execfile'isnotdefinedtryingtorunanapponGoogleAppEngineLauncher,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions

python - 名称错误 : name 'reload' is not defined

我正在使用python3.2.2。当我写一个简单的程序时,我遇到了这个问题。>>>reload(recommendations)Traceback(mostrecentcalllast):File"",line1,inreload(recommendations)NameError:name'reload'isnotdefined我该怎么做? 最佳答案 您可能想要importlib.reload().fromimportlibimportreload在Python2.x中,这是一个builtin,但在3.x中,它位于importli

python - Lisp 的 read-eval-print 循环与 Python 的有何不同?

我遇到了以下statementbyRichardStallman:'WhenyoustartaLispsystem,itentersaread-eval-printloop.Mostotherlanguageshavenothingcomparabletoread,nothingcomparabletoeval,andnothingcomparabletoprint.Whatgapingdeficiencies!'现在,我很少用Lisp进行编程,但我已经用Python编写了大量代码,最近还用Erlang编写了一些代码。我的印象是这些语言也提供read-eval-print循环,但Sta

Python名称错误: name 'include' is not defined

已结束。此问题需要debuggingdetails.它目前不接受答案。编辑问题以包含desiredbehavior,aspecificproblemorerror,andtheshortestcodenecessarytoreproducetheproblem.这将有助于其他人回答问题。关闭6年前。Improvethisquestion我目前正在使用框架Django开发一个网站(我是初学者),但是我在使用Python时遇到了问题:因为我已经创建了我的模板,因此我不能再运行服务器了(堆栈跟踪指向文件urls.py中的一行):...path('apppath/',include('myap

python - 在 include() 中使用命名空间时有关 app_name 的错误配置错误

我目前正在试用Django。我在urls.py中的一个include()中使用了namespace参数。当我运行服务器并尝试浏览时,我收到此错误。File"C:\Users\User\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\urls\conf.py",line39,ininclude'Specifyinganamespaceininclude()withoutprovidinganapp_name'django.core.exceptions.ImproperlyConfigured:Spec

python - OS X ("ImportError: cannot import name _thread"上的 Matplotlib 问题)

在过去几天的某个时候,Matplotlib在OSX上停止为我工作。这是我在尝试importmatplotlib时遇到的错误:Traceback(mostrecentcalllast):File"/my/path/to/script/my_script.py",line15,inimportmatplotlib.pyplotaspltFile"/Library/Python/2.7/site-packages/matplotlib/pyplot.py",line34,infrommatplotlib.figureimportFigure,figaspectFile"/Library/Py

python - 导入错误 : cannot import name NUMPY_MKL

我正在尝试运行以下简单代码importscipyscipy.test()但我收到以下错误Traceback(mostrecentcalllast):File"",line1,inFile"C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py",line586,inrunfileexecfile(filename,namespace)File"C:/Users/Mustafa/Documents/MyPythonCode/SpectralGraphAnalysis/main.py",l

python - 为什么 Python 2.7 中的 print 括号是自愿的?

在Python2.7中,以下两个都将执行相同的操作print("Hello,World!")#Prints"Hello,World!"print"Hello,World!"#Prints"Hello,World!"但以下不会print("Hello,","World!")#Printsthetuple:("Hello,","World!")print"Hello,","World!"#Printsthewords"Hello,World!"在Python3.x中,print上的括号是强制性的,本质上使它成为一个函数,但在2.7中,两者都会产生不同的结果。关于Python2.7中的pri

java - 如何使用-XX :+UnlockDiagnosticVMOptions -XX:CompileCommand=print option with JVM HotSpot

我正在尝试使用-XX:+UnlockDiagnosticVMOptions-XX:CompileCommand=print,*MyClass.myMethod命令行,如thispost中所述.看来open-jdk(https://wikis.oracle.com/display/HotSpotInternals/PrintAssembly)可以使用它。如何在oracleJDK7和JVMHotSpot中使用这些选项(或类似选项)? 最佳答案 这些说明适用于Linux(Ubuntu10.04.4LTS),但应该适用于您的操作系统。下载后

java.lang.IllegalArgumentException : Invalid character (CR or LF) found in method name

我有一个在Tomcat8上运行的SpringMVC应用程序。一两天内,我的日志文件中出现异常15-Jun-201610:43:39.832INFO[http-nio-8080-exec-50]org.apache.coyote.http11.AbstractHttp11Processor.processErrorparsingHTTPrequestheaderNote:furtheroccurrencesofHTTPheaderparsingerrorswillbeloggedatDEBUGlevel.java.lang.IllegalArgumentException:Invalid