-
Notifications
You must be signed in to change notification settings - Fork 4
Download Files From Your Computer By Your Phone
The command python -m http.server 8000
is used to start a simple HTTP server on your computer, and it allows you to serve files from your computer to other devices on your local network. If you want to access this server from your phone, both your phone and your laptop need to be on the same local network (e.g., connected to the same Wi-Fi network).
Here's how you can connect your phone to the laptop's HTTP server using this command:
-
Start the HTTP Server: Open your terminal or command prompt on your laptop, navigate to the directory where your files are located (or where you want to serve files from), and run the following command:
python -m http.server 8000
This will start the HTTP server on port 8000 by default. You can specify a different port number if you prefer.
-
Find Your Laptop's IP Address: To connect your phone to your laptop, you need to know your laptop's local IP address. You can find this by running the following command on your laptop:
- On Windows, use
ipconfig
in the command prompt and look for the "IPv4 Address" under your active network adapter. - On macOS or Linux, use
ifconfig
orip addr
in the terminal and look for the "inet" address associated with your network adapter (usually something like 192.168.x.x).
- On Windows, use
-
Access the Server from Your Phone: On your phone, open a web browser and enter the following address:
http://<your_laptop_ip>:8000
Replace
<your_laptop_ip>
with the IP address you found in step 2. -
Access Files: You should now be able to access and browse the files in the directory where you started the HTTP server on your laptop. You can click on files to view or download them directly to your phone.
Remember that this connection is only accessible within your local network. If you want to access your laptop's server from outside your local network (e.g., over the internet), you would need to configure port forwarding on your router and possibly use dynamic DNS (DDNS) if you have a dynamic IP address.
- Introduction
- Variables
- Data Types
- Numbers
- Casting
- Strings
- Booleans
- Operators
- Lists
- Tuple
- Sets
- Dictionaries
- Conditionals
- Loops
- Functions
- Lambda
- Classes
- Inheritance
- Iterators
- Multi‐Processing
- Multi‐Threading
- I/O Operations
- How can I check all the installed Python versions on Windows?
- Hello, world!
- Python literals
- Arithmetic operators and the hierarchy of priorities
- Variables
- Comments
- The input() function and string operators
Boolean values, conditional execution, loops, lists and list processing, logical and bitwise operations
- Comparison operators and conditional execution
- Loops
- [Logic and bit operations in Python]
- [Lists]
- [Sorting simple lists]
- [List processing]
- [Multidimensional arrays]
- Introduction
- Sorting Algorithms
- Search Algorithms
- Pattern-matching Algorithm
- Graph Algorithms
- Machine Learning Algorithms
- Encryption Algorithms
- Compression Algorithms
- Start a New Django Project
- Migration
- Start Server
- Requirements
- Other Commands
- Project Config
- Create Data Model
- Admin Panel
- Routing
- Views (Function Based)
- Views (Class Based)
- Django Template
- Model Managers and Querysets
- Form
- User model
- Authentification
- Send Email
- Flash messages
- Seed
- Organize Logic
- Django's Business Logic Services and Managers
- TestCase
- ASGI and WSGI
- Celery Framework
- Redis and Django
- Django Local Network Access
- Introduction
- API development
- API architecture
- lifecycle of APIs
- API Designing
- Implementing APIs
- Defining the API specification
- API Testing Tools
- API documentation
- API version
- REST APIs
- REST API URI naming rules
- Automated vs. Manual Testing
- Unit Tests vs. Integration Tests
- Choosing a Test Runner
- Writing Your First Test
- Executing Your First Test
- Testing for Django
- More Advanced Testing Scenarios
- Automating the Execution of Your Tests
- End-to-end
- Scenario
- Python Syntax
- Python OOP
- Python Developer position
- Python backend developer
- Clean Code
- Data Structures
- Algorithms
- Database
- PostgreSQL
- Redis
- Celery
- RabbitMQ
- Unit testing
- Web API
- REST API
- API documentation
- Django
- Django Advance
- Django ORM
- Django Models
- Django Views
- Django Rest Framework
- Django Rest Framework serializers
- Django Rest Framework views
- Django Rest Framework viewsets