def func_exec_eq(obj): while True: obj.func_print() choice_id = input( "\033[32;1mplz enter your choice_id(q for quit;e for exit)>\033[0m" ) if choice_id == 'e': main.run() if choice_id == 'q': exit() obj.func_exec_common(choice_id)
def main2(): while True: print("欢迎进入ATM界面") print("\t1.用户") print("\t2.管理员") print("\t3.超级管理员") choise = input("选择进入(q退出程序)>>:").strip() if choise == "1": main.run() elif choise == "2": manage.run() elif choise == "3": super_manage.run() elif choise == "q": exit(0)
def register_plugins(self, module, check_if_exists=True): """ Registers all plugins in a given module :type module: Module :type check_if_exists: bool """ if check_if_exists and module.file_name in self.modules: self.unregister_plugins(module.file_name) # create database tables module.create_tables(self.bot) # run onload hooks for onload_plugin in module.run_on_load: success = main.run(self.bot, onload_plugin, main.Input(bot=self.bot)) if not success: self.bot.logger.warning("Not registering module {}: module onload hook errored".format(module.title)) return self.modules[module.file_name] = module # register commands for command in module.commands: for alias in command.aliases: if alias in self.commands: self.bot.logger.warning( "Plugin {} attempted to register command {} which was already registered by {}. " "Ignoring new assignment.".format(module.title, alias, self.commands[alias].module.title)) else: self.commands[alias] = command self.log_plugin(command) # register events for event_plugin in module.events: if event_plugin.is_catch_all(): self.catch_all_events.append(event_plugin) else: for event_name in event_plugin.events: if event_name in self.events: self.events[event_name].append(event_plugin) else: self.events[event_name] = [event_plugin] self.log_plugin(event_plugin) # register regexps for regex_plugin in module.regexes: for regex_match in regex_plugin.regexes: self.regex_plugins.append((regex_match, regex_plugin)) self.log_plugin(regex_plugin) # register sieves for sieve_plugin in module.sieves: self.sieves.append(sieve_plugin) self.log_plugin(sieve_plugin)
"--profile-full", required=False, action="store_true", help="Slow, but effective method of collecting a user's Tweets and RT." ) twitter.add_argument("--all-tw", required=False, action="store_true", help="Search all Tweets associated with a user.") twitter.add_argument("--target-tw", required=False, action="store", help="User's Tweets you want to scrape", metavar="USERNAME") twitter.add_argument("--hashtag-tw", required=False, action="store", help="Get tweets containing emails from a hashtag", metavar="USERNAME") twitter.add_argument("--followers-tw", required=False, action="store_true", help="Scrape a person's followers.") twitter.add_argument("--followings-tw", required=False, action="store_true", help="Scrape a person's follows.") args = parser.parse_args() run(args)
from core import main from conf import setting, display if __name__ == "__main__": while True: print(display.index_default_menu.format(setting.DATE, setting.WEEK)) option = input('>>>>:').strip() if option == '1': main.run('person') elif option == '2': main.run('manager') elif option == '3': print('The ATM program end') break
#!/usr/bin/env python # -*- coding:utf-8 -*- #---------------------------------------------- #@version: ?? #@author: Dylan_wu #@software: PyCharm #@file: start.py #@time: 2017/6/20 21:56 #---------------------------------------------- import os import sys base_path = os.path.normpath(os.path.join(__file__, os.pardir, os.pardir)) sys.path.insert(0, base_path) from core import main if __name__ == '__main__': main.run()
import core.main as jpl import sys result, error = jpl.run('<stdin>', 'run("core/main.jpl")') try: if sys.argv[1]: result, error = jpl.run('<stdin>', 'run("'+ sys.argv[1] +'")') except: pass while True: text = input('jpl > ') if text.strip() == "": continue result, error = jpl.run('<stdin>', text) if error: print(error.as_string()) elif result: if len(result.elements) == 1: print(repr(result.elements[0])) else: print(repr(result))
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from core import main if __name__ == "__main__": main.run()
# Author:q1.ang import os import sys print(os.path.abspath(__file__)) #绝对路径 print(os.path.dirname(os.path.abspath(__file__))) #返回目录名,不要文件名 print(os.path.dirname(os.path.dirname( os.path.abspath(__file__)))) #返回目录名,不要文件名 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) print(BASE_DIR) sys.path.append(BASE_DIR) #添加环境变量 spending = None from core import main main.run(spending)
#Author:Sunshine丶天 import os import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) from core import main if __name__ == '__main__': # 全代码控制linux服务器 自动分析数据 roorPath = '/data/030/Data_' + sys.argv[1] + '/' main.run(roorPath)
#!/usr/bin/python3 #@Author:CaiDeyang #@Time: 2018/9/14 7:15 import socketserver import os import sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))) sys.path.append(BASE_DIR) from core import main from conf import settings # from modules.socket_server import MyTCPHandler if __name__ == "__main__": main.run() # 单线程版本 # server = socketserver.ThreadingTCPServer((settings.ftp_server['IP'], settings.ftp_server['Port']), MyTCPHandler) # server.serve_forever()
__author__ = 'HouLei' __date__ = '12/12/2017' import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from core import main if __name__ == '__main__': # partition.data_partition("../db/ml-20m/ratings.e", 3) main.run(sys.argv)
def f1(): main.run()
import sys, os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) # 加入环境变量 from core import main as m if __name__ == '__main__': m.run()
#!_*_coding:utf-8_*_ #__author__:"Alex Li" # 导入系统模块 import os # import sys #print(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) #获取当前py文件的顶层绝对路径 base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # print(base_dir) #将返回的绝对路径加入到系统变量 sys.path.append(base_dir) #导入core包下的main模块 from core import main if __name__ == '__main__': main.run() #调取main模块里的run函数,并运行
#! /usr/bin/env python # -*- coding:utf-8 -*- """ @author:Leijie @file:course_app_start.py """ import os, sys base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(base_dir) print(sys.path) if __name__ == "__main__": from core import main main.run() # 入口
def koukuan (u_name,zongjia): atmain.run(zongjia)
#liuhao ''' ATM 执行程序 ''' import os, sys BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.append(BASE_DIR) from core.main import run if __name__ == '__main__': run()
#程序运行窗口 import os, sys # 创建主程序目录 Base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # 导入到配置文件 sys.path.append(Base_dir) # 导入主程序模块 from core import main if __name__ == '__main__': main.run("atm")
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: Henson import os import sys import platform #判断平台是win还是linux if platform.system() == 'Windows': BASE_DIR = "\\".join( os.path.abspath(os.path.dirname(__file__)).split("\\")[:-1]) else: BASE_DIR = "/".join( os.path.abspath(os.path.dirname(__file__)).split("/")[:-1]) sys.path.insert(0, BASE_DIR) from core import main if __name__ == '__main__': main.run()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ import sys import os base_dir = os.path.dirname(os.path.abspath(os.path.curdir)) sys.path.append(base_dir) if __name__ == "__main__": from core.main import run run()