platform

Cross-Platform Installer paths

Cross-Platform Installer paths Question: I’m writing an installer for a Python app I’m making, and needed to have paths for different file locations. These are what I have so far, and so wondered if these were correct of if I should change any of them (particularly the Linux/macOS ones) I have a path for: the …

Total answers: 1

How to make a moving platform using Pygame

How to make a moving platform using Pygame Question: I am trying to implement a moving platform into my code,like one that moves side to side and the limites on how far from side to side could be set, however i am struggling to seem to find a way to do it with the way …

Total answers: 1

Is there an platform independent equivalent of os.startfile()?

Is there an platform independent equivalent of os.startfile()? Question: I want to run a program on several platforms (including Mac OS), so I try to keep it as platform independent as possible. I use Windows myself, and I have a line os.startfile(file). That works for me, but not on other platforms (I read in the …

Total answers: 5

Pythons platform.system() gives me str object has no attribute system but only in script

Pythons platform.system() gives me str object has no attribute system but only in script Question: If I do like this in the python prompt: import platform platform.system() I get Linux as expected. However if I do like this in my script: import platform if(platform.system() == “windows”): print x else: print y I just get this …

Total answers: 2

How do I check if I'm running on Windows in Python?

How do I check if I'm running on Windows in Python? Question: I found the platform module but it says it returns ‘Windows’ and it’s returning ‘Microsoft’ on my machine. I notice in another thread here on stackoverflow it returns ‘Vista’ sometimes. So, the question is, how do implemement? if is_windows(): … In a forward …

Total answers: 5