Re: I want to lirn pithon but pithon doesn't want me to do so

Imports are explicit. If you import module A in module B, you cannot use module B in module A unless you import it.
As for your previous question, that is what I’m saying to you. Main scripts are designed to be, well, main scripts. They are the ones that import assets and start the show, not the ones that contain the entire logic for the program. What you are trying to do is a kin to creating your game within your main function in the BGT script.  It’s not going to work well.
That being said, you should already know how to do this, at least theoretically. The from statement takes in a variable from module and dumps it into your current name space. For example:
from math import pi
Means that you can just now type pi and access it. I will tell you this, though. If your module  has a call to some function at the bottom of the file, there is a chance, depending on how you import it, that the said function will be called before you are ready to do so.  This is why you should not import things from your main script, but rather  in your main script. You need to attempt to do your best to write the assets outside of the main script, and then use all of them together.
It is going to be hard. Python is more modular than BGT. It specifically prevents you in most cases from just dumping everything into one module.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Meatbag via Audiogames-reflector

Reply via email to