我正在尝试重新设计我的多人在线游戏的启动器,以包含一些安全性。我想在没有临时文件或Process.Start()
的情况下运行python。我正在使用python的批处理包装器执行它,如下所示:
Dim sb3 As New System.Text.StringBuilder
sb3.AppendLine("@echo off&cd C:/ToontownRebuilt/src/dependencies &""panda/python/ppython.exe"" -x %0 %* &goto :eof")
sb3.AppendLine("# -*- coding: UTF-8 -*-")
sb3.AppendLine("import(sys)")
sb3.AppendLine("reload(sys) # Reload does the trick!")
sb3.AppendLine("sys.setdefaultencoding('UTF-8')")
sb3.AppendLine("sys.path.append('/')")
sb3.AppendLine("from pandac.PandaModules import *")
sb3.AppendLine("import rebuilt")
sb3.AppendLine("from toontown.toonbase import ClientStartDist")
Dim secretsus As String
secretsus = sb3.ToString()
Environment.SetEnvironmentVariable("TTRB_GAMESERVER", "toontownrebuilt.dynu.com")
Environment.SetEnvironmentVariable("TTRB_PLAYCOOKIE", username)
Environment.SetEnvironmentVariable("ttrbUsername", username)
Dim oShell As Object = CreateObject("WScript.Shell")
oShell.run("cmd /K " & vbCrLf & secretsus)
oShell = Nothing
但是返回:
panda/python/ppython.exe: can't open file '%0': [Errno 2] No such file or directory
还有其他办法吗?
任何&所有的帮助表示赞赏。谢谢:))
答案 0 :(得分:0)
通过使python脚本成为一个衬里并使用python -c "code here (quotes included)"
运行它,我能够做到这一点。