24小时热门版块排行榜    

查看: 10643  |  回复: 9
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

呵呵的szk

木虫 (小有名气)

[求助] 如何在origin上使用python第三方库 已有2人参与

请问如何在origin上使用python第三方库

发自小木虫IOS客户端
回复此楼

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

呵呵的szk

木虫 (小有名气)

引用回帖:
2楼: Originally posted by dhy229 at 2017-08-27 08:16:38
这个也可以?

比较新的版本自带Python 但是自带的库太少

发自小木虫IOS客户端
3楼2017-08-30 12:01:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 10 个回答

dhy229

木虫 (正式写手)

知识,需要深度与广度的有机结合。
2楼2017-08-27 08:16:38
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

miaomiao83

至尊木虫 (知名作家)

总裁办公室


jjdg: 金币+1, 感谢参与 2017-12-28 17:29:39
自己写脚本

发自小木虫IOS客户端
战略应该定位到一成不变的东西上。
4楼2017-12-21 12:12:07
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

crb912

铁虫 (初入文坛)

【答案】应助回帖

★ ★
jjdg: 金币+2, 感谢参与 2018-01-11 11:34:43
我建议你尝试这样做:
你把python代码写在一个单独的python脚本里,该脚本里面导入第三方库。然后在Origin上导入该脚本。

使用 run -pyf  命令选项开关,举个例子,
CODE:
// 为该脚本文件路径和名字定义一个字符
string str$ = system.PATH.PROGRAM$ + "\Samples\Python\ListMember.py";
// 运行这个脚本
run -pyf "%(str$)";
//  这个.py本文件内列出了所有PyOrigin 模块提供的函数。

关于导入第三方扩展,请遵从下列的条件:

  1. Make sure the downloaded Python extension version is either version 3.3 or version 2.7 to be compatible with the embedded Python version in Origin.
  2. Make sure the downloaded Python extension corresponding to same CPU register size as the Origin being running - 32 bit or 64 bit. To know whether current Origin verison is 32 bit or 64 bit, you can directly read it from Origin program window title bar or type command " system.bits=;" in Command Window or Script Window.
  3. Make sure the installed Python extension path is properly appended so it can be directly used by Python import command.
  4. Make sure current Python running version is compatible with downloaded Python extension. By default, it is Python version 3.3 running in Origin. To switch to use Python version 2.7, open Script Window and select menu SEdit: Script Execution: Python 2.7.



参考链接:https://www.originlab.com/doc/LabTalk/guide/work-with-python
Stayhungry,Stayfoolish
5楼2018-01-09 22:07:53
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见