1-100-100/2

在windows下用python3.9跑 

#!/usr/bin/python
# coding : UTF--8
import time
import os

# How to run
# (1)如果调用 python 脚本时,使用:
# python script.py 
# #!/usr/bin/python 被忽略,等同于注释
# (2)如果调用python脚本时,使用:
# ./script.py 
# #!/usr/bin/python 指定解释器的路径

# Start
if "__main__" == __name__:
    print("Hello python!")

    while 1 :
        x = input("Please input your request : [a/b]")
        print("  okay, your input is ", x)
        if x == "a":
            # print current time
            print("current time: ", time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))
        elif x == "b":
            # print current dir
            print("current dir: ", os.getcwd())
        else:
            print("  Please input [a/b]")

    print("Bye !")

你可能感兴趣的:(python,前端,服务器)