Solved

How can I copy from an html file to the clipboard in Python in formatted text?

Posted on 2013-06-26
1
502 Views
Last Modified: 2013-06-26
I'm writting a Word document and I'd like to paste a formatted code-snippets directly from clipboard.

At this moment I am able to write these snippets into an .html file to the harddisk. My goal is to extend my Python script and load this .html file on the clipboard in "formatted text" to directly paste at Microsoft Word.

Does anyone knows any way to do this in Python?

Thanks in advance.

Sherab
0
Comment
Question by:ShaddyKo
1 Comment
 

Accepted Solution

by:
ShaddyKo earned 0 total points
Comment Utility
Well, I've found a solution for this.

http://code.activestate.com/recipes/474121-getting-html-from-the-windows-clipboard/

It's work pretty well... if anyone wants more information about the clipboard just take a look here:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms649013(v=vs.85).aspx

Download de pywin32 module and with win32clipboard you can do everything.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Plenty of writing has gone on the web trying to compare Python with other competitive programming languages and vice versa. However, not much has been put into a wholistic perspective. This article should help you decide whether to adopt Python as a…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now