Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet132/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   128   129   130   131   132   133   134   135   ...   453
114

CHAPTER 6
Using the Python standard Library
The IDLE debugger has no concept of breakpoints. You have no immediate window for entering 
commands or watch windows to track expressions. Even so, the debugger does work well, even if it 
does take a while for the .NET developer to get used to it.
Looking for standard Library Issues
It’s important to exercise care when working with the Standard Library. Sometimes, it appears that 
IronPython provides support for a feature when it really doesn’t. For example, Listing 6-1 shows 
an application that runs fine within IDLE because IDLE relies on the Python interpreter, not the 
IronPython interpreter.
LIsTIng 6-1: 
 An example of a Standard Library application
from Tkinter import *
import aboutDialog
# Represents the main window of an application.
root = Tk()
class TestIDLE:
“Defines a basic test of IDLE”
def ShowAbout(self):
“Display the IDLE About dialog box”
aboutDialog.AboutDialog(root, ‘About’)
# Make sure you destroy the window when you get done with it.
root.destroy()
def SayHello():
“A very basic function in Python”
print ‘Hello’
# Set the path to include the application directory.
import sys 
sys.path.append(‘C:\\0255 - Source Code\\Chapter06’)
print sys.path
# Call SayHello()
SayHello()
# Display the IDLE About dialog box.
MyAbout = TestIDLE()
MyAbout.ShowAbout()
This is an interesting example because it displays the IDLE About dialog box. When you run this 
example, the code begins by doing something simple — it modifies the path to point to the example 
directory and then it displays a simple hello message to the user.
548592c06.indd 114
2/24/10 12:47:55 PM
www.finebook.ir



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   128   129   130   131   132   133   134   135   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish