summary refs log blame commit diff stats
path: root/examples/pythonex.nim
blob: e2664f35098b00ebc7b33645a42a35f2670dec88 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                              
# Example to embed Python into your application

import python

# IMPORTANT: Python on Windows does not like CR characters, so
# we use only \L here.

Py_Initialize()
discard PyRun_SimpleString("from time import time,ctime\L" &
                           "print 'Today is',ctime(time())\L")
Py_Finalize()