python--字符串转数字
摘要:今天遇到需要把字符串转为数字的情况,但是没有先判断字符串中是否有数字之外的,然后直接调用int()然后运行就提示错误了def slot_port_num(line): strlist = line.split('\n') total_port_num = 0 for single...
阅读全文
posted @ 2014-08-23 01:13
posted @ 2014-08-23 01:13