Created
September 22, 2010 01:02
-
-
Save jrabbit/590912 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import pexpect | |
| #from subprocess import * | |
| if sys.argv[0] == "--bin": | |
| server_bin = sys.argv[1] | |
| else: | |
| # if len(sys.argv) > 1: | |
| # options = sys.argv | |
| # else: | |
| # options = "-Xms512M -Xmx512M -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer" | |
| server_bin = "java -Xms512M -Xmx512M -cp minecraft-server.jar com.mojang.minecraft.server.MinecraftServer" | |
| child = pexpect.spawn(server_bin) | |
| child.logfile = sys.stdout | |
| #on irc line: child.sendline(txt) | |
| child.expect("<[^<>]+>") #find chat lines, ex: 2010-09-21 19:50:50 [INFO] <dale1v> agh bugger from console | |
| #server = Popen(['java', options], shell=True, stdin=PIPE, stdout=PIPE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment