1

I want to use Notepadd++ for taking notes on python programming language. I want to write some normal sentences and also write codes on same page simultaneously. I don't want to show line numbers for the normal texts but I want to show line numbers for programming codes. Is this possible? I mean normal lines should be without syntax highlighting and line numbers which usually show on left hand side of each line. And syntax highlighting for the codes written in the same file? For example...

To print strings in Python we should use single or double quotations after print keyword. For example...

1 print "Hello World!" # (this line should be with line number and syntax highlighting)

migrated from programmers.stackexchange.com Sep 3 '14 at 18:03

This question came from our site for professionals, academics, and students working within the systems development life cycle.

  • This sounds like a job for Markdown (but then you would have to render to view results, and manually enter line numbers). Or maybe an IPython notebook. You don't want to use comments for the non-code stuff? – beroe Sep 3 '14 at 18:22
  • @beroe Yes I just want to take notes(Markdown) while learning Python. Hash(#) will make the note ugly specially if there is any way left then I would not bother to try # before trying this. – Hellboy Sep 3 '14 at 18:38
1

You can't (as far as I know) say to notepad++ to no count some lines. But if you don't mind use a dirty trick you could exploit the fact too longs line are displayed visualy on multiples lines. So adding a lot of white spaces allow you to pop new non numbered visual lines.

For the color problem you can simply create your own syntax highlightning language rule(these are configuration file). Duplicate the python one, and go check the rule wich apply to comments. You can make a modified version of this one to create an other form of comments (care this is only visual, you will no be able to execute this file anymore).

If I may suggest it's probably better to either use a markdown/Latex editor wich have a tag to show code and syntax hightlightning (and can number code-only lines and no others) or to simply go with comments in classic code files. (even if on your case a custom hightlightning rule for alternative comments, colored differently, and if you're motivated you could "hide" the line begining tag with a color clode to the background one.

  • I need 15 reputation to give an up vote to you but I really appreciate your suggestions. I have decided to use MS Word instead of Notepad++ as I have found a way which allows me to copy paste Python codes into MS Word file from Notepad++ with syntax highlighting. But do you know about any editor which will allow me to include code blocks with syntax highlighting as you said? – Hellboy Sep 5 '14 at 8:38
  • Because I have it in my bookmarks Dillinger. You could search many other to choose your by looking for "online markdown editor on a search engine" I even remember ones in javascript which could be used as simple html file and so offline. Generaly speaking there are dozen of syntax highlighting plugins for either markdown and Latex (latex may be a bit less colorfull since often bases themes are made to be printed on paper) – GaelFG Sep 5 '14 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.