当前位置: 首页>>代码示例>>Python>>正文


Python webrepl.start方法代码示例

本文整理汇总了Python中webrepl.start方法的典型用法代码示例。如果您正苦于以下问题:Python webrepl.start方法的具体用法?Python webrepl.start怎么用?Python webrepl.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webrepl的用法示例。


在下文中一共展示了webrepl.start方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: import webrepl [as 别名]
# 或者: from webrepl import start [as 别名]
def __init__(self):
        self.networks = NETWORKS
        self.ap_config = AP_CONFIG
        self.current_network_idx = None
        self.ap = network.WLAN(network.AP_IF)
        self.wlan = network.WLAN(network.STA_IF)
        self.info = ()
        webrepl.start() 
开发者ID:matejv,项目名称:micropython-weatherstation,代码行数:10,代码来源:nethelper.py

示例2: upload

# 需要导入模块: import webrepl [as 别名]
# 或者: from webrepl import start [as 别名]
def upload(stationid, password, tempf, humidity) :
    import socket
    try :
        #addr_info = socket.getaddrinfo(address, port)
        addr_info = socket.getaddrinfo("weatherstation.wunderground.com", 80)
        url = "/weatherstation/updateweatherstation.php?ID=%s&PASSWORD=%s&dateutc=now&tempf=%s&humidity=%s&softwaretype=ESP8266+DHT11&action=updateraw" % (stationid, password, tempf, humidity)
        addr = addr_info[0][-1]
        s = socket.socket()
        s.connect(addr)
        val = s.send(b"GET %s HTTP/1.0\r\nHost: weatherstation.wunderground.com\r\nUser-Agent: curl/7.43.0\r\nAccept: */*\r\n\r\n" % url)
        print("send val: %s" % val)
        print(s.read())
        s.close()
        send_status("uploaded data")
    except Exception as E :
        print("An error occurred: %s" % E)
        #set_led_error(5)
        import webrepl
        webrepl.start()
        raise Exception("Failed to upload data to wunderground.com: %s" % E) 
开发者ID:fadushin,项目名称:esp8266,代码行数:22,代码来源:util_old.py

示例3: randrange

# 需要导入模块: import webrepl [as 别名]
# 或者: from webrepl import start [as 别名]
def randrange(start, stop=None):
        if stop is None:
            stop = start
            start = 0

        return int(start + (stop - start) * random()) 
开发者ID:rnovacek,项目名称:thunderstorm,代码行数:8,代码来源:main.py

示例4: main

# 需要导入模块: import webrepl [as 别名]
# 或者: from webrepl import start [as 别名]
def main():
    trashbox = Trashbox()

    webrepl.start()
    trashbox.run() 
开发者ID:misterdanb,项目名称:trashbox,代码行数:7,代码来源:trashbox.py


注:本文中的webrepl.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。