Skip to content

This Python script allows you to share files or folders over your local network using an HTTP server. It also generates a QR code for convenient access to the shared resource.

Notifications You must be signed in to change notification settings

swarooppatilx/share.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

share.py

This Python script allows you to share files or folders over your local network using an HTTP server. It also generates a QR code for convenient access to the shared resource.

Requirements

  • Python 3.6 or newer
  • qrencode (Install using sudo apt install qrencode on Ubuntu/Debian-based systems)

Installation

  1. Clone this repository or copy the script to your local machine.
  2. Ensure you have Python 3 installed.
  3. Install qrencode if not already installed:
    sudo apt install qrencode

Usage

Run the script using Python with the desired file or folder path as an argument.

Basic Example

To share a file or folder:

python3 share.py /path/to/file_or_folder

Specify a Custom Port

You can specify a custom port with the -p or --port option:

python3 share.py /path/to/file_or_folder -p 8080

Accessing the Shared Resource

  • The script will output a URL (e.g., http://192.168.1.100:3000/) and display a QR code.
  • Open the URL in a web browser on any device connected to the same network.
  • Alternatively, scan the QR code with your smartphone to access the resource.

Add Alias for Shell

Add the following alias at the end of the file:

alias myscript="python3 ~/.scripts/share.py"

About

This Python script allows you to share files or folders over your local network using an HTTP server. It also generates a QR code for convenient access to the shared resource.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages