Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo OFF
- cls
- REM Create the new 'venv' folder.
- set "PYTHON=%USERPROFILE%\Code\Python"
- set /P "PROJECT=New project name: "
- set "PRDIR=%PYTHON%\%PROJECT%"
- set "ENV=%PRDIR%\venv"
- if not exist "%ENV%" (
- mkdir "%ENV%"
- REM Create the virtual environment.
- echo Creating the virtual environment . . .
- python -m venv "%ENV%" --upgrade-deps
- REM Create a new Python file.
- echo #!python3>"%PRDIR%\run.py"
- call :NPP
- ) else (
- echo That project already exists.
- pause
- call :NPP
- )
- REM Activate the virtual environment.
- cd "%PRDIR%"
- cmd /K "%ENV%\Scripts\activate.bat"
- goto :EOF
- REM Open the new Python file.
- :NPP
- start "" /D "%PRDIR%" "C:\Program Files\Notepad++\notepad++.exe" "%PRDIR%\run.py"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement