If you're talking about the .py files that show up in the lastException logs -- those are the .ts4scripts being decompressed in the virtual machine that are only applicable to the TS4 instance. You'll see some funky path like "In file: T:\<something>\scheduler.py" -- those paths don't really exist outside of the TS4 client.
Most of the time, you can kind of figure out which mod is throwing the error by looking at the '<something>' portion of the path ... that will generally lead you to which .ts4script (and associated .package files) in your Mods folder that you'll want to delete, replace/update, or ignore depending on the severity of the error.
Please note:
Those .py & .pyc files aren't something that you will manually track down and do anything with. You should only concern yourself with the associated .package and .ts4script files of the custom content/gameplay addons in the Mods folder.
So, fair warning about deleting the Tray folder -- this is where all your gallery stuff is locally stored. So things like all your households, lots, rooms, etc ... even the ones you downloaded from other people's share. If you delete that, they will be removed from your game ... and for your households, that can be a permanent change.
I was fine with that decision ... as I was looking for an absolutely clean installation. You may have families that you aren't willing to give up on yet, so keep that in mind with the Tray folder.
As far as deleting the Saves and/or Tray folder--you should only need to do it once. Let the game regenerate the necessary files and folders and don't touch them unless you've found definitive proof that your saves are corrupted beyond redemption.
For my templating thing, this is the process I go through ... you can change it up as you see fit. The important part is the goal: Create a Saved Instance that you will use as a base for future games. Meaning, set everything you can once and don't overwrite this file by immediately using the 'Save As' function as soon as you load it up with a new sim.
Here's what I do:
- Start new game.
- Move in a throwaway sim from my gallery to someplace.
- Start game with sim to configure WW, WP, and BD.
- Save the game using the Save As function.
- Go to Manage Worlds.
- Set up the various lots in different neighborhoods for:
- Go To School
- Get To College
- TurboCareers
- AEP Photoshoot Event
- Save template.
- Add residential and other community lots for flavor.
- Remove Sim from world.
- Save template.
- Exit to main menu.
- Load Game with Template world.
- Move-In or Create a Sim and Move In.
- Save Game As a different world.
Note: It's really easy to forget that last step and ruin about three to four hours of getting everything just right. If you're lucky and caught your mistake early, you can save the current game as a different file and then attempt to recover the original save on your Template from the Load Game interface.