python 教程 第八章、 第一个python程序
第八章、 第一个python程序
#!/usr/bin/env python
import os
import sys
import time
source = [r'G:\s1', r'G:\s2']
target_dir = r'G:\d' + os.sep
today = target_dir + time.strftime('%Y%m%d')
now = time.strftime('%H%M%S')
comment = raw_input('Enter a commnet -->')
if len(comment) == 0:
target = today + os.sep + now
else:
target = today + os.sep + now + \
'_' + comment.replace(' ','_')
if not os.path.exists(today):
os.mkdir(today)
rar_command = r"D:\WinRAR\rar.exe a" + " %s %s" %(target, ' '.join(source))
if os.system(rar_command) == 0:
print "pass"
else:
print "fail"
python 教程 第八章、 第一个python程序的更多相关文章
- Python 练习冊,每天一个小程序
Python 练习冊,每天一个小程序 说明: Github 原文地址: 点击打开链接 Python 练习冊.每天一个小程序.注:将 Python 换成其它语言,大多数题目也试用 不会出现诸如「 ...
- Python Tkinter学习(1)——第一个Tkinter程序
注:本文可转载,转载请注明出处:http://www.cnblogs.com/collectionne/p/6885066.html.格式修改未完成. Tkinter资料 Python Wiki, T ...
- python笔记:#002#第一个python程序
第一个 Python 程序 目标 第一个 HelloPython 程序 Python 2.x 与 3.x 版本简介 执行 Python 程序的三种方式 解释器 -- python / python ...
- python基础(2):python的安装、第一个python程序
1. 第一个python程序 1.1 python的安装 自己百度,这是自学最基本的,安装一路确定即可,记得path下打钩. 1.2 python的编写 python程序有两种编写方式: 1.进入cm ...
- python 将一个JSON 字典转换为一个Python 对象
将一个JSON 字典转换为一个Python 对象例子 >>> s='{"name":"apple","shares":50 ...
- 【安装eclipse, 配置java环境教程】 编写第一个java程序
写java通常用eclipse编写,还有一款编辑器比较流行叫IJ.这里我们只说下eclipse编写java的前期工作. 在安装eclipse之前要下载java的sdk文件,即java SE:否则无法运 ...
- Python 简明教程 --- 2,第一个Python 程序
微信公众号:码农充电站pro 个人主页:https://codeshellme.github.io 如果你发现特殊情况太多,那你肯定是用错方法了. -- Carig Zerouni 当你在自己的电脑上 ...
- Python 绘制图表之我见 ---一个java程序员的看法
---------------- 环境: win 10 . python3.5 https://github.com/Leechen2014/1400OS_01_Codes/blob/master/ ...
- python教程:用简单的Python编写Web应用程序
python现在已经成为很多程序员关注的编程语言之一,很多程序员也都开始弄python编程,并且很多时候都会用自己的操作来选择,而现在不管是程序员还是少儿编程,都会有python这门课,今天就和大家分 ...
随机推荐
- 【u230】回文词
Time Limit: 1 second Memory Limit: 128 MB [问题描述] CR喜欢研究回文词,有天他发现一篇文章,里面有很多回文数,这使他来了兴趣.他决定找出所有长度在n个字节 ...
- 编译pano13的一些注意事项
作者:朱金灿 来源:error C2037: "jmpbuf"的左侧部分指定未定义的结构/联合"png_struct_def"e:\src\Test\libpa ...
- mariadb远程不能访问,出现Can't connect to MySQL server on '' (10061)
一,现象: 1. 1 远程连接数据库mariadb时,报错 二,定位: 2. 1 首先本地连接上数据库,然后操作权限表数据 ,然后远程再次连接依然连接不上: 2. 2 搜索mariadb的配置文 ...
- 【9207&&b701】统计数字(NOIP2007)
问题描述 某次科研调查时得到了n个自然数,每个数均不超过1500000000 (1.5*109).已知不相同的数不超过10000个,现在需要统计这些自然数各自出现的次数,并按照自然数从小到大的顺序输出 ...
- 【34.25%】【BZOJ 2648】SJY摆棋子
Time Limit: 20 Sec Memory Limit: 128 MB Submit: 2718 Solved: 931 [Submit][Status][Discuss] Descrip ...
- Facial keypoints detection Kaggle 竞赛系列
3.2# Facial keypoints detection 作者:Stu. Rui QQ: 1026163725 原文链接:http://blog.csdn.net/i_love_home/art ...
- 【codeforces 758B】Blown Garland
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...
- 联想笔记本装win7
http://jingyan.baidu.com/article/7c6fb42862d63a80642c90b8.html http://bbs.thinkworldshop.com.cn/thre ...
- [自学AndroidStudio系列]第二篇章:高速上手AS小技巧其一
事实上看过第一篇的文章的人可能发现了,这个系列实际上是针对,有android开发经验的,之前使用Eclipse的开发人员;所以,避免无谓的口舌,直接进入说重点吧; 关闭项目自己主动打开 AS会自己主动 ...
- [Ramda] Get a List of Unique Values From Nested Arrays with Ramda (flatMap --> Chain)
In this lesson, we'll grab arrays of values from other arrays, resulting in a nested array. From the ...