3

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.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rob
  • 151
  • 1
  • 2
  • 11

1 Answers1

3

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.

Akhil Mathew
  • 1,571
  • 3
  • 34
  • 69
  • Thanks so to upload a file would it be something like: import tftpy; client = tftpy.TftpClient('xxx.xxx.xxx.xxx', 69); client.upload('local_filename'); – Rob Jun 28 '17 at 07:56