Demo entry 6682707

py

   

Submitted by pf on Dec 10, 2017 at 08:02
Language: Python. Code size: 929 Bytes.

# encoding: utf-8
# 11510257 彭福
import sys
import getopt


#######################################################################
                            #####deal with input####
#Deal with command line  parameter
#There are 6 parameter totally

#predefine
networkFilePath=''
sizeOfSeedSet=-1
diffusionModel=''
terminationType=-1
timeBudget=-1
randomSeed=-1


try:
    opts,args = getopt.getopt(sys.argv[1:],'i:k:m:b:t:r:')
except getopt.GetoptError as err:
    print str(err)
    sys.exit(2)

for op,value in opts:
    if op=="-i":
        networkFilePath=value
    elif op=='-k':
        sizeOfSeedSet=value
    elif op=='-m':
        diffusionModel=value
    elif op=='-b':
        terminationType=value
    elif op=='-t':
        timeBudget=value
    elif op=='-r':
        randomSeed=value

print networkFilePath,sizeOfSeedSet,diffusionModel,terminationType,timeBudget,randomSeed

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).