Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running TFTP client/library in python

Tags:

python

tftp

Are there any TFTP libraries in Python to allow the PUT transfer of binary file to an IP address.

Ideally I would rather use a built in library if this is not possible then calling the cmd via python would be acceptable. Usually if TFTP is installed in windows the command in command prompt would be:

tftp -i xxx.xxx.xxx.xxx put example_filename.bin

One thing to note is that python is 32bit and running on a 64bit machine. I've been unable to run tftp using subprocess.

like image 968
Rob Avatar asked Feb 22 '26 16:02

Rob


1 Answers

You can use TFTPy

TFTPy is a pure Python implementation of the Trivial FTP protocol.

TFTPy is a TFTP library for the Python programming language. It includes client and server classes, with sample implementations. Hooks are included for easy inclusion in a UI for populating progress indicators. It supports RFCs 1350, 2347, 2348 and the tsize option from RFC 2349.

like image 197
Akhil Mathew Avatar answered Feb 24 '26 05:02

Akhil Mathew



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!