鱼C论坛

 找回密码
 立即注册
查看: 1416|回复: 2

代码报错,找不到问题出在哪里,请大神赐教!

[复制链接]
发表于 2018-1-25 14:45:02 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
print("火眼服务启动")
temp = input("""请输入需启动服务的序号:
    1.zookeeper
    2.mysql
    3.FastDFS
    4.nginx
    5.cw-afaps
    6.cloudwalk-dpcs
    7.cw-afaps-storage
    8.cw-afaps-scheduled
    9.zookeeper
    10.Feature
    11.Recog
    12.AppServer
    13.facesnap
    14.streamserver
    15.退出""")
guess = int(temp)
while guess != 15:
    temp = input("""请输入需启动服务的序号:
    1.zookeeper
    2.mysql
    3.FastDFS
    4.nginx
    5.cw-afaps
    6.cloudwalk-dpcs
    7.cw-afaps-storage
    8.cw-afaps-scheduled
    9.zookeeper
    10.Feature
    11.Recog
    12.AppServer
    13.facesnap
    14.streamserver
    15.退出"""))
    guess = int(temp)
    if guess == 8:
        print ("""cd /home/1017/scheduled
    ll
    ./scheduled-service-start.sh
    """)
    else:
        if guess < 8 and guess == 1:
            print ("/usr/local/zookeeper-3.4.6/bin/zkServer.sh start\n")
        if guess < 8 and guess == 2:
            print ("service mysqlserver start\n")
        if guess < 8 and guess == 3:
            print ("""
    /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
    /usr/bin/fdfs_storaged /etc/fdfs/storage.conf
    """)
        if guess < 8 and guess == 4:
            print ("""
    cd /usr/local/nginx-1.10.0/sbin/
    ll
    ./nginx

    """)
        if guess < 8 and guess == 5:
            print ("""
    cd /home/1017//apache-tomcat-2.0/bin/
    ll
    ./start.sh
    """)
代码报错,找不到问题出在哪里,请大神赐教!
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2018-1-25 15:14:57 From FishC Mobile | 显示全部楼层
input后边引号没弄在句子前后
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-1-25 15:50:03 | 显示全部楼层
你最后多了个括号
while guess != 15:
    temp = input("""请输入需启动服务的序号:
    1.zookeeper
    2.mysql
    3.FastDFS
    4.nginx
    5.cw-afaps
    6.cloudwalk-dpcs
    7.cw-afaps-storage
    8.cw-afaps-scheduled
    9.zookeeper
    10.Feature
    11.Recog
    12.AppServer
    13.facesnap
    14.streamserver
    15.退出"""))
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 1 反对 0

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-12-27 10:59

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表