简体   繁体   English

通过Visual Basic 2010打开Python文件

[英]Opening Python files via Visual Basic 2010

I'm trying to make a Visual Basic 2010 program that can open a Python file. 我正在尝试制作一个可以打开Python文件的Visual Basic 2010程序。 I've tried doing, 我试过了

Shell("C:\Users\Seth Connell\Desktop\J.A.R.V.I.S\Jarvis.py")

but it returns an Error, "FileNotFound Exception Was Unhandled", but I know the file is at that location. 但返回错误“未处理FileNotFound异常”,但我知道文件位于该位置。 Am I doing something wrong? 难道我做错了什么? Can Visual Basic 2010 open python files? Visual Basic 2010可以打开python文件吗?

I've found a great alternative to Shell(), it's System.Diagnostics.Process.Start(). 我找到了Shell()的绝佳替代品,它是System.Diagnostics.Process.Start()。 It's relatively the same thing. 这是相对相同的事情。

So the solution is, 所以解决方案是

System.Diagnostics.Process.Start("C:\Users\Seth Connell\Desktop\J.A.R.V.I.S\Jarvis.py")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM