Python tools used for file name devision
今天因为工作的缘故,需要用Python写一个能够完全分解文件名的小程序。
import os
#path = os.path.abspath('.')
def split_fully(name):
parent_name,appendix = os.path.splitext(name)
if appendix == '':
return (parent_name,)
else:
return split_fully(parent_name) + (appendix, )
name = 'E-GEOD-66998.processed.1.zip'
result = split_fully(name)
print(result)
结果:

Python tools used for file name devision的更多相关文章
- Seven Python Tools All Data Scientists Should Know How to Use
Seven Python Tools All Data Scientists Should Know How to Use If you’re an aspiring data scientist, ...
- Python Tools for Machine Learning
Python Tools for Machine Learning Python is one of the best programming languages out there, with an ...
- Python tools for Visual Studio插件介绍
Python tools for Visual Studio是一个免费开源的VisualStudio的插件,支持 VisualStudio 2010,2012与2013.我们想要实现的是: ...
- plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
装一台新服务器环境的时候,装uwsgi报错: plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or di ...
- visual studio 2015使用python tools远程调试maya 2016
步骤: 1. 去https://apps.exchange.autodesk.com/MAYA/en/Home/Index搜索Developer Kit并下载,maya 2016可以直接点击这里下载. ...
- python d:\test.py File "<stdin>", line 1 python d:\test.py ^ SyntaxError: invalid syntax
pyhton出错: python d:\test.py File "<stdin>", line 1 python d:\test.py ^SyntaxError: i ...
- qingstor python-sdk 安装错误 src/MD2.c:31:20: fatal error: Python.h: No such file or directory
ubuntu安装python qingstor-sdk, src/MD2.c:31:20: fatal error: Python.h: No such file or directory compi ...
- Ubuntu下 fatal error: Python.h: No such file or directory 解决方法
参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or ...
- _mysql.c:29:20: error: Python.h: No such file or directory
在Centos系统中安装 pip install MySQL-python 提示: _mysql.c:29:20: error: Python.h: No such file or directory ...
随机推荐
- RabbmitMQ集群搭建流程
参考资料 1.rabbmitMQ集群搭建http://my.oschina.net/guol/blog/186445http://blog.ftofficer.com/2010/03/translat ...
- C++ 顺序容器 vector list deque 之比较
在C++标准库中定义了三种顺序容器类型:vector,list和deque.所谓顺序容器就是根据位置来存储和访问元素,元素的排列次序与元素的值无关,而是由元素添加到容器的次序决定的. vector的底 ...
- Knockout 可扩展性
你需要知道的顶级特性 Knockout 最棒的一个特点就是它的可扩展性.Knockout 存在大量的扩展点,包含大量的工具来创建我们的应用程序.许多开发者除了 Knockout 核心库之外没有使用任何 ...
- IOS内存泄漏
1. . - (void)viewDidLoad { [superviewDidLoad]; self.view.frame=CGRectMake(, , , ); NSArray *title1=[ ...
- c++class 内存布局
#include <iostream> using namespace std; class base1 { int a; double b; char c; }; int main() ...
- 从网络上获取图片并保存在sdCard上
package com.aib.soft; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileO ...
- C# 毛玻璃效果
- IOS7学习之路二(处理ios6到ios7后UITableView的两个显示问题)
1.在ios6开发的项目,当用ios7的虚拟机显示的时候会出现UINavigationItem遮挡TableView的问题: 下面是对比显示效果: 我的处理方法是: 在UITableViewContr ...
- js漫谈
不久前在武汉这边找到了自己的第一份软件方面工作,当时还很欢喜,可惜最后因为家里的事情,公司的情况等等,最近又成了待业状态,正好安静的考虑一下以后怎么走,是考研还是继续找工作,非计算机专业学生自学找软件 ...
- wxWidgets的安装编译、相关配置、问题分析处理
wxWidgets的安装编译.相关配置.问题分析处理 一.介绍部分 (win7 下的 GUI 效果图见 本篇文章的最后部分截图2张) wxWidgets是一个开源的跨平台的C++构架库(framewo ...