第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

如何調(diào)用需要CLI參數(shù)的python方法?

如何調(diào)用需要CLI參數(shù)的python方法?

慕的地6264312 2021-04-28 14:11:48
不太確定該如何表達(dá),但是我正在將bash腳本轉(zhuǎn)換為python,并且試圖在python庫(kù)中調(diào)用方法,該方法通常是通過(guò)CLI調(diào)用的。該方法使用argparse并在調(diào)用時(shí)需要2個(gè)參數(shù)。我不確定如何從單獨(dú)的python腳本調(diào)用此方法并提供兩個(gè)參數(shù)。我嘗試過(guò)的>>  from somelibrary import mymethod as method>>  method.main('foo', 'bar')Traceback (most recent call last):  File "<stdin>", line 1, in <module>TypeError: main() takes 0 positional arguments but 2 were given>>> method.main()usage: [-h] foo bar: error: the following arguments are required: foo, bar任何幫助是極大的贊賞!
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 262 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)