Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

save codes in python

Hey guys,

do you know how to save my code in python shell, i mean every time i get into the python shell, my code is gone.. can I save it, because I really don't wanna rewrite the same code every time..

Thanks! Appreciate the help!

2 Answers

The shell is for testing out code. If you want to save a piece of code, you should use a file.

Saving code is precisely what files are for.

And don't worry, Kenneth will show how to run files in a future video.

Thanks for the help!