Skip to content

Commit 7f186cc

Browse files
Update README.MD
1 parent 9d8ed3a commit 7f186cc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.MD

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ iOS中嵌入Python脚本简单概括来说包括两个部分,
4949
* 指定PythonHome
5050
* 调用Py_Initialize 完成初始化
5151
52-
```
52+
  ```
5353
NSString * python_home = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"python"];
5454
wchar_t * wpython_home = Py_DecodeLocale([python_home UTF8String], NULL);
5555
Py_SetPythonHome(wpython_home);
5656
Py_Initialize();
5757
PyEval_InitThreads(); //初始化多线程
5858
PyRun_SimpleString("print('---tata---')");
59-
```
59+
  ```  
60+
6061
4. 添加Module搜索路径
6162
可以通过sys添加搜索路径,可以通过这种方式指定加载沙盒中的代码,可以实现热更新。
6263

0 commit comments

Comments
 (0)