本文整理汇总了Python中app.App.start方法的典型用法代码示例。如果您正苦于以下问题:Python App.start方法的具体用法?Python App.start怎么用?Python App.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.App
的用法示例。
在下文中一共展示了App.start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: App
# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import start [as 别名]
#!/usr/bin/python
from app import App
app = App()
app.start()
示例2: input
# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import start [as 别名]
user = input("Username [%s]: " % getpass.getuser())
if not user:
user = getpass.getuser()
#get password
password = getpass.getpass()
#creates a connection string
connection_string = ''+user+'/'+password+'@gwynne.cs.ualberta.ca:1521/CRS'
#attempts to connect
try:
connection = cx_Oracle.connect(connection_string)
#initalize App
app = App()
#Start the application and pass in connection
app.start(connection)
#Any time the app exists, the connection automatically closes
connection.close()
except cx_Oracle.DatabaseError as exc:
#Anytime there's an error in App it exists and enter here.
error, = exc.args
if error.code == 955:
print("Table already exists")
elif error.code == 1017:
print("Invalid Credentials")
else:
print(sys.stderr, "Oracle code: ", error.code)
print(sys.stderr, "Oracle message: ", error.message)
示例3: _parse_args
# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import start [as 别名]
import argparse
from app import App
def _parse_args(args=None):
"""Parse command line arguments, provide usage help to users."""
parser = argparse.ArgumentParser(
description="Monitors websites' status"
)
parser.add_argument(
"--poll_seconds",
required=False,
help="Override website status polling interval globally.",
type=int
)
return parser.parse_args(args)
if __name__ == "__main__":
args = _parse_args()
app = App()
app.start(args)
示例4: main
# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import start [as 别名]
def main():
app = App()
app.start()