9/12/2023 0 Comments How to run python script in mac![]() ![]() Or manually supply the path to desired Python, for example: $Python="C:\Program Files\Python39\Python.exe" If there are multiple lines, use: $Python=where.exe Python.exe | Select-Object -First 1 To check if there are multiple lines, if there is only one line use: $Python=where.exe Python.exe ![]() The first line uses where.exe to find where the Python.exe is, if Python.exe is in PATH environment variable, problem is if there are multiple Python.exe the result of it isn't a one line string, there would be multiple lines, try to run: where.exe Python.exe Set-ItemProperty -Path "HKCR:\Python.File\shell\runas\command" -Name "DelegateExecute" -Type String -Value '""' Set-ItemProperty -Path "HKCR:\Python.File\shell\runas\command" -Name "(Default)" -Type String -Value $Command ![]() Step 2: Paste these commands: $python=where.exe Python.exeĬmd /c $('ftype Python.File="" \"%1\" %*' -f $python.replace("\","\\") Win+ R→type powershell→ Ctrl+ Shift+ Enter You can modify the registry to add Run as Administrator option for Python files to context menu. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |