Startup script not available as a module in console

I’m trying to write a few simple functions to automate some rigging work. From what I’ve read, scripts in “Blender\2.79\scripts\startup” should be automatically imported as modules available to the python API. However, the scripts in the startup folder aren’t accessible from the internal python console. I can import modules manually with no problem and the console will even auto-complete the script name, so I know blender can see and read the files just fine.
I also read up on fancier stuff like defining custom operators, but I feel like that’s overkill for what I’m doing right now. I saw that operators (or any custom class?) need to be “registered” before blender will recognize them though. Is something similar needed with function definitions in user scripts or for the script to show up as a module? Thanks.
I’m on Windows 8 using a Steam installation of Blender if that matters. Also I have “Auto-run scripts” turned on at the moment.

Do scripts run from a text block exist in some different “space” than the internal python console? (Is that what python namespaces are all about?)

It would make sense seeing as the console has the variables D = bpy.data and C = bpy.context defined on startup, but text block scripts don’t. Where are those variables and the console startup text defined? I could add import statements there to make modules available to the console if there isn’t some other obvious way to do it that I’m missing??

This guy seems to have found a way to define custom convenience variables/functions/etc. It involves editing the stock blender scripts though which is… really beyond the scope of what I’m wanting to do here. (Also the inernal console’s convenience vars and stuff are defined in “/modules/console_python.py” apparently.)

Strangely, it seems like it would be less trouble to write a custom operator or addon instead of just running some additional script in the python console automatically on startup. What I’d really like is something similar to launching a python interpreter in interactive mode with a script, but I guess that’s not the intended use in Blender.

I did some tests and scripts in the startup directory aren’t available as modules to either other scripts or to the python console on startup. They have to be manually imported in either case. Since one can manually import modules from either “scripts/modules/” or “scripts/startup/”, what’s really the point of “startup”?

The Blender Python API documentation says that


On startup Blender scans the scripts/startup/ directory for Python modules and imports them.

but to where are these modules actually imported if they aren’t automatically available to other scripts or the python console? Is it simply a poor choice of words in the documentation?

Startup scripts are the least useful since they have limited access to certain types of data. Not everything is fully loaded so no blend-file data manipulation. Interface customization, yes startup scripts have their uses but making a full-fledged addon is a lot cleaner and works generally more as expected. Modules folder gets more usage when dealing with BGE mainloop scripts and such, perhaps also as a place to keep often used scripts for script nodes idk (i only keep a mouselook script in modules just in case)

One final note, or maybe two notes, is that there is no reason to be editing the bundled scripts 99.9% of the time. Way better to set a scripts path in the preferences. prefs -> file section -> ‘scripts’ (a path to a folder which contains folders such as addons/modules/startup/presets/etc)