We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8a198c commit b7f2273Copy full SHA for b7f2273
python-to-rust/src/main.py
@@ -1,14 +1,19 @@
1
from ctypes import cdll
2
from sys import platform
3
4
-if platform == "darwin":
5
- ext = "dylib"
+if platform == 'darwin':
+ prefix = 'lib'
6
+ ext = 'dylib'
7
+elif platform == 'win32':
8
+ prefix = ''
9
+ ext = 'dll'
10
else:
- ext = "so"
11
12
+ ext = 'so'
13
-lib = cdll.LoadLibrary('target/debug/libdouble_input.' + ext)
14
+lib = cdll.LoadLibrary('target/debug/{}double_input.{}'.format(prefix, ext))
15
double_input = lib.double_input
16
17
input = 4
18
output = double_input(input)
-print(str(input) + " * 2 = " + str(output))
19
+print('{} * 2 = {}'.format(input, output))
0 commit comments