freeze

Pygame freezes on startup

Pygame freezes on startup Question: I’m using pygame to try and get better with python but it just doesn’t respond. I don’t know why, as I have similar code that works just fine. import pygame import random import time width = 500 height = 500 snake = [[width / 2,height / 2]] direction = "right" …

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 turtle.Screen() freezes and crashes every time

Python turtle.Screen() freezes and crashes every time Question: I’m making a space invader clone just to learn a little Python since I just started with it. I made a turtle.Screen() but everytime I run it, it instantly freezes and crashes. Does anyone know what’s causing this problem? import turtle from turtle import forward, right, left …

Total answers: 2

PyCurl request hangs infinitely on perform

PyCurl request hangs infinitely on perform Question: I have written a script to fetch scan results from Qualys to be run each week for the purpose of metrics gathering. The first part of this script involves fetching a list of references for each of the scans that were run in the past week for further …

Total answers: 2

pyplot plot freezes (not responding)

pyplot plot freezes (not responding) Question: I am struggling with pyplot from the matlpotlib library. The figure freezes already when I try to create the plot: plt.figure() plt.ion() ax1 = plt.subplot(211) #Here it freezes plt.title(‘test’, fontsize=8) plt.xlim(-1700, 1700) plt.ylabel(‘x-axis’) plt.xlabel(‘y-axis’) plt.grid() plt.show() …do something else I have only worked with Pyqt plots, but this time …

Total answers: 4

Regex match (w+) to capture single words delimited by |||

Regex match (w+) to capture single words delimited by ||| Question: I am trying to match if there’s singe word followed by s|||s and then another single word followed by s|||s so I’m using this regex: single_word_regex = r'(w+)+s|||s(w+)s|||s.*’ And when I tried to match this string, the regex matching hangs or take minutes (possibly …

Total answers: 1

How to retrieve pip requirements (freeze) within Python?

How to retrieve pip requirements (freeze) within Python? Question: I posted this question on the git issue tracker: https://github.com/pypa/pip/issues/2969 Can we have some manner of calling pip freeze/list within python, i.e. not a shell context? I want to be able to import pip and do something like requirements = pip.freeze(). Calling pip.main([‘freeze’]) writes to stdout, …

Total answers: 4

Is it possible to have multiple PyPlot windows? Or am I limited to subplots?

Is it possible to have multiple PyPlot windows? Or am I limited to subplots? Question: I’m not sure how to word my question more clearly. Basically, is PyPlot limited to one instance/window? Any hack or workaround I try either causes my program to freeze or for the second pyplot window to be queued until the …

Total answers: 4