Skip to content

Tag: operating-system

os.system() keeps giving me import errors

I am using os.system(“python game2.py”) to run different parts of my code. Every time I try this it gives me an import error for example “no module named pygame” even though when I game2 itself, it works fine. What can I do? Answer Like said in other answers there is no need to run os.…

How to uninstall a .exe from a python script

Hello I can’t get an app to self uninstall. After converting a .py script to .exe when I press the button it is supposed to delete/uninstall itself from my computer. Actually I would like it to uninstall completely from my computer after pressing the button from the .exe how to do it? Here is the code: …

How to loop through a folder in Python

I am a new python user and I am trying to loop through all the items in a set file. Here is my code this far – When I load the for loop without the pd.read_excel it prints the names of each of the sheets in the console yet when I add in the read_excel portion I receive an error

How can I implement Circular SSTF in this code?

In my Operating Systems class, we have to present one algorithm as our final project. A mock model for any of the OS algorithms. I choose an algorithm which is an improved/variation of regular SSTF algorithm. It is called Circular SSTF. I have already implemented SSTF in python. But I can’t figure out a…

Opening Anaconda Prompt with python

I want to create a script that will help me with installing packages for Spyder. Therefore, I want to use Python and have the script first open Anaconda Prompt, then execute the commands and then close that window. However, I can get it to open for example the calculator but it doesn’t seem to open the …