from optparse import OptionParser
usage = "usage: %prog [options]"
parser = OptionParser(usage=usage)
import sys
print("Please choose the type of agent")
line = sys.stdin.readline()
i have put random and when i test what line looks like it give me random
parser.add_option("-p","--player1",dest="player1",
default=str(line),help="Choose type of first player")
i want to test if the value in entry are equal but it returns nothing why the default parameter can't learn the value str(line) i try also for line withour str
if str(opts.player1)=='random':
print ('true')
Aucun commentaire:
Enregistrer un commentaire