資源簡介
本資源是將PPT轉換成HTML文件的過程,在本文檔的word文件中描述了各種工具以及庫的安裝
代碼片段和文件信息
#!/usr/bin/python3
#?-*-?coding:?utf-8?-*-
import?os
import?sys
import?shutil
root?=?os.getcwd()
#total_list?=?0
def?htmlResult(path_resulttotal_list=0):
????#print?path_result
????html?=?open(‘index.html‘?‘w‘)
????html.write(“““
??????
?????????
???????????
??????????????ta?charset=“UTF-8“>
??????????????ript?language=“javascript“>
?????????????????function?setUrl(str){
???????????????????//alert(“in?getUrl?method“);
???????????????????//alert(str);
???????????????????//?get?total?list?from?html
???????????????????var?total_pages?=?document.getElementById(“total“).innerHTML;
???????????????????//alert(“total_pages...:?“+total_pages);
???????????????????var?old_url?=?document.getElementById(“pic“).src;???//?current?img?src
???????????????????//alert(old_url);
???????????????????
???????????????????var?new_url?=?““;
???????????????????var?old_str_num?=?““;
???????????????????var?old_int_num?=?0;
???????????????????var?new_int_num?=?0;
???????????????????var?old_str?=?““;
???????????????????var?new_str?=?““;
???????????????????
???????????????????//?set?new?img?src
???????????????????var?under?=?old_url.lastIndexOf(“_“)
???????????????????var?colon?=?old_url.lastIndexOf(“.“)
???????????????????old_str_num?=?old_url.substring(under+1colon);
???????????????????old_int_num?=?parseInt(old_url.substring(under+1colon));
???????????????????old_str?=?“_“?+?old_str_num?+?“.JPG“;
???????????????????new_str?=?“_“?+?new_int_num?+?“.JPG“
?
???????????????????if(str?==?“pre“){
?????????????????????if(old_str_num?==?“1“){
??????????????????????alert(“It‘s?already?the?first?page!“);
?????????????????????}
?????????????????????else{
??????????????????????new_int_num?=?old_int_num??-?1;
??????????????????????new_str?=?“_“?+?new_int_num?+?“.JPG“;
??????????????????????new_url?=?old_url.replace(old_str?new_str);?//?new?img?src
??????????????????????document.getElementById(“pic“).src?=?new_url;?
?????????????????????}
???????????????????}
???????????????????if(str?==?“first“){
??????????????????????//alert(“go?to?the?first?page!!“);
??????????????????????if(old_str_num?==?“1“){
????????????????????????alert(“It‘s?already?the?first?page!!!“);
??????????????????????}
??????????????????????else{
????????????????????????new_str?=?“_1.JPG“;?
????????????????????????new_url?=?old_url.replace(old_str?new_str);?//?new?img?src
????????????????????????document.getElementById(“pic“).src?=?new_url;
??????????????????????}
??????????????????????
???????????????????}
???????????????????if(str?==?“next“){
?????????????????????//alert(“go?to?the?next?page“);
?????????????????????if(old_str_num?==?total_pages){
????????????????????????alert(“It‘s?already?the?last?page!!!“);
??????????????????????}
?????????????????????else{
?????????????????????????new_int_num?=?old_int_num??+?1;
?????????????????????????new_str?=?“_“?+?new_int_num?+?“.JPG“
??????????????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????16966??2017-12-27?09:21??pptToHtml\python?steps.docx
?????文件?????150213??2017-12-22?10:22??pptToHtml\tools\comtypes-0.6.2.zip
?????文件?????912656??2017-12-21?17:38??pptToHtml\tools\office2007_18@20590.exe
?????文件???????6725??2017-12-26?18:45??pptToHtml\tools\picToHtml.py
?????文件???????1074??2017-12-26?17:32??pptToHtml\tools\picture\first.PNG
?????文件???????1108??2017-12-26?17:33??pptToHtml\tools\picture\last.PNG
?????文件????????950??2017-12-26?17:33??pptToHtml\tools\picture\next.PNG
?????文件????????862??2017-12-26?17:33??pptToHtml\tools\picture\pre.PNG
?????文件?????988090??2017-12-22?19:09??pptToHtml\tools\PILwin64.zip
?????文件???????3700??2017-12-26?19:27??pptToHtml\tools\pptToPic.py
?????文件???16674816??2017-12-21?16:55??pptToHtml\tools\python-2.7.6.amd64.msi
?????目錄??????????0??2017-12-26?18:17??pptToHtml\tools\picture
?????目錄??????????0??2017-12-26?19:27??pptToHtml\tools
?????目錄??????????0??2017-12-27?10:00??pptToHtml
-----------?---------??----------?-----??----
?????????????18757160????????????????????14
評論
共有 條評論