小编Pet*_*e P的帖子

将Python字符串转换为float只会因PyInstaller而失败

我有一个工作正常的程序,但当我把它变成可执行文件时PyInstaller,我有问题.我将其追溯到一个表明问题的奇怪行为.在main(),我发表以下声明:

print float('1e-07')
Run Code Online (Sandbox Code Playgroud)

当我运行我的普通Python脚本时,它'1e-07'按预期打印.

当我运行我的PyInstaller .exe程序时,它会打印出来'ERR'.

有谁知道为什么会这样?

NOTE: This is not some esoteric problem I created. I have a rather large application that frequently converts strings to floats. I found that reading in previously created projects doesn't work anymore and I managed to debug this down to this one effect. I should note that sometimes it converts the numbers properly (in my program) and sometimes not. Everything else runs fine …

python data-conversion pyinstaller

8
推荐指数
1
解决办法
502
查看次数

如何在 git 中拥有当前文件而不是文件历史记录?

我正在开发一个项目,并使用 git 和 GitHub 作为我的存储库(这实际上是一本书,但问题也与代码有关)。通常,就像在软件项目中一样,我只保留源代码,并且每次我都从该源代码构建输出(书籍 PDF)。但由于我正在与某人合作,但他不会构建输出,只查看当前进度,因此我需要定期检查生成的 PDF - 但它很大。

我实际上不需要 PDF 的历史记录(输出),我只需要 git 中的最新版本。有什么办法可以做到这一点吗?换句话说,我不想跟踪历史记录,只是让任何分支的尖端都有实际文件。

在研究这个问题时,我认为唯一的方法是定期从 git 中清除文件的历史记录,然后签入新的 PDF。有更容易的方法吗?

git github

5
推荐指数
1
解决办法
834
查看次数

标签 统计

data-conversion ×1

git ×1

github ×1

pyinstaller ×1

python ×1