Skip to content

Instantly share code, notes, and snippets.

@slowriot
Created January 13, 2015 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slowriot/ff3a5e4db1cb0189b33f to your computer and use it in GitHub Desktop.
Save slowriot/ff3a5e4db1cb0189b33f to your computer and use it in GitHub Desktop.
Python hello world example for the exec system
#!/usr/bin/env python
# Simple hello world exec script showing basic usage
import sys
import os
username = os.environ.get('MCEXEC_PLAYERNAME')
if username == None:
# yellow is a good colour to use to warn players about problems
print("§eError getting username from exec!")
exit(1)
# green is a friendly colour to use for output from a command that succeeded
print("§aHello, §f%s§a!" % username)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment