xxxxxxxxxx
while True:
choices = ["rock","paper","scissors"]
computer = random.choice(choices)
player = None
while player not in choices:
player = input("rock, paper, or scissors?: ").lower()
if player == computer:
print("computer: ",computer)
print("player: ",player)
print("Tie!")
print("computer: ", computer)
print("player: ", player)
print("You win!")
play_again = input("Play again? (yes/no): ").lower()
if play_again != "yes":
break
print("Bye!")
xxxxxxxxxx
var spawn = require("child_process").spawn,child;
child = spawn("powershell.exe",["c:\\temp\\helloworld.ps1"]);
child.stdout.on("data",function(data){
console.log("Powershell Data: " + data);
});
child.stderr.on("data",function(data){
console.log("Powershell Errors: " + data);
});
child.on("exit",function(){
console.log("Powershell Script finished");
});
child.stdin.end(); //end input