我有64位Windows。但如果我在Sublime Text插件中使用platform.architecture()[0]
或sublime.arch()
,我会获得32bit
值。
我在ExampleSashaPlugin.py
文件夹中创建了一个文件$packages/TestPlugin
。该文件的内容:
import platform
import sublime
get_bitness = platform.architecture()[0]
print(get_bitness)
get_bitness_2 = sublime.arch()
print(get_bitness_2)
我在没有插件和用户设置的Sublime Text版本中重现了这个问题。
我保存ExampleSashaPlugin.py
。
如果我在Python解释器中获得Windows bitness:
>>> import platform
>>> platform.architecture()[0]
'64bit'
Sublime Text控制台输出:
key evt: control+s
command: save
reloading plugin TestPlugin.ExampleSashaPlugin
32bit
x32
操作系统和版本:
Windows 10企业版LTSB 64位EN
Sublime Text:
为Windows 64位构建3126便携式
感谢。
答案 0 :(得分:1)
作为Keith Hall say,我的64位机器中有32位Sublime Text。我需要使用64位Sublime Text来正确使用platform.architecture()
和sublime.arch()
方法。
我不明白,为什么我有32位Sublime Text。我下载Sublime Text Build 3126 x64.zip
文件 - 64位便携版from official site。也许,在Sublime Text网站上发布了一个不正确的版本,当我下载64位版本时。
如果由于某些原因在64位PC中也有32位Sublime Text版本,则可以使用这些操作解决问题。
将这些文件从新的64位Sublime Text根目录复制到root Sublime Text目录,您将使用:
crash_reporter.exe
,msvcr100.dll
,plugin_host.exe
,python33.dll
,subl.exe
,sublime_text.exe
,update_installer.exe
。实际上是2017年4月。