with open(pdf,'rb') as fin:
reader = PyPDF2.PdfFileReader(fin)
new_pdf = PyPDF2.PdfFileWriter()
for i in range(reader.numPages):
new_pdf.addPage(reader.getPage(i))
out_file
这是一个简单的时钟应用程序的JS。 在JS中,'with'语句不再使用。 我想帮助理解如何保留功能,同时删除'with'语句的使用。谢谢。 function moveHands() {
with (new Date()) {
h = 30 * (getHours() % 12 + getMinutes()/60); // 30 degrees for each hour