Skip to content

Commit 8516744

Browse files
committed
Win32DiskImager
1 parent 9628ffc commit 8516744

File tree

10 files changed

+144
-2
lines changed

10 files changed

+144
-2
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ python-3.7.3-embed-win32/Tools/HarExport/Export
1717
python-3.7.3-embed-win32/Tools/Everything/*
1818
!/python-3.7.3-embed-win32/Tools/Everything/Everything-1.4.1.935.x64.zip
1919
python-3.7.3-embed-win32/Tools/Shadowsocks/*
20-
!/python-3.7.3-embed-win32/Tools/Shadowsocks/Shadowsocks.exe
20+
!/python-3.7.3-embed-win32/Tools/Shadowsocks/Shadowsocks.exe
21+
python-3.7.3-embed-win32/Tools/Win32DiskImager/*
22+
!/python-3.7.3-embed-win32/Tools/Win32DiskImager/Win32DiskImager.7z

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ toolSets=\
6060
# 更新日志
6161

6262
```
63+
2019/6/3 Win32DiskImager 写入ISO系统到U盘 树莓派安装系统 ,关键词 ['win32diskimager','iso','shumeipai','raspberrypi','raspberry pi']
64+
65+
2019/6/3 Archive7z 7z lzma压缩 ,关键词 ['7z','zip','rar','lzma','yasuo']
66+
67+
2019/6/3 Ex7z 7z lzma解压 ,关键词 ['7z','zip','rar','lzma','jieyasuo']
68+
6369
2019/5/28 Shadowsocks 代理 翻墙 VPN ,关键词 ['shadowsocks','vpn','fanqiang','daili','proxy']
6470
6571
2019/5/28 Everything 极速搜索电脑文件 ,关键词 ['Everything','find','search','file','dir','sousuo']

python-3.7.3-embed-win32/GameDevTools.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
from Tools.HarExport import HarExport
4444
from Tools import Everything
4545
from Tools import Shadowsocks
46+
from Tools import Ex7z
47+
from Tools import Archive7z
48+
from Tools import Win32DiskImager
4649

4750

4851
os.system("mode con cols=121 lines=35")
@@ -161,6 +164,15 @@
161164

162165
# Shadowsocks 代理 翻墙 VPN
163166
Shadowsocks:[['shadowsocks','vpn','fanqiang','daili','proxy'],u'代理 翻墙 VPN'],
167+
168+
# Ex7z 7z lzma解压
169+
Ex7z:[['7z','zip','rar','lzma','jieyasuo'],u'7z lzma解压'],
170+
171+
# Archive7z 7z lzma压缩
172+
Archive7z:[['7z','zip','rar','lzma','yasuo'],u'7z lzma压缩'],
173+
174+
# Win32DiskImager IOS 写入ISO系统到U盘 树莓派安装系统
175+
Win32DiskImager:[['win32diskimager','iso','shumeipai','raspberrypi','raspberry pi'],u'写入ISO系统到U盘 树莓派安装系统'],
164176
}
165177

166178
toolSets_old=toolSets
723 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
��ѹ1\Win32DiskImager.7z �� 1\WinĿ¼
2+
D:\Downloads\7z1900-extra>7za.exe x 1\Win32DiskImager.7z -o1\Win
3+
4+
ѹ��
5+
D:\Downloads\7z1900-extra>7za.exe a -t7z newpack.7z Win32DiskImager\* -r -mx=9 -m0=LZMA2 -ms=10m -mf=on -mhc=on -mmt=on
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/python
2+
# -*- coding: UTF-8 -*-
3+
import hashlib
4+
from . import Helper
5+
6+
7+
def run():
8+
tmpFilePath=input(u"输入文件或文件夹路径:")
9+
tmpFilePath=tmpFilePath.replace("\r","").replace("\n","")
10+
Helper.Archive_7z(tmpFilePath)
11+
12+
13+
if __name__=="__main__":
14+
run()
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/python
2+
# -*- coding: UTF-8 -*-
3+
import hashlib
4+
from . import Helper
5+
6+
7+
def run():
8+
tmp7zFilePath=input(u"输入7z文件路径:")
9+
tmp7zFilePath=tmp7zFilePath.replace("\r","").replace("\n","")
10+
Helper.Ex_7z(tmp7zFilePath)
11+
12+
13+
if __name__=="__main__":
14+
run()

python-3.7.3-embed-win32/Tools/Helper.py

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ def OpenOneToolDir(varDir):
3737
# print(tmpExePath)
3838
os.system('start '+tmpExePath)
3939

40+
# 打开目录
41+
def OpenDir(varDir):
42+
os.system('start '+varDir)
43+
44+
4045
# if __name__=="__main__":
4146
# DownLoad('http://pic.cnblogs.com/face/u337375.jpg','./u337375.jpg')
4247

@@ -95,4 +100,64 @@ def ShowLogo(varToolTitle):
95100
with codecs.open("./data.bin","r","utf-8",errors='ignore') as tmpLogoFile:
96101
print(tmpLogoFile.read())
97102
print(varToolTitle)
98-
print("\n\n")
103+
print("\n\n")
104+
105+
# 获取文件所在文件夹
106+
def GetDirFromPath(varPath):
107+
return os.path.split(varPath)[0]
108+
109+
# 获取文件名带后缀
110+
def GetFileNameFromPath(varPath):
111+
return os.path.split(varPath)[1]
112+
113+
# 获取文件名不带后缀
114+
def GetFileNameWithoutExtFromPath(varPath):
115+
tmpFileName=os.path.split(varPath)[1]
116+
return os.path.splitext(tmpFileName)[0]
117+
118+
# 获取文件名后缀
119+
def GetFileExtFromPath(varPath):
120+
return os.path.splitext(varPath)[1]
121+
122+
# 替换文件名后缀 .7z
123+
def ChangePathExt(varPath,varExt):
124+
tmpFilePath,tmpExt=os.path.splitext(varPath)
125+
return tmpFilePath+varExt
126+
127+
# 7z解压,传入7z文件路径,解压目录
128+
def Ex_7z(var7zFilePath,varOpenDir=True):
129+
tmp7zExePath=os.getcwd()+"/Tools/7z/7za.exe"
130+
tmpExDirPath=GetDirFromPath(var7zFilePath)
131+
tmpCommand=tmp7zExePath+" x "+var7zFilePath+" -o"+tmpExDirPath
132+
print(tmpCommand)
133+
os.system(tmpCommand)
134+
if varOpenDir:
135+
OpenDir(tmpExDirPath)
136+
137+
# 7z压缩,传入目录
138+
def Archive_7z(varPath=""):
139+
tmp7zExePath=os.getcwd()+"/Tools/7z/7za.exe"
140+
141+
if os.path.isdir(varPath):
142+
if varPath.endswith('/') or varPath.endswith('\\'):
143+
varPath=varPath[0:-1]
144+
if varPath.endswith('/') or varPath.endswith('\\'):
145+
varPath=varPath[0:-1]
146+
print(varPath)
147+
148+
149+
tmp7zFilePath=ChangePathExt(varPath,".7z")
150+
tmp7zFileDirPath=GetDirFromPath(tmp7zFilePath)
151+
tmpCommand=tmp7zExePath+" a -t7z "+tmp7zFilePath+" "+varPath+"\\* -r -mx=9 -m0=LZMA2 -ms=10m -mf=on -mhc=on -mmt=on"
152+
print(tmpCommand)
153+
os.system(tmpCommand)
154+
OpenDir(tmp7zFileDirPath)
155+
elif os.path.isfile(varPath):
156+
tmp7zFilePath=ChangePathExt(varPath,".7z")
157+
tmp7zFileDirPath=GetDirFromPath(tmp7zFilePath)
158+
tmpCommand=tmp7zExePath+" a -t7z "+tmp7zFilePath+" "+varPath+" -r -mx=9 -m0=LZMA2 -ms=10m -mf=on -mhc=on -mmt=on"
159+
print(tmpCommand)
160+
os.system(tmpCommand)
161+
OpenDir(tmp7zFileDirPath)
162+
163+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/python
2+
# -*- coding: UTF-8 -*-
3+
import os
4+
from . import Helper
5+
6+
#使用python 库 求MD5
7+
def run():
8+
tmpZipFilePath=os.getcwd()+"/Tools/Win32DiskImager/Win32DiskImager.7z"
9+
tmpZipFilePath=tmpZipFilePath.replace('\\','/')
10+
# print(tmpZipFilePath)
11+
tmpTargetDirPath=os.path.splitext(tmpZipFilePath)[0]
12+
if os.path.isdir(tmpTargetDirPath)==False:
13+
# 先解压
14+
print(u"第一次打开,先解压\n")
15+
Helper.Ex_7z(tmpZipFilePath,False)
16+
print(u"解压完成\n")
17+
18+
tmpExePath=os.getcwd()+"/Tools/Win32DiskImager/Win32DiskImager/Win32DiskImager.exe"
19+
# print(tmpExePath)
20+
# Helper.OpenOneToolDir("Win32DiskImager/Win32DiskImager/")
21+
os.popen(tmpExePath)
22+
23+
if __name__=="__main__":
24+
run()
Binary file not shown.

0 commit comments

Comments
 (0)