curl -O http://mp3.en8848.com/zhuo-bian-mei-guo/u01-1.lrc
curl -O http://mp3.en8848.com/zhuo-bian-mei-guo/u01-2.lrc
curl -O http://mp3.en8848.com/zhuo-bian-mei-guo/u01-3.lrc
lrc2htm.py
# -*- coding: cp936 -*-
import os, sys
import glob
if len(sys.argv) ==2:
pattern = sys.argv[1]
else:
print 'usage: lrc2htm.py *.lrc '
print 'create ?????.htm '
sys.exit(1)
for f1 in glob.glob(pattern):
print f1
fn,ext = os.path.splitext(f1)
if ext != '.lrc':
print 'Error: %s is not lrc file ' % f1
sys.exit(4)
if fn[-1]=='1': N='I'
elif fn[-1]=='2': N='II'
elif fn[-1]=='3': N='III'
else: N='?'
headline ="""<!DOCTYPE html>
<html>
<head>
<title> 走遍美国 %s </title>
</head>
<body>
<h3> EPISODE %s <a href=\"index.htm\">返回目录 </a></h3>
<audio controls="controls">
<source src="./%s.mp3" type="audio/mp3" />
<embed height="100" width="100" src="./%s.mp3" />
</audio>
<p>ACT %s
""" % (fn,fn[1:3],fn,fn,N)
fp1 = open(f1,'r')
f2 = fn +'.htm'
fp2 = open(f2,'w')
fp2.write(headline)
ln =0
for line in fp1:
ln +=1
if ln >4:
if len(line.strip()) >12:
i = line.find(']',0)
aline = '<br>'+line[i+1:]
fp2.write(aline)
else:
aline = '<br>'+line
fp2.write(aline)
#
fp2.write("</p>\n</body>\n</html>\n")
fp1.close()
fp2.close()
#
分享到:
相关推荐
Python: Learn Python in 24 Hours: Complete Beginners Guide English | 19 July 2016 | ASIN: B01IRGB6MY | 110 Pages If you are one of them who easily get scared of Python’s long, complicated code, then...
《零基础轻松学Python:青少年趣味编程(全彩版)》案例文件.zip
Thoughtful Machine Learning with Python: A Test-Driven Approach English | 25 Aug. 2016 | ISBN: 1491924136 | 250 Pages | AZW3/MOBI/EPUB/PDF (conv) | 16.77 MB By teaching you how to code machine-...
Python实现将json文件转为shapefile
Python: End-to-end Data Analysis by Phuong Vothihong English | 31 May 2017 | ASIN: B072M6868D | 1321 Pages | AZW3 | 27.07 MB Leverage the power of Python to clean, scrape, analyze, and visualize your...
可爱的 Python:将 XML 和 Python结合起来
功能描述:此程序使用Python编写 1. 可以将 单个SVG图片文件 转换为 【128/64/48/32/16】 任一尺寸的 ico 图片。 2. 可以将 一个目录下的所有SVG图片,同时转换为对应的 任意尺寸的 ico 图片。 3. 输入的 ico图标...
Python毕业设计:车牌识别系统源码Python毕业设计:车牌识别系统源码Python毕业设计:车牌识别系统源码Python毕业设计:车牌识别系统源码Python毕业设计:车牌识别系统源码Python毕业设计:车牌识别系统源码Python...
Python: Real World Machine Learning by Prateek Joshi English | 14 Nov. 2016 | ASIN: B01N74UY6B | ISBN-13: 9781787123212 | 983 Pages | MOBI/EPUB/PDF | 53.2 MB Learn to solve challenging data science ...
Python: Practical Python Programming For Beginners and Experts English | 9 July 2016 | ISBN: 1535192976 | 170 Pages Start work on your website, app, or search engine today with this practical Python ...
Python:pygame飞机大战源码和素材
82篇顶会巨佬撰写的入门机器学习与深度学习的神书
Nikhil Ketkar, "Deep Learning with Python: A Hands-on Introduction" English | ISBN: 1484227654 | 2017 | 143 pages | PDF | 7 MB Discover the practical aspects of implementing deep-learning solutions ...
《Python编程:从入门到实践》源代码文件
With this practical guide, you’ll learn how to use Python scripts and web APIs to gather and process data from thousands—or even millions—of web pages at once. Ideal for programmers, security ...
├─千锋Python教程:第01章 第一个Python程序与数据存储及数据类型(9集) │ │ .DS_Store │ │ │ ├─code │ │ 1、数据存储.txt │ │ 2、第一个python程序.py │ │ 3、注释.py │ │ 4、输出与输入.py │ ...
Python 工具:快速将 Python 函数快速转为 LaTeX 数学公式.zip 作者是 Google Brain 的软件工程师 Yusuke Oda,目前主要负责自然语言处理,语音处理,软件工程和机器学习等工程。 具体使用方式,可见作者在 Google ...
Introduction to Computing Using Python An Application Development Focus(2nd) 英文无水印pdf 第2版 pdf使用FoxitReader和PDF-XChangeViewer测试可以打开
https://blog.csdn.net/liu506039293/article/details/103972942