The Special FilesControlling and Customising Movable Python![]() IntroductionSome of the behavior of Movable Python is controlled by a few files in the lib directory. You can configure :
These files all use simple text based formats; they can be edited with any text editor. Some of these can be changed by the GUI, and are probably better not edited by hand. See the individual sections for details. Note The GUI can only save changes if it has write permission in the lib directory. That means you can't save changes if your distribution is on a CD. customize.pyThis Python script is run (run, not imported) before every program is run. This means you can edit it to customise the environment your scripts run in. It is also run before entering interactive mode. (- at the command line, or the interpreter launched from the GUI.) There is a variable called interactive available to you. This is set to True if Movpy is entering an interactive session. You can use this to conditionally do different things when running a script and when using the interactive interpreter. Note Note the spelling of the filename customize.py. Sorry for the inconsistentency in my spelling. syspaths.pthThis file lets you specify directories to add to the module search path (sys.path). If paths are specified as relative locations, they should be relative to the 'lib/' directory in which the path file lives. If you manually add a module into your lib directory that normally has a '.pth' file [1], then you will need to make an entry here. This includes modules like 'wx', 'pyGTK', 'PIL', etc. (Note that win32 has particular complications. Read the instructions at win32ext). Copying the contents of the '.pth' file into syspaths.pth will usually be sufficient. Note Technically .pth files can contain import statements. This isn't supported by Movable Python, and I've never seen it in the wild. config.txtThis file lets you specify some of the command line options as being always on. This lets you easily make movpy always use psyco, or always drop into interactive mode after running scripts. Each option should be on its own line. For example : -p -i See the Command Line page for details of what the options do. Running Movable Python with the -o command line option means that config.txt isn't used. config.txt can be edited by hand, but it is also changed by the GUI. initial_directory.txtThis file stores the directory that the File Chooser dialog opens in. It is changed every time you open a file. Next time you use the dialog it will start in the same directory. initial_directory.txt can be edited by hand, but it is also changed by the GUI. quicklaunch.txtThis file saves the settings of your Quick Launch buttons. quicklaunch.txt is not designed to be edited by hand [2]. ipythonrc.iniThis file is your configuration file for IPython. IPython is very powerful and flexible. See the manual in the 'manuals' directory for details on how to configure and use IPython to its best. Return to Top |
|