Running code without saving

738 views
Skip to first unread message

Peter Watson

unread,
Mar 14, 2017, 9:54:42 AM3/14/17
to spyder
Hello,

Sometimes I want to just write out a few lines of code and execute them, without saving them to a file. Spyder insists that I save before running the file - would it be possible to let it run what's in the editor without saving i.e. do the equivalent of selecting all the lines in a file and running the selection?

Carlos Córdoba

unread,
Mar 14, 2017, 10:18:32 AM3/14/17
to spyd...@googlegroups.com

Hi,

You can deactivate this behavior by going to

Preferences > Editor > Advanced settings > Run

and turning off this option

Save all files before running script

Cheers,
Carlos

El 14/03/17 a las 06:07, Peter Watson escribió:

Hello,

Sometimes I want to just write out a few lines of code and execute them, without saving them to a file. Spyder insists that I save before running the file - would it be possible to let it run what's in the editor without saving i.e. do the equivalent of selecting all the lines in a file and running the selection?
--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at https://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Peter Watson

unread,
Mar 14, 2017, 10:35:44 AM3/14/17
to spyder
Ah, thanks, sorry for not spotting that option.

Cheers,

Peter

Peter Watson

unread,
Mar 14, 2017, 10:35:44 AM3/14/17
to spyder
I should not have been so quick to post that reply - I just tried it, but I still cannot run code without saving it first. This is also the case in scripts that have been loaded from a file, then modified in the editor without saving.

Cheers,

Peter

On Tuesday, March 14, 2017 at 2:18:32 PM UTC, Carlos Córdoba wrote:

Carlos Córdoba

unread,
Mar 14, 2017, 11:26:09 AM3/14/17
to spyd...@googlegroups.com
Sorry, I forgot that to run a file with F5, Spyder needs to load the content of a file. So if you don't save it, it can't do that.

If you want to run something without saving it, you can use cells instead.


Cheers,
Carlos

El 14/03/17 a las 09:33, Peter Watson escribió:

Peter Watson

unread,
Mar 14, 2017, 2:51:34 PM3/14/17
to spyder
Thanks. Does the content of unsaved scripts not exist somewhere on the disk, so that spyder could load it as a file? I don't know much about these things, so I can't really offer help with this, but I think it would be a useful change if it were possible...

Cheers,

Peter

Carlos Córdoba

unread,
Mar 14, 2017, 2:53:15 PM3/14/17
to spyd...@googlegroups.com
We would to implement backup files for this to work. Some people is asking for this feature already, but there are so many things to do first :-)


Cheers,
Carlos

El 14/03/17 a las 11:22, Peter Watson escribió:
Reply all
Reply to author
Forward
0 new messages