osCommerce 是一套基于GNU GPL授权的开源在线购物电子商务解决方案。osc具有易于操作的可视化安装界面、完善的前台商品展示和户在线购物车功能、强大的后台管理,还有运行速度快,国外很受推崇。官方并没有提供中文语言包,只能靠国内的一个组织汉化,可定制性相对差。
返回后缀名
import os path = 'first_directory/second_directory/file.txt'print os.path.splitext(path)[1]print type(os.path.splitext(path)[1])
.txt <type 'str'>
前缀名的bool判断
path = 'first_directory/second_directory/file.txt'print path.startswith('fir')True
后缀名的bool判断
path = 'first_directory/second_directory/file.txt'print path.endswith('.txt')True
os.path.splitext、.startswith、.startswith 探究
import os
path = 'first_directory/second_directory/file.txt'print os.path.splitext(path)print os.path.splitext(path)[1]print type(os.path.splitext(path)[1])printprint path.startswith('fir')print path.startswith('aaa')print type(path.startswith('fir'))printprint path.endswith('.txt')print path.endswith('.aaa')print type(path.endswith('.txt'))('first_directory/second_directory/file', '.txt')
.txt
<type 'str'>
True
False
<type 'bool'>
True
False
<type 'bool'>










