今天因为工作的缘故,需要用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的更多相关文章

  1. 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, ...

  2. Python Tools for Machine Learning

    Python Tools for Machine Learning Python is one of the best programming languages out there, with an ...

  3. Python tools for Visual Studio插件介绍

          Python tools for Visual Studio是一个免费开源的VisualStudio的插件,支持 VisualStudio 2010,2012与2013.我们想要实现的是: ...

  4. 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 ...

  5. visual studio 2015使用python tools远程调试maya 2016

    步骤: 1. 去https://apps.exchange.autodesk.com/MAYA/en/Home/Index搜索Developer Kit并下载,maya 2016可以直接点击这里下载. ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. _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 ...

随机推荐

  1. 基于Stm32的MP3播放器设计与实现

    原创博文,转载请注明出处 这是我高级电子技术试验课做的作业,拿来共享一下.项目在安福莱例程基础之上进行的功能完善,里面的部分内容可参考安福莱mp3例程.当然用的板子也是安福莱的板子,因为算起来总共做了 ...

  2. 【IOS开发】如何画1像素的线

    最近在项目中画了一根1像素的线,我是通过直接花一个但是通过PS查看,画了不止1个像素. 原代码语句: label1 = [[UILabel alloc] initWithFrame:CGRectMak ...

  3. golang 之 bson 与 struct 转换

    bson的介绍不说了golang下的解析包找到2个 一个是mongo的http://labix.org/gobson,另外一个比较小众https://github.com/sbunce/bson这里用 ...

  4. C++拷贝构造函数总结

    C++拷贝构造函数总结 目录: 拷贝构造函数的基础知识 拷贝构造函数的使用 拷贝构造函数的行为 1.拷贝构造函数的基础知识 拷贝构造函数(copy constructor)是构造函数,是拷贝已经存在的 ...

  5. mongodb学习(翻译1)

    学习mongodb,试着翻译写,英语能力有限,希望大家指正,不顺畅地方大家担待,会后续翻译后面内容: 开始认识C#驱动(官方) 简介 本介绍提供了足够的信息,让你开始使用C#的驱动程序.起步之后,你可 ...

  6. Windows 安装Mongoliadb

    1. 下载 下载地址: http://www.mongodb.org/downloads 我这里用的是:mongodb-win32-x86_64-2008plus-2.4.5.zip 2. 设置目录 ...

  7. ASP.NET Web API消息处理管道:Self Host下的消息处理管道[下篇]

    ASP.NET Web API消息处理管道:Self Host下的消息处理管道[下篇] 我们知道ASP.NET Web API借助于HttpSelfHostServer以Self Host模式寄宿于当 ...

  8. 使用C#实现DHT磁力搜索的BT种子后端管理程序+数据库设计(开源)

    使用C#实现DHT磁力搜索的BT种子后端管理程序+数据库设计(开源) 先直接上程序界面,了解整体工作流程是什么样子的,求服务器进行挂机测试,需要固定IP,空间大概需要10G左右(主要是BT种子占用空间 ...

  9. 【Linux】CentOS 学习笔记之二(命令)

    打开文件夹: cd finename 创建目录:mkdir  /filename mkdir -p /test/123/111        (多级目录) 删除目录: rmdir 删除目录或文件: r ...

  10. 从零开始学C++之继承(二):继承与构造函数、派生类到基类的转换

    一.不能自动继承的成员函数 构造函数 析构函数 =运算符 二.继承与构造函数 基类的构造函数不被继承,派生类中需要声明自己的构造函数. 声明构造函数时,只需要对本类中新增成员进行初始化,对继承来的基类 ...