[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 here This program executes and
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 11
Thread images: 4
File: python stuff.png (6 KB, 620x164) Image search: [Google]
python stuff.png
6 KB, 620x164
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 (166 KB, 1102x620) Image search: [Google]
retard.png
166 KB, 1102x620
>>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 (23 KB, 128x128) Image search: [Google]
zeal.png
23 KB, 128x128
>>55214589
Zeal
Thread replies: 11
Thread images: 4

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.