execution environment in customized applicationsyou can change the prompts by modifying the values of sys ps and sys ps on some systemspython may be compiled to use the gnu readline library if enabledthis library provides command historiescompletionand other additions to python' interactive mode by defaultthe output of commands issued in interactive mode is generated by printing the output of the built-in repr(function on the result this can be changed by setting the variable sys displayhook to function responsible for displaying results here' an example that truncates long resultsdef my_display( ) repr(xif len( print( [: ]+"+ [- ]elseprint(rsys displayhook my_display + range( [ finallyin interactive modeit is useful to know that the result of the last operation is stored in special variable (_this variable can be used to retrieve the result should you need to use it in subsequent operations here' an example the setting of the variable occurs in the displayhook(function shown previously if you redefine displayhook()your replacement function should also set if you want to retain that functionality launching python applications in most casesyou'll want programs to start the interpreter automaticallyrather than first having to start the interpreter manually on unixthis is done by giving the program execute permission and setting the first line of program to something like this#!/usr/bin/env python python code from this point on print "hello worldon windowsdouble-clicking pypywwpypycor pyo file automatically launches the interpreter normallyprograms run in console window unless they're renamed with pyw suffix (in which case the program runs silentlyif it' necessary to supply options to the interpreterpython can also be started from bat file for examplethis bat file simply runs python on script and passes any options supplied on the command prompt along to the interpreter:foo bat :runs foo py script and passes supplied command line options along (if anyc:\python \python exe :\pythonscripts\foo py % lib fl ff