Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet466/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   462   463   464   465   466   467   468   469   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Method (os.)

Description

chdir(path)

Changes the current working directory; for specifying

relative file-system paths.

getenv(varname,

default)

Gets an environment variable of a given name, with optional

default value if it doesn’t exist.

putenv(varname,

value)

Sets an environment variable of a given name, with a given



value.

uname()


In Python 2 gives a tuple containing five items detailing the

current operating-system type. In Python 3 gives a

uname_result object, representing the same kind of

information.

unsetenv(varname)

Deletes a named environment variable.

tmpfile()

Creates an unnamed, temporary file object with mode ‘w+b’

(write binary) which only exists for the current session.

access(path, mode)

Gets status information for a file-system path, using a

specified mode to check if the path exists, is readable,

writeable or executable.

chdir(path)

Changes the current working directory (for relative paths) to

the specified path.

getcwd()

Retrieves a path string representing the current working

directory; for relative paths.



chmod(path,

mode)


Changes read, write and execution permissions for a given

path. Equivalent to UNIX ‘chmod’.

chown(path, uid,

gid)


Changes the user and group ownership or a given path.

Equivalent to UNIX ‘chown’. Note this can be used on

Windows systems but only sets the read-only status.

link(target,

linkName)

Creates a (hard) file link connecting a stated source/target

path with a specified name.

listdir(path)

Creates a list of file and directory names for a specified file-

system path.

mkdir(path, mode)

Creates a new, empty directory with a specified file-system

path. Optional argument to specify the file access mode.

makedirs(path,



mode)

Recursively creates a new, empty directory with a stated

path, including any intervening directories if they do not

exist. Optional argument to specify the file access mode.

remove(path)

Deletes a file of specified path. Gives an OSError if the path

is a directory (use rmdir() for deleting directories).

removedirs(path)

Recursively removes a directory, if empty, and then parent

directories that are empty. Gives an OSError if the directory

is not empty.

rename(old, new)

Change the name of a file or directory.

rmdir(path)

Removes a specified directory path from a file system, if it

is empty, otherwise it gives an OSError.

stat(path)

Generates a status object that has attributes detailing

information about a given path, including access

permissions, device, owner, group, file size, access time,

modification time etc.

symlink(target,

linkName)

Creates a symbolic (soft) link to a given path.

unlink(path)

Same as os.remove().

walk(top,

topDown, onError,

followLinks)

Creates a generator that yields (parentPath, dirNames,

fileNames) tuples that recursively walk through a directory

and any sub-directories.




system(command)

Issues a command to the operating system as if it were from

a command line prompt. It is recommended to use

subprocess.call() instead.




Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   462   463   464   465   466   467   468   469   ...   514




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