To run a server (easy_install tftpy first):
from tftpy.TftpServer import TftpServer
TftpServer( 'tftp' ).listen( 'localhost', 8069 )
Which serves up the files in the 'tftp' directory on port 8069 (69 is the standard tftp port). To download an existing file from the server:
from tftpy.TftpClient import TftpClientwhich should download the file "exists" from the server to the file 'downloaded.txt' (as long as the file exists).
TftpClient( 'localhost',8069).download( 'exists', 'downloaded.txt' )
Pingbacks are closed.