Posts

Showing posts from September 11, 2018

Python - Pygame script will run in shell but not from script [closed]

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite This python script is part of a project but that doesn't have relevance. The script is attempting to use the pygame mixer module to load a wav file and play it; this works fine if I input the same code line-by-line in shell but not if I put it into a script and attempt to run it. from pygame import mixer mixer.init() mixer.music.load('sound.wav') mixer.music.play() If I run the script line-by-line in shell, the sound plays through the speakers fine but if I put it into a script and do 'python3 playSound.py' then the audio file does not play. python share | improve this question edited Oct 13 '17 at 20:59 asked Oct 13 '17 at 20:41 Josh Stafford 16 3 closed as off-topic by Michael Homer, GAD3R, Stephen Rauch, Jeff Schaller, Romeo Ninov Oct 14 '17 at 3:26 This question appears to be off-topic. The users who voted to close gave this specific re...

How to 'hash -r' and refresh all shells?

Image
Clash Royale CLAN TAG #URR8PPP up vote 3 down vote favorite 2 This is related to What is the purpose of the hash command? After installing a program I am looking for a way to tell all open shells to update their cache. I often have 6 to 8 of them open and I don't want to have to run hash -r 8 or 10 times. Anything more than once is a waste of time and effort. After installing a program in one shell, is it possible to either (1) have all shells rebuild their view of cached programs; or (2) rebuild the table and use that table for all other shells? If it is possible, then how do we do it? Here is the relevant section of man 1 hash , but it does not discuss how to achieve results globally. hash [-lr] [-p filename] [-dt] [name] Each time hash is invoked, the full pathname of the command name is determined by searching the directories in $PATH and remem‐ bered. Any previously-remembered pathname is discarded. If the -p option is supplied,...