Using Object/Classes in Other File with Python

preview_player
Показать описание
Subscribe!

Equipment:
Рекомендации по теме
Комментарии
Автор

This was all I wanted to know, one simple answer... The internet and many other Youtube videos told me everything but this. thank you.

Tru_lie
Автор

Amazing, I love that you included the troubleshooting as well, made it more realatable and understandable

kilian
Автор

Think you are supposed to create a __init__.py file inside the directory you made.

haloskycrash
Автор

How do i run another class? When i run the file in pycharm it only runs the previous class

water
Автор

Thanks, helped a lot! Solved my problem in the first minute of the video.

cesarmoretti
Автор

For beginners I do see how this video can be confusing. As a tip you should practice without recording, so it be as smooth when you press REC.

RoyalTutorial
Автор

hmmm.... i do not understand the last part.
why need to add that __init__.py file?

ahah
Автор

Not very helpful. In my process of learning Python I am seeking to instantiate an object from a class in its own file and place values inside at the time of instantiation.

walterwilliams
Автор

Great vid. Can you go over that init.py file. I've programmed on things like repl.it and codecademy im trying to understand how projects come together on the computer's system

faithfulservant
Автор

still getting the error : no module named "that particular py file name"
all my py files are in same path

swetapatra
Автор

So basically you create your instances in the main file.

cristif
Автор

for me no help ....i have like a game (main .py and many others class example like classs soldier, class grenade, class enemy1 etc ...) so i try to call them from the main .py file succes so far

MaxStudioCG
Автор

I got it down, thank you very much!

1

myWayIn
Автор

I was writing from <package> import <filename> thanks !

philippebaillargeon
Автор

is it just me or is it weird to program in white background? i mean i cant even look in white background, it hurts the eyes.

pkavenger
Автор

does coding all your code in a single file will make program any slow?

vaibhavpandey
Автор

Makes you ad skippable please. Or you'll lose all your viewers

wb