Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Commit 1db911d

Browse files
author
marcrasi
authored
import PythonKit or Python (#393)
1 parent d4e71ad commit 1db911d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/site/tutorials/model_training_walkthrough.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@
128128
"outputs": [],
129129
"source": [
130130
"import TensorFlow\n",
131-
"import Python"
131+
"#if canImport(PythonKit)\n",
132+
" import PythonKit\n",
133+
"#else\n",
134+
" import Python\n",
135+
"#endif"
132136
]
133137
},
134138
{

docs/site/tutorials/python_interoperability.ipynb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@
7878
},
7979
"outputs": [],
8080
"source": [
81-
"import Python\n",
81+
"#if canImport(PythonKit)\n",
82+
" import PythonKit\n",
83+
"#else\n",
84+
" import Python\n",
85+
"#endif\n",
8286
"print(Python.version)"
8387
]
8488
},

0 commit comments

Comments
 (0)