HOW TO: Install / Run Python Programs

Status
This thread has been locked.

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,210
Reactions
1,462
Resources
0
I've noticed a lot of interest in my Python program, a Minecraft username checker, as well as Croc's social media checker.

Unfortunately, it seems the biggest issue is people not being familiar with Python, which is understandable as the Minecraft community is much more Java-based than Python based, and has a lot of younger users that may not have any experience in programming at all. Although this guide requires no knowledge of any programming language, you should be familiar with downloading and installing programs, and possibly some command prompt usage (cmd).

Hopefully this guide will be brief enough, yet comprehensive enough, that anyone will be able to install the latest version of Python (3.6.2 as of 22 August 2017) and run a Python program (I will focus on my checker), without any issues.

Before we begin, you should understand what Python is. Python is a high-level interpreted object-oriented programming language. For those of you who are familiar with Java, it's kind of like Java, but much easier and more straight-forward.

The first step is to install the latest version of Python, available here:
https://www.python.org/downloads/
6iy10e.png

1. Download latest version of Python for Windows - This is what most of you want to click.
2. If you're running Mac - you will want to click on the Mac OS X download link, where you will want to download the installer for the latest version on that page.

Since I have no experience with Mac, I will be focusing on the Windows installation process.
(Once you have installed Python on Mac, the process of running the Python program is essentially the same).

After downloading Python, you should see a file named something like python-3.6.2.exe in your Downloads folder:
t3LeiT.png


Double click to run the installer, and you will see a screen like this:
fBocn5.png

Make sure you have selected 'Add Python 3.6 to PATH'. What this means is that you will be able to run the 'python' command from any folder on your computer, instead of being forced to use the Python console or having to specify the full file-path location to the Python binaries every time you want to run a .py script.

You can now click 'Install Now' and Python will be installed.

If everything went okay, you should see a success message (shown below), and you can feel free to close the window:
RQpVhZ.png


Now there are a few ways to verify things have been done correctly:
  1. Run the Python console:
    UIOebf.png


    You should see a window popup, displaying the version of Python you have installed:
    9gJ8e0.png


  2. You can also try running 'python' from the command-line. This can verify your Python version as well as verify that Python has been added to your PATH.
    The simpliest way to open a CMD within a specific folder is to click the filepath and type in 'cmd', shown below:
    Y4uiAY.gif

    You can now type in 'python', which should start the Python console (very similar to what we did in #1):
    n71Kdn.gif

    As you can see, we have Python 3.6.2 installed, and since we are in a random folder and 'python' worked, that means it was added to our PATH successfully.
You now have successfully installed the latest version of Python!

The next step is to understand how to run various Python programs.
Most Python programs are command-line programs. You do what we did above (type 'python') but you have to give it some arguments, such as the script name, and some programs might even take more arguments (i.e. an input file).

Here is a very basic Python program you can test:

test.py:
Code:
print("Hello, world!")

Feel free to save this, and try testing the program below by running it via command-line:
G8Nqui.gif


Another method of running a Python program (that takes no arguments) is to run it using the Python console:
un0rFP.gif

You notice that nothing happened (actually a black box flashed very quickly, then closed). This is because the program printed 'Hello, world!' then exited. Some programs that are meant to be run via the command-line will act like that.

Congratulations, now you know how to run Python programs (via the command-line, and via the Python console)!

I will now focus on something concerning my person Minecraft username checker, available here: http://www.mc-market.org/resources/4480/

In version 1.1 of my Minecraft username checker, I have it setup so that it can be run using the Python console, so those of you who were trying to do this unsuccessfully, you can do it now without any problems! See below:
YkGtbT.gif


Requests?
im6EGw.png

If you have freshly installed Python, you will not have access to all the dependencies, namely 'requests'. Simply following the instructions given (i.e. running 'pip install requests' on the command-line will fix this):
MAKE SURE YOU RUN "pip install requests" IN COMMAND PROMPT (CMD.еxe), NOT A PYTHON TERMINAL!
uL5m5D.png

Then try running the program again:
NZsylm.png


Hopefully this answers all of your questions concerning Python and my checker. If you have any further questions, feel free to post below and I (or someone else) will do their best to answer it.
 
Last edited:
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Sarahah

Founder | MA Ventures
Supreme
Feedback score
17
Posts
136
Reactions
67
Resources
0
Vouch worked for me, but I got a question. Why does sample.txt has a lot of different characters and are we able to change it?
 

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,210
Reactions
1,462
Resources
0
Vouch worked for me, but I got a question. Why does sample.txt has a lot of different characters and are we able to change it?
Sample was just a bunch of 3-character names, specifically all the 3-character combinations that have a repeating character. Maybe I'll consider including a better sample in the next version (going to be updated soon, just as soon as I finish compiling).
 

Sarahah

Founder | MA Ventures
Supreme
Feedback score
17
Posts
136
Reactions
67
Resources
0
Can't wait for the next update! although can you add an option that we can pick whether it generates 4 character accounts and 3? that would so helpful and thanks!
 
Last edited:

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,210
Reactions
1,462
Resources
0
Can't wait for the next update! although can you add an option that we can pick whether it generates 4 character accounts and 3? that would so helpful and thanks!
Not sure I would include that as a feature, possibly just including those lists. The new list will be the top 10000 English words, and there seems to be some decent names dropping.
Although still having issues getting it compiled.
 

Sarahah

Founder | MA Ventures
Supreme
Feedback score
17
Posts
136
Reactions
67
Resources
0
Not sure I would include that as a feature, possibly just including those lists. The new list will be the top 10000 English words, and there seems to be some decent names dropping.
Although still having issues getting it compiled.

Gl my man
 

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,210
Reactions
1,462
Resources
0

Jack

Retired Moderator
Supreme
Feedback score
11
Posts
1,210
Reactions
1,462
Resources
0
My file-path is a lot different to yours, and the test.py command didn't work for me either

I also had to manually create the 'Projects' folder
File path shouldn’t matter. Maybe I can help you via TeamViewer or something?
 
Status
This thread has been locked.
Top