“OSError访问冲突读取0x0000000A”

时间:2015-08-17 12:59:05

标签: python python-3.x server

我的朋友和我喜欢玩Minecraft和Unturned,因此我为我们设置了私人服务器。但是,每次我们想要访问它时,必须搜索我的所有文件才能找到服务器位置,这非常繁琐。我想出了一个项目,意味着创建一个GUI,其上有各种按钮和标签,可以打开不同的服务器文件。您在下面看到的是我目前的单个服务器代码:

from tkinter import*
import ctypes

root = Tk()
root.title("My Servers")
root.geometry("400x400")

def runNotepad():
    ctypes.windll.shell32.ShellExecuteA("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Unturned\\UnturnedServer.exe", None, None, 10)

app = Frame(root)
app.grid()

btna = Button(app, text = 'Notepad', command=runNotepad)
btna.grid()

root.mainloop()

但是当我点击运行时,会出现以下错误消息:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Python34\lib\tkinter\__init__.py", line 1533, in __call__
   return self.func(*args)
  File "E:/Python Programmes/OwainSimple.py", line 11, in runNotepad
   ctypes.windll.shell32.ShellExecuteA("C:\\Program Files (x86)\\Steam\\steamapps\\common\\Unturned\\UnturnedServer.exe", None, None, 10)
OSError: exception: access violation reading 0x0000000A

有人可以告诉我如何修复错误或者通常让程序运行吗?

0 个答案:

没有答案
相关问题