我对 pyunpack 有一个奇怪的行为,一个用于解包的包,在一个可执行文件中。
我想做以下事情:
我有一个 .7z 类型的文件,其结尾不是 .7z 而是 .sent。
首先,我尝试以直接方式解压缩它,这会导致捕获到预期的错误。
在此错误捕获中,我首先添加 .7z 扩展名,然后将文件正确解压缩到名为“grog”的文件夹中,然后将压缩文件的原始名称恢复为原来的名称。
这是下面的代码:
# test.py
from os.path import abspath, join, exists, dirname
from os import rename, mkdir
from shutil import copy
import multiprocessing
import pyunpack
multiprocessing.freeze_support()
print(0)
name = "file_to_be_unzipped.sent"
print("a")
path = "C:\\Users\\myname\\eclipse-workspace-tms\\test_unzip_exe"
print(abspath("."))
print("b")
unzip_dest = join(path, "grog")
if not exists(unzip_dest):
mkdir(unzip_dest)
print("c")
name = join(path, name)
print("d")
print("e")
try:
print(1)
pyunpack.Archive(name).extractall(unzip_dest)
print(2)
except pyunpack.PatoolError as pterr:
print(3)
temp_f_name = name + ".7z"
print(4)
rename(name, temp_f_name) …Run Code Online (Sandbox Code Playgroud) 我想在地块之间添加空间,但是当我玩边距游戏时,它会重叠或割伤。这是代码:
library(plotly)
plotList <- function(nplots) {
lapply(seq_len(nplots), function(x) plot_ly())
}
s1 <- subplot(plotList(6), nrows = 2, shareX = TRUE, shareY = TRUE)
s2 <- subplot(plotList(2), shareY = TRUE)
p <- subplot(s1, s2, plot_ly(), nrows = 3, margin = 0.04, heights = c(0.6, 0.3, 0.1))
print(p)
Run Code Online (Sandbox Code Playgroud)
我得到这个:
而我希望这样的东西(用油漆完成的图像)在不同子图之间有更大的间距:
我应该怎么做 ?
plotly ×1
pyinstaller ×1
python ×1
python-3.x ×1
r ×1
r-plotly ×1
spacing ×1
subplot ×1
try-catch ×1
unzip ×1