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这门课,今天就和大家分 ...
随机推荐
- 【a101】高精度实数加法
Time Limit: 1 second Memory Limit: 2 MB 问题描述 给出两个高精度正实数(可以含有小数点或没有),最长200位,字符串读入 求它们的和,小数部分末尾的0要舍去. ...
- [LeetCode][Java] Letter Combinations of a Phone Number
题目: Given a digit string, return all possible letter combinations that the number could represent. A ...
- 神经网络 vs 大脑
海马区域(负责记忆的关键区域) 0. 常见概念 神经递质:neurotransmitter 在突触传递中是担当"信使"的特定化学物质.简称递质. 重要的神经递质有:乙酰胆碱: 1. ...
- 线程堆栈大小 pthread_attr_setstacksize 的使用
pthread_create 创建线程时,若不指定分配堆栈大小,系统会分配默认值,查看默认值方法如下: # ulimit -s8192# 上述表示为8M:单位为KB. 也可以通过# ulimit -a ...
- Spring Boot+Mybatis+Pagehelper分页
Spring Boot 集成MyBatis和Pagehelper分页插件 mybatis-spring-boot-starter依赖树如下: pom配置 <project xmlns=" ...
- 解决maven项目找不到maven依赖的解决办法
不同的IDE对应的.classpath中的maven声明也不一样,这样就会导致项目找不到maven依赖. 即Java Build Path--->Libraries中找不到Maven Depen ...
- [React] Create & Deploy a Universal React App using Zeit Next
In this lesson, we'll use next to create a universal React application with no configuration. We'll ...
- jquery-12 折叠面板如何实现(两种方法)
jquery-12 折叠面板如何实现(两种方法) 一.总结 一句话总结:1.根据点击次数来判断显示还是隐藏,用data方法保证每个元素一个点击次数:2.找到元素的下一个,然后toggle实现显示隐藏. ...
- python 设计模式之 单例模式
单例模式是做为"全局变量"的替代品出现的.所以它具有全局变量的特点:全局可见.贯穿应用程序的整个生命期,保证在程序执行中,某个类仅仅存在一个实例,所以通常不希望类中的构造函数被调用 ...
- [React] Use React ref to Get a Reference to Specific Components
When you are using React components you need to be able to access specific references to individual ...