[关闭]
@pandaoxi2022 2022-11-05T10:45:33.000000Z 字数 2952 阅读 300

网课截图工具帮助文档

帮助文档


开发者:大帅哥.
联系方式:电子邮箱.

你可以尝试运用不同的方法使用此程序。

使用方法

  1. 打开 https://pandaoxi2020.lanzouy.com/iCRwN0f7z4mj ,下载应用程序。
  2. 下载完成后,打开下载文件夹,里面应该有一个钉钉图标的文件。
  3. 选中那个文件,点击右键,找到“发送到”,点击旁边的“桌面快捷方式”。重复两次此操作!
  4. 看到桌面上应该有两个同样的图标了。选中其中一个,右键,属性。
  5. 在属性“目标”栏的 后面,输入一个空格,再输入 。选择一个你熟悉的快捷键,例如我此处选的是 ,再点“应用”或“确定”。这样,你只需要同时按下这三个键就可以截图了。
  6. 同样的方法,在另一个快捷方式上输入的是空格。选择一个你熟悉的快捷键。
  7. 现在,你可以试试第五步所输入的快捷键,会发现弹窗,桌面上新增了一个文件夹,里面有一个文件。

  8. 点击这个文件,浏览器打开,即可看到您的笔记拍照。
  9. 现在,你可以试试第六步设置的快捷键,会弹出窗口提示选择笔记文件和导出路径。按照要求选择后,会在指定文件夹生成保存过的图片文件。




  10. 遇到 ,可以给大帅哥 发邮件求助嗷。

更多使用方法,等待你去发现!

源代码

  1. # Author:PanDaoxi
  2. from tkinter.filedialog import askdirectory, askopenfilename
  3. from sys import argv, exit, setrecursionlimit
  4. from base64 import b64encode, b64decode
  5. from os import remove, environ, mkdir
  6. from pyautogui import screenshot
  7. from os.path import exists
  8. from easygui import msgbox
  9. from time import strftime
  10. from tkinter import Tk
  11. window = Tk()
  12. window.withdraw()
  13. width = window.winfo_screenwidth()
  14. height = window.winfo_screenheight()
  15. def gcd(a, b):
  16. if b == 0:
  17. return a
  18. else:
  19. return gcd(b, a % b)
  20. def makeXY():
  21. a, b = width, height
  22. x = gcd(a, b)
  23. a /= x
  24. b /= x
  25. while a < 500 or b < 500:
  26. a *= 2
  27. b *= 2
  28. return (a, b)
  29. w, h = makeXY()
  30. setrecursionlimit(114514)
  31. vl = argv[1 : len(argv)]
  32. title = "网课截图工具"
  33. makeBase64 = lambda s : b64encode(s).decode()
  34. filePath = "%s\\Desktop\\笔记拍照" % environ["UserProFile"]
  35. if not exists(filePath):
  36. mkdir(filePath)
  37. def makeImage():
  38. image = screenshot(region = (0, 0, width, height))
  39. image.save("./temp.png")
  40. with open("./temp.png", "rb") as f:
  41. fileBase64 = makeBase64(f.read())
  42. remove("./temp.png")
  43. return fileBase64
  44. def output(fileBase64):
  45. altNumber = strftime("%Y%m%d")
  46. today = "%s\\%s.html" % (filePath, altNumber)
  47. if not exists(today):
  48. with open(today, "w", encoding="utf-8") as f:
  49. f.write("")
  50. with open(today, "a", encoding="utf-8") as f:
  51. f.write("<img alt=\"%s\" src=\"data:image/png;base64,%s\" width=\"%d\" height=\"%d\"/></br></br></br>\n" % (altNumber+strftime("%H%M%S"), fileBase64, w, h))
  52. msgbox("保存成功!", title)
  53. def getImage():
  54. today = askopenfilename(title = title + ":读入笔记文件", initialdir = filePath, filetypes = (["已保存的笔记", "*.html",],))
  55. while not exists(today):
  56. today = askopenfilename(title = title + ":您使用了一个不合法的路径", initialdir = filePath, filetypes = (["*.html", "已保存的笔记"],))
  57. with open(today, "r", encoding="utf-8") as f:
  58. fr = f.read()
  59. temp = fr.splitlines()
  60. fd = {}
  61. for i in temp:
  62. alt = i[10 : 24]
  63. fd[alt] = i.replace('<img alt="%s" src="data:image/png;base64,' % alt, "").replace("\" width=\"%d\" height=\"%d\"/></br></br></br>" % (1024, 576), "")
  64. save = askdirectory(title = title + ":选择输出路径", initialdir = filePath)
  65. while not exists(save):
  66. save = askdirectory(title = title + ":您使用了一个不合法的路径", initialdir = filePath)
  67. for i in fd:
  68. t = "%s\\%s.png" % (save, i)
  69. with open(t, "wb") as f:
  70. f.write(b64decode(fd[i].encode()))
  71. msgbox("输出完成!", title)
  72. try:
  73. if not len(vl):
  74. msgbox("您没有添加任何参数。\n如果需要使用此程序,请添加参数以使用不同功能。\n\n如需帮助,请查看帮助文档:\nhttps://www.zybuluo.com/pandaoxi2022/note/2412946", title)
  75. elif vl[0] == "export":
  76. output(makeImage())
  77. elif vl[0] == "import":
  78. getImage()
  79. else:
  80. msgbox("没有相关的参数定义。\n请参阅帮助文档:\nhttps://www.zybuluo.com/pandaoxi2022/note/2412946", title)
  81. except Exception as e:
  82. msgbox("遇到bug啦!\n%s" % e, title)
  83. exit()
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注