Skip to content

Instantly share code, notes, and snippets.

@SatyakiDe2019
Created October 2, 2021 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SatyakiDe2019/f7fcb86b0e0fec8f5d65bc6682f33786 to your computer and use it in GitHub Desktop.
Save SatyakiDe2019/f7fcb86b0e0fec8f5d65bc6682f33786 to your computer and use it in GitHub Desktop.
Calling Tk Circuit API
##############################################
#### Written By: SATYAKI DE ####
#### Written On: 25-Sep-2021 ####
#### Modified On 25-Sep-2021 ####
#### ####
#### Objective: Calling Tk Circuit API ####
##############################################
from tkgpio import TkCircuit
from json import load
from clsConfig import clsConfig as cf
fileName = str(cf.conf['JSONFileNameWithPath'])
print('File Name: ', str(fileName))
# initialize the circuit inside the GUI
with open(fileName, "r") as file:
config = load(file)
class clsBuildCircuit:
def __init__(self):
self.config = config
def genCir(self, main_function):
try:
config = self.config
circuit = TkCircuit(config)
circuit.run(main_function)
return circuit
except Exception as e:
x = str(e)
print(x)
return ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment