From VBA and VB6 I'm calling a dll the creates a Python interpreter. If I set the PATH environment variable to point to "C:\python27" and PYTHONPATH to "c:\python27\lib" all is fine.

我从VBA和VB6调用一个dll来创建一个Python解释器。如果我将PATH环境变量设置为指向“C:\python27”,并将PYTHONPATH设置为“C:\python27 \lib”,一切都没问题。

If I don't set the PATH then calling Py_Initialise() crashes XL or my VB6 app, even if I call Py_SetProgramName with "c:\python27\python27.exe" first.

如果我没有设置路径,那么调用Py_Initialise()会崩溃XL或我的VB6应用程序,即使我用“c:\python27\python27”调用Py_SetProgramName。exe”放在第一位。

I'd like to specify the installation in VB/VBA rather than having it set in the environment as I can't do that in XL (works ok for VB6).

我希望在VB/VBA中指定安装,而不是在环境中设置,因为在XL中不能这样做(适用于VB6)。

3 个解决方案

#1


3

The best answer I've found so far is that it is a bug in Python - http://bugs.python.org/issue6498. The intepreter seems to call exit() on certain errors rather than passing a code back to the caller. Not very friendly if you're embedding python in an app. But there you go.

到目前为止,我发现的最好的答案是它是Python中的一个bug——http://bugs.python.org/issue6498。intepreter似乎在某些错误上调用exit(),而不是将代码返回给调用者。如果你在应用程序中嵌入python,那就不太友好了。

更多相关文章

  1. Gunicorn + Django + Heroku。Python的路径问题
  2. py2exe使用相对路径的当前目录问题
  3. tensorflow 变量定义路径//问题
  4. python在windows中的文件路径问题
  5. 轮询Web服务的最佳方式(例如,对于Twitter应用程序)
  6. 乘客的Django应用程序显示空主页
  7. Python添加默认模块搜索包路径
  8. 如何获得正在运行的Python脚本的路径?(复制)
  9. 用于在Google App Engine上构建应用程序的最佳开源IDE?

随机推荐

  1. Android自学笔记(番外篇):全面搭建Linux环境
  2. android的文件、目录操作
  3. Android 防止点击事件连按,isFastClick()
  4. Android studio2.3.3升级到3.1.2坑(小记)
  5. Android Progrees处理
  6. Android 8.1 系统锁屏显示流程整理
  7. Using C++ Code in Android Application
  8. Android(安卓)6.0运行时权限解决方案
  9. ScrollView中的LinearLayout不能使用andr
  10. Android不错的图片压缩方法