Python Programming for Biology: Bioinformatics and Beyond



Download 7,75 Mb.
Pdf ko'rish
bet460/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   456   457   458   459   460   461   462   463   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Method

Description

f.close()

Closes a file object so that it is no longer used for reading

or writing. This often happens implicitly when the handle

on the object falls out of scope (e.g. returning from a

function).

f.flush()

Flushes out and writes any cached file data (held in the

file buffer). Note use of os.fsync(fileObj.fileno()) may

additionally be required to force the operating system to

write immediately.

f.fileno()

Gives a number that identifies the particular file object to

low-level operating-system procedures.

f.read(size)

Reads a specified number of bytes from a file object as a

string or (from Python 3) as bytes if in binary mode,



although this may be limited by the end of the file. With

no size argument reads all data from the file.

f.readline(size)

Reads a single line from file, optionally specifying the

maximum

number of bytes to read (thus potentially truncating the

line).

f.readlines(targetSize)



Reads all the lines from a file object. With optional

argument, no more lines are read once total size of lines

read so far exceeds the given number of bytes.

f.seek(offset, code)

Moves the file object’s current read/write position to a

given byte position. Generally more useful for ‘binary’

files than text files. Optional second argument is 0, 1 or 2

to seek relative to the start (default), current position or

file end respectively.

f.tell()


Retrieves the file’s current read/write position.

f.truncate(size)

Truncates the file to the current read/write position, or to

an optionally specified size.

f.write(text)

Writes a specified text string or bytes (if Python 3 binary

mode) to file. Note that the data may not actually be

written to disk until the buffering cache is full.

f.writelines(texts)

Writes an ordered collection of text strings or bytes (if

Python 3 binary mode) to file.


Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   456   457   458   459   460   461   462   463   ...   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