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!
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

erik Jones Oniga
3,307 Pointssave 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

Alexander Davison
65,469 PointsThe 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.

erik Jones Oniga
3,307 PointsThanks for the help!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsAnd don't worry, Kenneth will show how to run files in a future video.