Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet55/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   51   52   53   54   55   56   57   58   ...   453
FIgURE 2-12: 
Not indenting at a secondary prompt produces an error.
4.
Repeat Step 2 again. Press Tab. Type 
print SomeText
and press Enter. This time, the entry 
succeeds, as shown in Figure 2-13. Notice that the interpreter has displayed 
...
again so 
that you can continue the block if desired. In fact, the block continues until you end it by 
not indenting an entry.
548592c02.indd 31
2/24/10 12:47:21 PM
www.finebook.ir


32

CHAPTER 2
Understanding the ironPython Basics
FIgURE 2-13: 
A properly indented entry succeeds.
5.
Press Enter. The interpreter displays the word Hello. The interpreter will keep track of a 
block until you finish entering the last line of code. It then evaluates the block and performs 
all of the tasks it contains.
Now that you have the basic idea about indentation, it’s time to consider capitalization. IronPython 
is case sensitive. So, if you type:
If SomeText == ‘Hello’:
and press Enter, the code will fail. Figure 2-14 shows that the error information you receive isn’t 
straightforward. All that the interpreter tells you is that the token it received is unexpected (a token
is a single word that the interpreter parses to discover what you want to do). The interpreter will 
provide more precise information for some errors. Type:
if SomeText == ‘Hello’:
print sometext
and press Enter. This time you get precise error information, as shown in Figure 2-15. The inter-
preter tells you that the error lies in line 2 of the block and that the error occurred because 
SomeText
isn’t defined.
FIgURE 2-14: 
Some error messages are ambiguous.
548592c02.indd 32
2/24/10 12:47:21 PM
www.finebook.ir



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   51   52   53   54   55   56   57   58   ...   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