Hi Below is my code:
My Main intention is i need to call run(streampath) by passing argument from robot framework it is showing following above error.
import SimpleHTTPServer
import SocketServer
import os
from threading import Thread
import threading
class MyThread(Thread):
def __init__(self,streampath):
''' Constructor. '''
Thread.__init__(self)
self.streampath = streampath
def __str__(self):
return str(self.streampath)
def run(self):
#self.streampath=str(streampath)
os.chdir(self.streampath)
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
print "function thread", threading.currentThread()
httpd.serve_forever()
print "test1"
if __name__ == '__main__':
obj1 = MyThread("C:\\\\QED")
obj1.start()
obj1.run("C:\\\\QED")
print threading.currentThread()
print('test2')The above code implementing of creation of web server using multi threading. Please observe the code in MAIN function. My main intention is to call run() method by passing argument as path. When i do that it is showing following error.Error:TypeError: run() takes exactly 1 argument (2 given)Could someone helpo me where i am going wrong. My Main intention is i need to call run(streampath) by passing argument from robot framework it is showing following above error.
