Python run folder[package] with & without -m with __main__.py #10.2

Опубликовано: 14 Февраль 2026
на канале: WildestImagination
344
4

Hi All, in this video we will see that how to run a folder as a script or as a module. For this purpose we have 2 options. First is to use -m option and another option is without -m option.

If we execute a folder as a script with -m option in that case Python will search for that folder in global system paths and execute the same.

If we execute a folder as a script without -m option in that case Python will search for that folder in the current working directory from which we are executing the command.