Because pygame is not supported by OnlineGDB (assuming that's what you want to use to program), I would think you might be able to download the pygame file and copy and paste the code into a new file on OnlineGDB. Then, you could just import your pygame file.