I'm sorry to ask such a rookie question, but I notice some people are able to display snippets of python code in questions and answers on GeoNet, just as it might appear Python Win, or other python editing software, and maintaining all its formatting. Is this just a screen shot, a snip, or something else? It looks like other people are able to edit and then repost the code, so I don't think it's a graphic. Thanks!
Solved! Go to Solution.
You can copy and paste the code because it is still just text. However, keep in mind that the editor in GeoNet is a rich text editor so it will try to keep any formatting that was on the original text. So if you copy a small portion of text from a code block with syntax highlighting and paste it into your reply, it will display with the same color and font but might be missing the background that's added when it's actual syntax highlighting. So if you try to copy and paste code like that, it might look weird.
I find it's better to paste it into notepad (or some text editor that strips formatting) and then copy it from there and paste it into GeoNet. Once it's back in the GeoNet editor, you can apply syntax highlighting again and it will look like it should.
Do all your editing in your IDE then...and only then...should you copy it over and format it. Editing it when it is formatted is really bad and frustrating. I find it much easier to highlight the whole block, hit the bigold Delete key, then copy and paste the good stuff back in and reformat. Don't believe me? Do a time trial