[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

babby learning his first python hereThis program executes and spits out the text


Thread replies: 11
Thread images: 4

File: python stuff.png (6KB, 620x164px) Image search: [Google] [Yandex] [Bing]
python stuff.png
6KB, 620x164px
babby learning his first python here

This program executes and spits out the text of the file just fine.
But where does the "read()" come from here? I understand that "open" is a built-in python function, but I can't find anything about "read()" anywhere in the documentation
>>
lmao
>>
Open returns a file stream object. Read() is a method of that object
>>
>>55214461
read() is a method defined for file objects, which open() yields.
>>
>>55214512
>>55214498
what's the difference between a method and a function
>>
>>55214525
literally your exact question yields an answer to that.
>>
>>55214545
is an object identical to an instance of a class?
>>
File: retard.png (166KB, 1102x620px) Image search: [Google] [Yandex] [Bing]
retard.png
166KB, 1102x620px
>>55214461
>I can't find anything about "read()" anywhere in the documentation

You need to kill yourself.
>>
>>55214571
What software is that?
>>
>>55214558
an object is an instantiation of a class, if that's what you mean.

"Identical" is a relatively carefully used term, so I would avoid using it to describe things unless you mean it (for example, do you mean value equality (like where 2 objects have the same information), or do you mean two variables point to the same point in memory?)

Anyway, if I understand your question correctly, yes.
>>
File: zeal.png (23KB, 128x128px) Image search: [Google] [Yandex] [Bing]
zeal.png
23KB, 128x128px
>>55214589
Zeal
Thread replies: 11
Thread images: 4
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK