git-bash

Using UTF-8 in Python 3 string literals

Using UTF-8 in Python 3 string literals Question: I have a script I’m writing where I need to print the character sequence "Qä" to the terminal. My terminal is using UTF-8 encoding. My file has # -*- coding: utf-8 -*- at the top of it, which I think is not actually necessary for Python 3, …

Total answers: 1

running shell command in python under git-bash not working well

running shell command in python under git-bash not working well Question: I am using python3 under git-bash environment, and sometimes it does not run shell command well. #!/usr/bin/env python3 import subprocess as sp print("hello") print(sp.getoutput("ls -l")) # This works. print(sp.getoutput("date")) # This hangs and cannot terminate with ctrl-c. This does not happen when running under …

Total answers: 1

How to use python on gitbash

How to use python on gitbash Question: Python will not run in git bash (Windows). When I type python in the command line, it takes me to a blank line without saying that it has entered python 3.9.1 like it does in Powershell. It doesn’t give me an error message, but python just doesn’t run. …

Total answers: 2

Python GUI entry point not working on Bash for Windows

Python GUI entry point not working on Bash for Windows Question: I have a Python GUI app (using either PyQt5 or PySide2) which I would like to start with the command mypackage. Therefore, I added the following section to setup.cfg: [options.entry_points] gui_scripts = mypackage = mypackage:main On Linux and macOS, installing the package with pip …

Total answers: 2

"Permission Denied" trying to run Python on Windows 10

"Permission Denied" trying to run Python on Windows 10 Question: Seems as though an update on Windows 10 overnight broke Python. Just trying to run python –version returned a “Permission Denied” error. None of the three updates; KB4507453, KB4506991, or KB4509096 look like they’d be the culprit but the timing of the issue is suspicious. …

Total answers: 19

How do I enable Python last command history in Git Bash for Windows?

How do I enable Python last command history in Git Bash for Windows? Question: The last Python command entered and executed in the Python interpreter can be recalled by pressing the up arrow. This works as expected in the Windows CMD and Powershell, but in Git Bash for Windows the up arrow has no effect. …

Total answers: 2

Can't start foreman in Heroku Tutorial using Python

Can't start foreman in Heroku Tutorial using Python Question: I have been attempting to complete this tutorial, but have run into a problem with the foreman start line. I am using a windows 7, 64 bit machine and am attempting to do this in the git bash terminal provided by the Heroku Toolbelt. When I …

Total answers: 4

Can not activate a virtualenv in GIT bash mingw32 for Windows

Can not activate a virtualenv in GIT bash mingw32 for Windows Question: When I try to activate my virtualenv from GIT bash mingw32 I do not get the expected response. NOTE: py is the folder for Python projects in my Google Drive folder. hy is the virtualenv folder that was made when I ran virtualenv …

Total answers: 7