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.
In general, after execution produces the following:
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.
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
<Window 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> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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()) |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
"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 ). |