LoginSignup
0
0

More than 5 years have passed since last update.

python > string > 文字列のsplit > cmds = rcvd.split(",")

Last updated at Posted at 2015-11-13

","区切り文字列を分解したい。

参考
http://python.civic-apps.com/string-split-join/

test.py
rcvd = "set,mon,192.168.10.3,9000"
cmds = rcvd.split(",")
print cmds[0]
print cmds[1]
print cmds[2]
print cmds[3]
結果
Success time: 0.03 memory: 44680 signal:0
set
mon
192.168.10.3
9000
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0