For example, if a python script will spit out a string giving the path of a newly written file that I\'m going to edit immediately after running the script, it would be very
This is not really a Python question but a shell question. You already can send the output of a Python script (or any command) to the clipboard instead of standard out, by piping the output of the Python script into the xclip command.
myscript.py | xclip
If xclip is not already installed on your system (it isn't by default), this is how you get it:
sudo apt-get install xclip
If you wanted to do it directly from your Python script I guess you could shell out and run the xclip command using os.system() which is simple but deprecated. There are a number of ways to do this (see the subprocess module for the current official way). The command you'd want to execute is something like:
echo -n /path/goes/here | xclip
Bonus: Under Mac OS X, you can do the same thing by piping into pbcopy.