Professional IronPython


Modifying the site.py File



Download 20,35 Mb.
Pdf ko'rish
bet125/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   121   122   123   124   125   126   127   128   ...   453
Modifying the site.py File
It’s less convenient to modify the 
Site.py
file than it is to use the other two techniques, but you’re 
also sure that every application will see the path addition when you modify 
Site.py
. Of course, 
if you reinstall IronPython, it will overwrite your 
Site.py
, and you’ll need to remember to make 
the change again. As previously mentioned, the 
Site.py
file is located in the 
\Program Files\
IronPython 2.6\Lib
directory of your machine. Open this file with your editor and add the fol-
lowing code to the top of the file:
import sys
sys.path.append(‘C:\Python26\Lib’)
Make sure you change 
C:\Python26\Lib
to match the location of the Standard Library on your 
machine. This example uses the default location. After you save the file, restart the interpreter and 
you should see the path added to the 
sys.path
attribute.
548592c06.indd 103
2/24/10 12:47:52 PM
www.finebook.ir


104

CHAPTER 6
Using the Python standard Library
An interesting side effect of using the 
Site.py
file is that the Standard Library path will appear 
before the IronPython paths, which means that the Python Standard Library receives preferential 
treatment. Remember that you can always tell the interpreter not to load the 
Site.py
file by using 
the –S command line switch (see the section “Understanding the IPY.EXE Command Line Syntax” 
in Chapter 1 for details).
usIng THE sTAndARd LIbRARy FEATuREs
The Standard Library provides a lot of features that you don’t get with IronPython. Many of these 
features you can use while developing IronPython applications. The following sections describe how 
to use each of the features. In addition, you’ll see how to use the Standard Library to create an appli-
cation. Before you use this section, you must install the Python Standard Library and determine 
how you plan to access it from IronPython. Because the Python command line console is essentially 
the same as the IronPython command line console, you won’t find it in the sections that follow.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   121   122   123   124   125   126   127   128   ...   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