我正在尝试使用提供的python脚本打开和保存xaml文件, 但是is给了我一个错误如下
import clr
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")
from System.Windows import Window, Application
from System.Windows.Markup import XamlReader
from System.IO import File, Path
class XamlWindow(Window):
def __init__(self, name):
self.load_xaml(name)
def load_xaml(self, name):
xaml_file = File.OpenRead(Path.GetFullPath(name))
self.Content = XamlReader.Load(xaml_file)
Application().Run(XamlWindow("Mail.xaml"))
我没有打开文件,而是出现了以下错误。你知道吗
Traceback (most recent call last):
File "D:\Desktop\UiPathTutorials\Read\Outlook\OutlookMail\OpeningAtext.py", line 2, in <module>
clr.AddReference("PresentationFramework")
System.IO.FileNotFoundException: Unable to find assembly 'PresentationFramework'.
at Python.Runtime.CLRModule.AddReference(String name)
目前没有回答
相关问题 更多 >
编程相关推荐