Email Address:
admin@achik.us achikahmed.info@gmail.com
Our Social Media Profiles:
Python is a popular programming language used for web development, automation, data analysis, scripting, and many other tasks. You can easily install Python on Windows using Command Prompt and the Windows Package Manager. It is also beginner-friendly and can be used for many different programming projects.
Here’s what you can do with Python on Windows:
You can easily install Python on Windows using a single Winget command. Open Command Prompt and run the command below to start the Python installation.
Install Python using Winget.
winget install Python.Python.3.12Follow the instructions shown in Command Prompt to complete the installation. After installing Python, close Command Prompt and open it again. Now you can start using Python commands.
Check the installed Python version.
python --versionYou can also use:
py --versionIf Python is installed correctly, Command Prompt will display the installed version.
Check the Python installation path.
where pythonCheck the Python launcher.
where pyYou can use Command Prompt to run Python programs, check the Python version, install packages, and create virtual environments. Here are some useful Python commands to get started.
You can start the Python interactive interpreter.
pythonYou will see the Python prompt:
>>>
You can now run Python commands directly.
Print a message.
print("Hello World")Perform a simple calculation.
10 + 20Check the Python version from inside the interpreter.
import sys<br>print(sys.version)<br>Exit the Python interpreter.
exit()You can also run a Python file from Command Prompt.
Create a file named:
hello.pyAdd the following code to the file:
print("Hello from Python")Open Command Prompt in the folder where the file is saved and run:
python hello.pyPython will execute the program and display the output in Command Prompt.
You can use the py command to run the same file:
py hello.pyCheck the installed Python packages.
python -m pip listCheck the pip version.
python -m pip --versionInstall a Python package.
python -m pip install package-nameFor example:
python -m pip install requestsUpgrade a package.
python -m pip install --upgrade package-nameRemove a package.
python -m pip uninstall package-nameCreate a new Python virtual environment.
python -m venv myenvActivate the virtual environment.
myenv\Scripts\activateAfter activation, you can install packages inside the virtual environment without affecting the main Python installation.
To leave the virtual environment, run:
deactivateUpgrade pip.
python -m pip install --upgrade pipRun a Python module from Command Prompt.
python -m module_nameShow Python help.
python --helpYou can also open the Python interpreter using the Python launcher:
pyRun a specific Python version if multiple versions are installed:
py -3.12You can use these commands to run Python, manage packages, create virtual environments, and run your own Python files directly from Command Prompt.
Python is a simple and powerful programming language for Windows. You can use it from Command Prompt to write programs, run scripts, install packages, and learn Python step by step.