Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your <code>.bashrc</code> you can specify the <code>$PYTHONSTARTUP</code> and <code>$PYTHONPATH</code> parameters. I have the following in my own <code>.bashrc</code>:</p> <pre><code>export PYTHONSTARTUP=$HOME/.config/python/pythonrc.py export PYTHONPATH=$PYTHONPATH:$HOME/.config/python/path </code></pre> <p>Note that The <code>.bashrc</code> file is for <code>bash</code> specifically. Other shells may have other files loaded at startup.</p> <p>The <code>$PYTHONSTARTUP</code> script is run every time you start a python console. This is useful if you want to add tab completion for example. For example in the case I specified, whenever you run <code>python</code> from the terminal, the script <code>.config/python/pythonrc.py</code> is executed before the console starts.</p> <p>You can put python packages which should be importable anywhere in the <code>$PYTHONPATH</code> you specified. So basically <code>$PYTHONPATH</code> for python has some similarities to <code>$PATH</code> for <code>bash</code>. Note this is not <code>$PATH</code>. I do not recommend messing with the <code>$PYTHONPATH</code> though. I think it is better to append the paths to <code>sys.path</code> in the <code>$PYTHONSTARTUP</code> script.</p> <p>And then there is the <code>usercustomize</code> module. If there is a module named <code>usercustomize</code> <strong>anywhere</strong> in the path, it will be imported by <strong>all python processes</strong>. For <code>usercustomize</code> to work you do need to make sure that this is in your <code>$PYTHONPATH</code>. For <code>usercustomize</code> you do need to set it in <code>$PYTHONPATH</code>, but you could append more paths in <code>usercustomize.py</code> just like in <code>$PYTHONSTARTUP</code>, so you only need to add 1 more directory to the <code>$PYTHONPATH</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload