Created
January 13, 2015 04:00
-
-
Save slowriot/ff3a5e4db1cb0189b33f to your computer and use it in GitHub Desktop.
Python hello world example for the exec system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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