DEV Community

asim-builds
asim-builds

Posted on

I built a File Sharing App in Python (with Auto Discovery + Drag & Drop). Here is what I learned.

Screenshot of Python

Hi everyone! πŸ‘‹
I recently completed a weekend project: a Python-based file sharing app that works over local networks. I built it to deepen my understanding of networking and have a bit of fun with Python and its libraries (sockets). This post is a quick walkthrough of my project, what it can do, how I built it and what I learned in the process.


What the App Does
Here's a breakdown of the features:

  1. Graphical Interface (Tkinter) -> Has one tab for sender and one tab for receiver.
  2. Sender Side -> The sender side has the following features: Auto-discovers hosts on the local network, manual ip entry if preferred, port selection, drag and drop support, manual file browsing, and file integrity check using hash verification.
  3. Receiver Side -> The receiver side has the following features: Choose listening port, selecting folder to save received files and start/stop receiving buttons.

This project uses socket, threading, tkinterdnd2, and a few other standard Python libraries - no external dependencies.


Why I built it?
Honestly? I had a free weekend and an immense desire to finally do something with Python and networking β€” not just read about it. In the past, I’d spend hours going through tutorials, blog posts, or watching videos, but I rarely built anything concrete. I’d get stuck in the cycle of consuming information without ever putting it into practice. I’ve had many project ideas over the years β€” cool concepts and fun challenges I wanted to build. But more often than not, the GitHub repos ended up empty or abandoned. Why? Because I got stuck in perfectionism. I wanted to do everything myself, from designing to coding to testing, without asking for help or using any shortcuts. I thought that was the only β€œright” way to learn and grow. But this mindset became a huge barrier.
It held me back from actually finishing projects and sharing my work. Instead of progress, I got stuck in endless tweaking, doubting, and self-criticism.

This time, I wanted to break that habit. I decided: No overthinking. No waiting for the "perfect" idea. Just build something practical that works.

I’ve always enjoyed working with Python β€” not because I want to be a full-time developer again, but because it’s flexible, elegant, and fun. I also wanted to understand how real-world networking worked under the hood β€” sockets, broadcasting, file streams, ports β€” all those concepts that I’d read about but never truly internalized.

So I picked a challenge that would combine both: a local file-sharing app. It was a perfect blend of GUI work, sockets, and system-level communication β€” and it gave me a tangible reason to dive into networking from a hands-on perspective.

It wasn’t always smooth sailing β€” I ran into weird VM issues, firewall rules, and networking quirks β€” but that was the whole point: to learn by doing. And I’m glad I did


What I learned?

  • Broadcasting can be tricky with VMs. I tested the code with my laptop and VM and learned that doesn't always work between VMs and host machines. I solved it by using custom broadcast ip (192.168.1.255) as a fallback mechanism.

  • Not everything works magically. It might work in test environment but when experimenting in real world, some things break, some policies are enforced and so on.

  • Using GitHub copilot helped speed things up, but I still had to debug, refactor, and stitch logic together across files.

  • To divide the apps into modules. Every project I did before had all the code in a single main.py file but this time I decided to break things up. I especially did this because there was one of my specific personal project whose debugging became a nightmare to me because all the code was piled into a single file.


πŸ”—GitHub Repository
You can check out the full code here:

GitHub logo asim-builds / File-Share

A simple file share project using python

πŸ“ Python File Share

A simple yet powerful peer-to-peer file sharing app built in Python! Works across devices on the same network.

Supports:

  • βœ… One-to-one file transfers
  • βœ… Auto host discovery
  • βœ… Drag & Drop interface
  • βœ… Multiple file transfers
  • βœ… Transfer progress tracking
  • βœ… File integrity check using SHA-256

🎯 Features

  • πŸ“€ Sender Tab

    • Select files via file browser or drag & drop
    • Enter host manually or use Auto Discover
    • Custom destination filename
    • Configurable port
  • πŸ“₯ Receiver Tab

    • Choose save location
    • Start/Stop receiving with one click
    • Set listening port
  • πŸ” Host Discovery

    • Scan and list available hosts on the network
  • πŸ“Š Transfer Progress

    • Real-time file transfer status and logs
  • πŸ” Integrity Check

    • Uses SHA-256 to verify the file was transferred without corruption
  • πŸ“ Multi-file Support

    • Send multiple files in one go (automatically zipped)

πŸ“Έ Screenshots

alt text alt text


πŸš€ Getting Started

βœ… Requirements

  • Python 3.7+
  • Cross-platform (Windows/Linux/macOS)
  • No internet connection required (runs…

🧠Final Thoughts
I used to be scared of sharing my work - afraid of being judged, being seen or that my project wasn't good enough. But you know what? I had fun, I learned a lot and I am allowed to enjoy small victories even if its small. That's what matters. If you're learning Python or want to explore socket programming, I hope this inspires you to build something small and meaningful.
Let me know what you think - I'd love your feedback.


Photo Credits: Photo by Rubaitul Azad on Unsplash

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.