Save and reload a series of commands into Python shell -


i using command prompt in windows 8 perform analytical tasks python.

i'm using few external libraries, .py files functions need, , set commands (like setting variables based on databases need load).

in there 20 statements. problem is, each time want work on it, have manually enter (copy/paste) of these commands shell, adds few minutes each time.

is there way can save of these commands somewhere , automatically load them prompt when needed?

yes,

save commands in file in home directory. set pystartup environment variable point file. every time start python interpreter run commands startup file

here link example of such file , more detailed explanation

if need have different start files different projects. make set of shell scripts 1 per project. scripts should this:

#!/bin/bash export pythonstartup=~/proj1settings.py python 

and on. or can change value of pythonstartup variable before start working on particular project. personally, use macos iterm2, set-up multiple profiles different projects. when need work on particular project launch tab profile configured project.


Comments

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -