The program is supposed to take user input, turn it into html and pass it into the clipboard.
Start the program with welcome_msg()
If you enter 1 in the main menu, it takes you through building an anchor tag. You’ll add the link text, the url, then the title. After you enter the title, I get the following errors:
File '<pyshell#23>', line 1, in <module> welcome_msg() File 'C:\Python26\html_hax.py', line 24, in welcome_msg anchor() File 'C:\Python26\html_hax.py', line 71, in anchor copy_to_clipboard(anchor_output) File 'C:\Python26\html_hax.py', line 45, in copy_to_clipboard wc.SetClipboardData(win32con.CF_TEXT, msg) error: (0, 'SetClipboardData', 'No error message is available')
Here’s the Code: http://pastie.org/398163
What is causing the errors above?
In your
make_linkfunction you construct alink_output, but you don’t actually return it as the functions result. Usereturnto do this:This way you get the value passed to your
anchor_outputvariable here:This was
Nonebecause the function didn’t return any value, and setting the clipboard toNonefailed. With the function returning a real string it should work as expected.