Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/w/a/wallmanager-HEAD/mtmenu/proxy.py   wallmanager(Download)
import socket
from config import PROXY_UDP_IP, PROXY_RECEIVING_PORT, PROXY_SENDING_PORT_ONE, PROXY_SENDING_PORT_TWO
import threading
from mtmenu.application_running import is_app_running
from mtmenu import logger
    def start_sockets(self):
        self.receive_sock = socket.socket( socket.AF_INET, # Internet
                              socket.SOCK_DGRAM ) # UDP
        self.receive_sock.bind((PROXY_UDP_IP, PROXY_RECEIVING_PORT))
        self.send_sock = socket.socket( socket.AF_INET, # Internet
        while self.flag:
            data = self.receive_sock.recv( 30 * 1024 ) # buffer size is 30 * 1024 bytes
            self.send_sock.sendto( data, (PROXY_UDP_IP, PROXY_SENDING_PORT_ONE) )
            if is_app_running():
                self.send_sock.sendto( data, (PROXY_UDP_IP, PROXY_SENDING_PORT_TWO) )