2017-05-22 5 views
0

これは初めてPythonスクリプトを実行しようとしています。エラー:Pythonスクリプトを実行すると引数が少なすぎます

プロンプトコマンドからgenesis.jsonpgeth.pyを開始しようとしています。

このエラーはtoo few argumentsです。

これらのプロンプトCMDライン私の窓の上のコマンドです:私の知る限り、source code of pgeth.pyを読み込むことで、引数が呼び出され

def init(args): 
    """init command""" 
    # account management 
    initAccount() 
    # init needed if there is no chaindata dir 
    datadir = getDataDir() 
    if checkDir(os.path.join(datadir, 'chaindata')): 
     return 
    geth = checkGethCommand() 
    options = [ "--datadir", datadir, "--networkid", "100" ] 
    # create the json genesis 
    address = getAddress() 
    txt = GENESIS.replace("$ADDRESS$", address) 
    f = open("genesis.json", "w") 
    f.write(txt) 
    f.close() 
    # launch the blockchain with the CustomGenesis.json file 
    cmdInit = [ geth ] + options + [ "init", "genesis.json"] 
    logging.debug("cmd: " + strCommand(cmdInit)) 
    subprocess.call(cmdInit) 
+0

あなたの 'pgeth.py'スクリプトの内容を表示できますか? – errata

+0

ご覧ください、私は質問を編集しました。 – user5953665

答えて

0

pgeth.pyスクリプトの

cd to/CreatePrivateEthereum-master_Folder 
python pgeth.py -init 

> pgeth.py: error: too few arguments 

コンテンツinit-initではありません。このようなスクリプトを実行すると問題は発生しません。

python pgeth.py init 
関連する問題