Get files of a pc from another device with Python

Open cmd into the folder you want to share the files of:

The cmd will open and it’s in the right folder yet (in the example D:\cartoonpy)

Creating a freaking server

You may think that this is difficult. It is not. You litterally have to do just this:

Digit python -m http.server in the cmd

Press enter

You get Serving…. 8000

Go in Chrome or any browser and digit localhost:8000

You will see, not by coincidence, that in the browser there are clickable link that have the same name of the folder and files are in the browser. This means it’s all right.

You can even check for the files. You cans see what is that cover image or what’s inside thos two cute folders.

This was the cover, isn’t it cute. All made by this multitalented blogger (dunno why I am not famous yet… damn).

Take a look at the address, just for curiosity

Ok, you find how to navigate in your files with the browser instead of the file browser (why programmers are short of fantasy for the names? They are so skilled, but they’re not good at that).

Ok, enough bullshit said. Let’s get to the sauce.

This is nice, but not relevant. In fact what is great is to have the chance to look into the files of your computer from another device, pc, tablet, smartphone. Wouldn’t it be cool? And you need just python (I mean all you got to do with python you did it yet with python -m http.server… you do not have to code a single line). How is it possible? It is.

Getting the ipv4 address

I am just hearing people complain that I said it was easy and now we got to make other stuff, who knows how long will it take… let’s get a snake or let’s play snake and forget about this guy. He is a scammer. Well, I’m not and for the one of yours that do not like snake, here’s what you need to do to get it done.

Open the cmd again and digit ipconfig and enter

Go with the mousewheel down until you find ipv4 and the corrispondent numer, copy it or memorize it into your long term memory, not the short term one, otherwise you will forget it after you read another silly sentence of this handsome blogger. Did you memorize it? Ok, we’re done.

Open your tablet, mobile phone or every device where you got a browser that are pratically everywhere, also in the refrigerators. Now digit http://192……. and all those fancy numbers corresponding to your ipv4.

Oh, I almost forgot: YOU HAVE TO STAY ON THE SAME WIFI.

As a miracle you will see this:

You can see it? It’s a screenshot of my mobile connected to my pc. Wow! I cannot believe. It’s like being in the 2000nds…

And I finaly can look at my masterpiece from the smartphone… the magic of this let me speechless. Com’on, go try it yourself and astonish your friends letting your know what a hacker you are.

See ya.


Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.