def main(): if config.is_dev_environment(): run(config.get_name() + ' [dev environment]') else: try: run(config.get_name()) except: tk.messagebox.showerror(config.get_name(), 'Could not run the application')
def show_img_pre(self): filename = config.get_name() if filename.any(): if filename.dtype == "float32": filename = filename.astype(np.uint8) # 进制转换 cv2.imshow("img_show", filename) cv2.waitKey(0)
def get_new_name(originalname, courseid): shortname = config.get_name(courseid) if courseid != "": config.store_name(originalname, courseid) if shortname is not None: return shortname else: return originalname
def show_img_pre(self): filename = config.get_name() if filename.any() == True: debug.img_show(filename)
#!/usr/bin/env python # -*- coding: utf-8 -*- # author:ros import config import time b = 0 # 查看修改后的全局变量 while b < 20: b = b + 1 time.sleep(1) print(config.get_name())
import config from change import change_name import time change_name('12') name = config.get_name() print(name) # config.set_name('new_name') # print(config.get_name()) # time.sleep(1) # change_name()
import winreg import config # \HKEY_CURRENT_USER\Software\Classes\*\shell\Hasher\command registry_title = config.get_name() environmentKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Classes\*\shell', 0, winreg.KEY_ALL_ACCESS) applicationKey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'Software\Classes\*\shell\%s' % registry_title, 0, winreg.KEY_ALL_ACCESS) winreg.DeleteKey(applicationKey, 'command') winreg.DeleteKey(environmentKey, 'Hasher')