草庐IT

coffee-script-source

全部标签

python - 单击应用程序时 Windows-Pyinstaller 错误 "failed to execute script "

我很难克服这个错误,我到处搜索该错误消息,但似乎与我的情况无关:"failedtoexecutescriptnew-app"new-app是我的pythonGUI程序。当我使用此命令运行pyinstaller时:pyinstaller.exe--onedir--hidden-importFileDialog--windowed--noupxnew-app.py它运行顺利。另外,当我执行命令行运行gui程序时,它运行良好,并且使用此命令生成GUI:.\dist\new-app\new-app.exe但是当我希望能够单击应用程序以获取GUI时转到该文件时,它给了我上面所说的错误。这是为什么

python - easy_install : ImportError: Entry point ('console_scripts' , 'easy_install' ) 未找到

我用easy_install安装pip,用pip安装django、virtualenv和virtualenvwrapper。几周后我刚刚回到它,django似乎不再工作了,但更令人担忧的是我无法重新开始该过程,因为easy_install返回以下错误:Traceback(mostrecentcalllast):File"/usr/bin/easy_install-2.7",line10,inload_entry_point('setuptools==0.6c12dev-r88846','console_scripts','easy_install')()File"/Library/Py

python - 使用 django : from "python manage.py shell" to python script

我可以移动到一个python项目目录(比如c:\www\myproject)然后发出pythonmanage.pyshell然后我可以使用django项目中的所有模块,从shell命令中说出以下命令:importsettingsfromdjango.templateimportTemplate,Contextt=Template("Mynameis{myname}.")c=Context({"myname":"John"})f=open('write_test.txt','w')f.write(t.render(c))f.close现在,当我尝试将所有命令收集到python脚本中时,比

python - 为什么 Upstart 不能运行 'source bin/activate' ?

upstart出于某种原因不会激活我的virtualenv。这就是我的运行方式script#Mystartupscript,plainoldshellscriptinghere.cdpath/to/envsourcebin/activate....endscript手动启动时virtualenv运行良好为什么这不起作用? 最佳答案 所以我已经解决了,由于某种原因Upstart不喜欢使用“源”,所以我将行改为:sourcebin/activate到.bin/activate这行得通,但不知道为什么,如果有人能解释一下,我会很感兴趣

python - 在 Windows : how to run a Python script from a virtualenv 上相当于 "source"的批处理

我已经编写了相当多的bash脚本,但很少在Windows上编写批处理脚本。我正在尝试激活Pythonvirtualenv,运行Python脚本,然后在脚本退出时停用virtualenv。我有一个名为env的文件夹,这是我的virtualenv,还有一个名为work的文件夹,其中包含我的脚本。这是我目前得到的:%~dp0env\Scripts\activate.batpython%~dp0work\script.pydeactivate但是,当我运行脚本时,它会激活virtualenv然后停止。它没有到达第二行并运行Python脚本。有没有办法“获取”激活脚本文件夹,以便可以像从命令行调

python - setup.py 中 entry_points/console_scripts 和脚本之间的区别?

通过setup.py将Python控制台脚本安装到我的路径中基本上有两种方法:setup(...entry_points={'console_scripts':['foo=package.module:func',],})和setup(...scripts=['scripts/myscript.sh'])有什么区别?我看到第一种方法允许我为我的脚本选择好的、特定的名称,但是还有其他区别吗?不同的原始用途、兼容性(setuptools、distutils、...?)、用法、...?我很困惑,一个很好的详细回复可以帮助我(可能还有其他人)正确理解这一切。更新:自从我提出问题PyPA发表th

python - shell 脚本 : Execute a python program from within a shell script

我试过用谷歌搜索答案,但没有成功。我需要使用我的作品super计算机服务器,但是要运行我的python脚本,它必须通过shell脚本执行。例如我想让job.sh执行python_script.py如何做到这一点? 最佳答案 只需确保python可执行文件在您的PATH环境变量中,然后添加到您的脚本中pythonpath/to/the/python_script.py详情:在文件job.sh中,放这个#!/bin/shpythonpython_script.py执行此命令使脚本可以为您运行:chmodu+xjob.sh运行它:./jo

python - PyCharm 错误 : 'No Module' when trying to import own module (python script)

我已经编写了一个模块(文件my_mod.py文件位于文件夹my_module中)。目前,我正在处理位于文件夹cur_proj中的文件cool_script.py。我已经使用File--open在PyCharm中打开了该文件夹(因此我假设它是一个PyCharm项目)。在ProjectView(CMD-7)中,我可以看到我的项目cur_proj(红色),在“外部库”下我确实看到了my_module。在cool_script.py,我可以写frommy_moduleimportmy_modasmmPyCharm甚至为my_mod提出了建议。到目前为止一切顺利。但是,当我尝试运行cool_sc

java - 使用 Maven 设置 Java 编译器的 -source 和 -target - 不起作用

我已设置我的pom文件,要求Maven使用source和target配置参数将我的源代码编译为1.5版兼容。这是我的pom:4.0.0comuser0.0.1-SNAPSHOTtestorg.apache.maven.pluginsmaven-compiler-plugin1.51.5我有一个像这样的简单主类:packagecom.user;publicclassTest{publicstaticvoidmain(String[]argv){System.out.println("".isEmpty());}}String#isEmpty()从Java1.6开始引入。但是,使用mvnc

java - Intellij : Search through the source of maven dependencies in a project

是否可以通过一个项目的所有maven依赖的源码搜索一下文本?例如:如果您导入以下示例maven项目:https://github.com/ajorpheus/javadoc-mem-test/tree/search-in-jars,搜索tempHeaders应该会出现AbstractClientHttpRequest.java作为搜索结果。有没有插件可以做到这一点?如果Intellij不支持此功能,您是否知道给定maven项目的与IDE无关的方法来执行此操作?我看过像jarexplorer这样的工具但他们似乎没有完成这项工作。 最佳答案