Site Tools


python:basic

Python

This topic is just a code dump right now. Might be fixed later…

#set environment
python -m venv <DIR>

#show installed python versions
PS V:\python> py --list
 -V:3.11 *        Python 3.11 (64-bit)
 -V:3.10          Python 3.10 (64-bit)
 -V:3.9           Python 3.9 (64-bit)
 -V:3.8-32        Python 3.8 (32-bit)

#show installed python paths
PS V:\python> py --list-paths
 -V:3.11 *        C:\Users\Lunetikk\AppData\Local\Programs\Python\Python311\python.exe
 -V:3.10          C:\Users\Lunetikk\AppData\Local\Programs\Python\Python310\python.exe
 -V:3.9           C:\Users\Lunetikk\AppData\Local\Programs\Python\Python39\python.exe
 -V:3.8-32        C:\Users\Lunetikk\AppData\Local\Programs\Python\Python38-32\python.exe

#use different python in venv
PS V:\python> virtualenv --python=C:\Users\Lunetikk\AppData\Local\Programs\Python\Python39\python.exe "<DIR>"

#activate python in venv
PS V:\python> .\<DIR>\Scripts\Activate.ps1

PS V:\python> python --version
Python 3.9.0

python/basic.txt · Last modified: 2023/07/06 22:39 by lunetikk