Skip to content

Instantly share code, notes, and snippets.

@tps2015gh
Last active May 30, 2017 03:03
Show Gist options
  • Save tps2015gh/0c039da4fa4c9e12161a93b310e7b34f to your computer and use it in GitHub Desktop.
Save tps2015gh/0c039da4fa4c9e12161a93b310e7b34f to your computer and use it in GitHub Desktop.

Operating System (OS)

Require install module

  • python.exe -m pip install pyGAME
  • python.exe -m pip install pyOPENGL

and then
open notepad.exe open this url https://pythonprogramming.net/opengl-rotating-cube-example-pyopengl-tutorial/

copy code from that url to notepad from

mport pygame
from pygame.locals import *

from OpenGL.GL import *
from OpenGL.GLU import *

#..... {TO} ......

pygame.display.flip()
        pygame.time.wait(10)
main()

save as demo1.py

Then run with

  • python.exe demo1.py

NOTE: if can not find python may use

  •     c:\python27\python.exe  -m pip install pygame
    
  •     c:\python27\python.exe  -m pip install pyOPENGL 
    
  •     c:\python27\python.exe  demo1 
    

Tested with Windows10 , python27

#To compile to *.pyc REF: https://askubuntu.com/questions/324871/how-to-compile-a-python-file

  • python.exe -m compileall
  • python.exe -m compileall ./

To Run code compiled

  • python.exe demo1.pyc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment