Skip to content

Commit 1dff601

Browse files
committed
link demo app project
1 parent 0c95137 commit 1dff601

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This swift package enables you to use python modules in your iOS apps.
1010

1111
## Usage
1212

13-
Use https://github.com/kewlbear/PythonKit.
13+
See https://github.com/kewlbear/PythonPlayground.
1414

1515
## Credits
1616

Sources/Resources/Resources.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Symbols
2727

2828
public let libURL = Bundle.module.url(forResource: "lib", withExtension: nil)
2929

30+
/// Initialize Python runtime
3031
public func Init() {
3132
setenv("PYTHONOPTIMIZE", "1", 1)
3233
setenv("PYTHONDONTWRITEBYTECODE", "1", 1)
@@ -38,13 +39,19 @@ public func Init() {
3839
FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].path,
3940
1)
4041

41-
setenv("TMP", NSTemporaryDirectory(), 1)
42+
SetTMP()
4243

4344
Py_Initialize()
4445
}
4546

47+
/// Set Python Home to enable finding basic Python modules
4648
public func SetPythonHome() {
4749
let pythonHome = Bundle.module.bundleURL.path
4850
let wHome = Py_DecodeLocale(pythonHome, nil)
4951
Py_SetPythonHome(wHome)
5052
}
53+
54+
/// Set directory path for temporary files
55+
public func SetTMP() {
56+
setenv("TMP", NSTemporaryDirectory(), 1)
57+
}

Sources/Symbols/Symbols.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
}
6464

6565
void *symbol = [(NSValue *) symbols[[NSString stringWithUTF8String:name]] pointerValue];
66-
NSLog(@"%s: %s", __func__, name);
66+
// NSLog(@"%s: %s", __func__, name);
6767
assert(symbol);
6868
return symbol;
6969
}

0 commit comments

Comments
 (0)