When looking at my code in the python file, it is lovely and colourful, however these colours do not carry over when putting it into a word document (microsoft). Is there anyway to do this without screenshots or do I have to suffer.
Asked
Active
Viewed 244 times
0
-
Look up the Code Format Add in for Word. – pask Mar 29 '18 at 21:37
-
Code in a file is bits, which have no color. The color is coming from your IDE or editor. Loading the source into Word does not have any way to determine the colors since the IDE is not involved. Try copy/paste. – stark Mar 29 '18 at 21:37
-
If copying and pasting from your IDE doesn't work, you could always [use Notepad++](https://superuser.com/questions/578054/how-can-i-copy-text-with-syntax-highlighting-from-notepad) to preserve syntax highlighting. – Mar 29 '18 at 21:40
-
Here is a link to a similar question. Hope this helps: https://stackoverflow.com/questions/387453/how-do-you-display-code-snippets-in-ms-word-preserving-format-and-syntax-highlig – user2731223 Mar 29 '18 at 21:45
-
See http://pygments.org/docs/cmdline/. After making it into html I think copy paste will do. – progmatico Mar 29 '18 at 21:48