I am currently learning to use PyQGIS, when loading a shapefile I get a warning message "The SRC is not defined", but I do not know what to do to prevent that message from appearing.
If you want the message gone when you load your layer, you could use:
Also, if you go to
Settings > Options > CRS > CRS for new layers, you could choose which CRS to use for new layers or those without a CRS. This should also avoid the pop-up message from appearing.
Finally, it could save you some hassle if you ensure that your shapefile contains a .prj file associated with it.