I can't help you with ubuntu, but in windows I use an interactive Python editor to create and run scripts. File management is something that is basic to your operating system and a matter of organization. I usually keep my "test" scripts in one subdirectory, finished scripts in another, and "packages" in unique subdirectories for each package. IDLE comes with Python. Have you tried it?