# Blender Python erase whole Directory content

After a week I made a nice Addon for Blender. For testing I run it with

import bpy
import sys

sys.path.append(scriptdir)

# Test


from Blender. All Package-Files are located in the Folder 'scriptdir'. After I finished i copy all Files to an other Folder (named 'S:\Setup Blender\AddOnes\meshEdit) and install it as Addon 'meshEdit' from Blenders Preferences/Addons.

Everything works fine.

For testing i remove the Addon 'meshEdit'

After this I realize that Blender has removed EVERY Python-File in the Develope-Folder

including ALL 5 backup copies Folders inside.

I thinks the reason for this the Codeline 'sys.path.append(scriptdir)' So is there an other Way to testing an Addon and avoid this behaviour?

And is there a way to recover my work?

• sys.path.append only alters variables in memory, it adds an item to an array. Nothing you have shown alters any files on disk. I expect you moved the wrong folder when you moved meshEdit to your addons folder, if it isn't still there and you have no backups I don't expect you will recover them now. Sep 29, 2016 at 7:23
• Do you need the exec after adding the path to sys you can import MeshEditorv7. Why not just place the file/files in your user addons folder, and reload them using F8. There was a q/a about this recently. Sep 29, 2016 at 9:06
• When working with paths in Python, be very careful with backslashes. Either use forward slashes, escape your backslashes ('aaa\\bbb') or use raw strings r'aaa\bbb' Sep 29, 2016 at 18:09
• I wrote 'MeshEditorv7' and its modules in Pycharm, the only thing that runs in Blender is the 'syspath' and 'exec' commands. I suspect the backslash thing that Sybren describe is the cause. I will try the script/addons folder solution that sambler had suggested, and copy the original files. As a kind of "Claymore-Folder". Python owes its name! Oct 1, 2016 at 12:26

Within the config folder for the current blender version, you can create a scripts/addons folder (which is where blender places scripts when you use the install from file button). Inside this addons folder, create and edit your addon. Your addon will show up in the addon list in preferences where you can enable/disable it after each change.