くだすれPython(超初心者用) その39at TECH
くだすれPython(超初心者用) その39 - 暇つぶし2ch21:デフォルトの名無しさん
18/08/25 13:02:46.63 H9tlLYtz.net
>>17
すみません。これでいかがでしょうか。
PHP 7.2
$cmd = 'python3 python.py "日本語1 日本語2"';
exec($cmd, $output);
Python 3.6.5
# coding: utf-8
import sys
listhoge = {"日本語1":0, "日本語2":1}
a = sys.argv[1]
b = a.split(' ')
c = listhoge[b[0]]
error.log
Traceback (most recent call last):
File "python.py", line 23, in <module>
c = listhoge[b[0]]
KeyError: '\udce6\udc97\udca5\udce6\udc9c\udcac\udce8\udcaa\udc9e1'


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch