preload some libraries and scripts in python

后端 未结 3 528
悲哀的现实
悲哀的现实 2021-01-18 18:46

How to preload some libraries and scripts in python before I call python command? Is there something like .bashrc file to deal with predefining some functions/variables befo

3条回答
  •  孤独总比滥情好
    2021-01-18 19:11

    How about this:

    python -i -c "import math"
    

    And you can put this into a bash file, like b.sh

    #! /bin/bash
    
    python -i -c "import math"
    

    Then you can set whatever you want.

提交回复
热议问题