python string与list互转
来源:互联网 发布:unity3d动态模型 编辑:程序博客网 时间:2024/06/09 14:12
因为python的read和write方法的操作对象都是string。而操作二进制的时候会把string转换成list进行解析,解析后重新写入文件的时候,还得转换成string。
>>> import string
>>> str = 'abcde'
>>> list = list(str)
>>> list
['a', 'b', 'c', 'd', 'e']
>>> str
'abcde'
>>> str_convert = ''.join(list)
>>> str_convert
'abcde'
>>>
http://piziyin.blog.51cto.com/2391349/568426
0 0
- python string与list互转
- python string与list互转
- python string与list互转
- python List与String 转化问题
- List<string>与string[]
- <python>string,list,tuple
- Python:list、dict、string
- python list to string
- Python list to string
- 基础 python(四)string与list的相互转换
- 【python】List与string转化--test_veh.py代码
- Python String 的replace()与List的remove()
- Python list dic tuple string
- python list string相互转换
- 常见List<String> 与ArrayList <String >之间
- String[] 与 List间转换
- python list与dict
- python中QStringList与QString、String互转
- 使用HTML5构建iOS8原生APP
- 《iOS Human Interface Guidelines》——Edit Menu
- hdu 2045(递推)
- Android6.0 按键流程(二)KeyboardInputMapper扫描码转成键盘码
- 顺序表的就地倒置
- python string与list互转
- JS输入银行卡号,4位自动加空格
- Wunder Fund Round 2016 (Div. 1 + Div. 2 combined)--A. Slime Combining
- 匹配文本中获取网址
- 面试笔试杂项积累-leetcode 31-35
- 将顺序表L1中的数据进行分类,奇数存放到存到顺序表L2中,偶数存到顺序表L3中
- python 数据类型转换
- OSG+QT5+vs2010编译
- HDU 1004:Let the Balloon Rise