Oct-23-2019, 09:26 AM
Hello.
The forum is new. In Python, I’m taking the very first steps))
I looked at the lesson, installed Virtual Studio, created the IronPython project
In general, such a code turned out.
The forum is new. In Python, I’m taking the very first steps))
I looked at the lesson, installed Virtual Studio, created the IronPython project
In general, such a code turned out.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="WpfApplication1" Height="300" Width="300"> <Grid> <TextBox x:Name="a" HorizontalAlignment="Left" Height="22" Margin="33,70,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="58" TextChanged="TextBox_TextChanged"/> <TextBox x:Name="b" HorizontalAlignment="Left" Height="22" Margin="197,70,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="58"/> <Label Content="+" HorizontalAlignment="Left" Margin="132,70,0,0" VerticalAlignment="Top"/> <Label x:Name="labelresult" Content="" HorizontalAlignment="Left" Margin="122,142,0,0" VerticalAlignment="Top"/> <Button Content="Sum" HorizontalAlignment="Left" Margin="104,106,0,0" VerticalAlignment="Top" Width="76" Click="Button_Click"/> </Grid> </Window>
import wpf from System.Windows import Application, Window class MyWindow(Window): def __init__(self): wpf.LoadComponent(self, 'WpfApplication1.xaml') def Button_Click(self, sender, e): аss = float(self.a.text) bs = float(self.b.text) result = ass + bs self.labelresult.Content = str(result) if __name__ == '__main__': Application().Run(MyWindow())In general, after execution produces the following:
"ipyw32.exe" (CLR v4.0.30319: DefaultDomain). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_32 \ mscorlib \ v4.0_4.0.0.0__b77a5c561934e089 \ mscorlib.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: DefaultDomain). Uploaded "C: \ Program Files \ IronPython 2.7 \ ipyw32.exe". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ Microsoft.Dynamic \ v4.0_1.2.2.0__7f709c5b713576e1 \ Microsoft.Dynamic.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Core \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Core.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System \ v4.0_4.0.0.0__b77a5c561934e089 \ System.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ Microsoft.Scripting \ v4.0_1.2.2.0__7f709c5b713576e1 \ Microsoft.Scripting.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Configuration \ v4.0_4.0.0.0__b03f5f7f11d50a3a \ System.Configuration.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Xml \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Xml.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ IronPython \ v4.0_2.7.9.0__7f709c5b713576e1 \ IronPython.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ IronPython.Modules \ v4.0_2.7.9.0__7f709c5b713576e1 \ IronPython.Modules.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ System.Numerics \ v4.0_4.0.0.0__b77a5c561934e089 \ System.Numerics.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Program Files \ IronPython 2.7 \ DLLs \ IronPython.SQLite.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Program Files \ IronPython 2.7 \ DLLs \ IronPython.Wpf.dll". Character loading skipped. The module is optimized, the debugger option "Only my code" is enabled. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded "C: \ Windows \ Microsoft.Net \ assembly \ GAC_MSIL \ mscorlib.resources \ v4.0_4.0.0.0_en_b77a5c561934e089 \ mscorlib.resources.dll". Module assembly completed without characters. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded by Anonymously Hosted DynamicMethods Assembly. "ipyw32.exe" (CLR v4.0.30319: ipyw32.exe). Uploaded by "Snippets.scripting". The program "[9652] ipyw32.exe" exited with code 1 (0x1).I don’t understand why the program does not start as in the example at the end of the video. If anyone can help, I will be grateful.