0

let me give a little back story before i ask the question *this is my first post to StackOverflow. so im sorry if i offend anyone or if i dont know the proper rules attached to this forum

*im a beginner in coding and dont understand much of the complex codes, so if you have code in your answer please explain it so i can better myself , thanks in advance

  • the actual prgm im working on is for my mother who isnt so tech-intelligent so i decided to attempt to make a prgm called "APEDS" (Automated Personal Error Detection System)

http://pastebin.com/zt1zaVH9

the part of the code i have a question with is

    # [ 1 ] option ( internet ) 
elif action == '1':
    def submenu1():
        print(
"""
What Problems are u having with the internet?
"""
"""
[1] - Internet is Slow / Not Working 
[2] - There's no Wi-Fi / Can't connect to Wi-Fi44
[3] - 
[4] - Forgot my Wifi Password !
""")
    action = input("Please Select a Number: ")

    if action == '1':
        print('1')
    elif action == '2':
        print('2')
    elif action == '3':
        print('3')
    elif action == '4':
        print('4')
    else:
        print('\nNo valid choice has been selected please try again')
        time.sleep(3.5)

under the first option i would like it to ping a couple different reliable sources and lets say 5 in total , and if more then 4 fail it will proceed to the next step which is activate the reset cmd to the WeMo (which is attached to the router/modem) ( since the wifi will be off the cmd needs to be something like off> wait 30 sec> on )

the main part is i have no idea how to incorporate the WeMo api (https://github.com/iancmcc/ouimeaux/tree/master)

if i need to install anything on my computer to get it working please explain in detail how to do it

thanks again and im sorry if this was hard to follow

-BOF007

4

1 回答 1

0

要安装该 API,您可以使用 PIP

sudo pip install ouimeaux

如果你没有 PIP,你可以用你的包管理器安装它。以 Archlinux 为例

sudo pacman -S python-pip

我不知道那个 API,但你可以安装它,然后阅读文档并尝试代码示例,这样你就会理解它。你的目标似乎并不难,祝你好运!

于 2015-07-19T12:15:48.417 回答