Python 2.7.12 socket.send with Timer -


i wanna set timer send data socket

but error occur first picture

in ubuntu 14.04

timer(len(p.pkt)/router.bandwidth, router.socket.send, (p.pkt)).start() 

i wrote 1 argument(p.pkt). error 'there no argument'

how can set timer socket.send function?

i use site timer class

https://docs.python.org/2/library/sched.html

if want program stop set amount of time before performing next step can use time function.

import time time.sleep(seconds) 

for example

import time print('text a') time.sleep(2) print('text b') 

the program print 'text a' wait 2 seconds print 'text b'.

i hope managed help.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -