microsoft/qdk
Publicmirrored from https://github.com/microsoft/qdkAvailable
samples/python_interop/teleportation_project/RunTeleport.py
12lines · modeblame
441fbd35Bill Ticehurst1 years ago | 1 | from pathlib import Path |
0781c925Moumita1 years ago | 2 | import qsharp |
| 3 | | |
| 4 | # set the root folder for the Q# project | |
| 5 | # the root folder of a Q# project is where the qsharp.json file is located | |
| 6 | # make adjustments to the path depending on the location of the qsharp.json file | |
| 7 | | |
| 8 | # this example assumes your Python program is in the same folder as the qsharp.json file | |
441fbd35Bill Ticehurst1 years ago | 9 | this_dir = Path(__file__).parent |
| 10 | qsharp.init(project_root=this_dir) | |
0781c925Moumita1 years ago | 11 | |
91f754e1Scott Carda1 years ago | 12 | print(qsharp.eval("RunTeleport.Main()")) |