system

Search results doesn't show in the template (Django)

Search results doesn't show in the template (Django) Question: I am very new to Django and I am creating a very simple project. However, the "search" part of my project is having some issues. Every time I try to search, it redirect me to the search template but not showing the data from the database. …

Total answers: 2

Is there a way to detect if a computer is brought out of sleep mode?

Is there a way to detect if a computer is brought out of sleep mode? Question: Problem I want to write a program in Python, where a script executes when it detects that it has been brought out of sleep mode. E.g I am using a laptop. When I open the laptop, the script should …

Total answers: 2

What is the use of stub files (.pyi ) in python?

What is the use of stub files (.pyi ) in python? Question: I am trying to understand the lower level implementations of python 3. There is one module named _posixsubprocess used by the subprocess module. I tried to find the location of this module in my system and found that it’s a stub file. Could …

Total answers: 1

python why win32process.GetWindowThreadProcessId() PID returns a list

python why win32process.GetWindowThreadProcessId() PID returns a list Question: I try to find the path to executable of the current active window in python. I am not familiar with system variables and did not know what i should do and i found a few solutions and practicing with them . First i try to get current …

Total answers: 1

Error: "The process 'xxx' not found" occurs after executing parallel python code

Error: "The process 'xxx' not found" occurs after executing parallel python code Question: I’m running a parallel python code using a port of pp (http://www.parallelpython.com//) for python 3 (https://pypi.python.org/pypi/ppft) and I’m getting this error right after the code finishes executing: ERROR: The process “12492” not found. I get one error for each processor used for …

Total answers: 1

os.mkdir(path) returns OSError when directory does not exist

os.mkdir(path) returns OSError when directory does not exist Question: I am calling os.mkdir to create a folder with a certain set of generated data. However, even though the path I specified has not been created, the os.mkdir(path) raises an OSError that the path already exists. For example, I call: os.mkdir(test) This call results in OSError: …

Total answers: 11

Difference between subprocess.Popen and os.system

Difference between subprocess.Popen and os.system Question: What is the difference between subprocess.Popen() and os.system()? Asked By: Arovit || Source Answers: Subprocess is based on popen2, and as such has a number of advantages – there’s a full list in the PEP here, but some are: using pipe in the shell better newline support better handling …

Total answers: 5

How to get current CPU and RAM usage in Python?

How to get current CPU and RAM usage in Python? Question: How can I get the current system status (current CPU, RAM, free disk space, etc.) in Python? Ideally, it would work for both Unix and Windows platforms. There seems to be a few possible ways of extracting that from my search: Using a library …

Total answers: 21