After some misunderstandings with WP I decided to move to Blogspot so here the link of my new blog and thx all 🙂
Programme de l’événement ANDROID
Prière d’apporter vos portatifs pour ceux qui veulent participer.
Cet événement peut mener à une certification.
Donc veuillez participer le plus tôt possible.
How to Enable Code Syntax Highlighting for Python in the Nano Text Editor
Code can be written in any old text editor. Even Windows Notepad will do. I am writing this guide for Linux users because everyone who has been in the programming sessions have switched to Arch, or some other form of Linux, and Windows users can just use Notepad++.
You have a choice when it comes to how you want to type code. We can use a simple syntax highlighting editor (like we are preparing to do) or we could use an IDE (Intergrated Development Environment). An IDE has all sorts of features (code completion), but they tend to be bloated.
Today’s I’m going to focus on syntax highlighting. Syntax highlighting is a helpful feature that will color code certain significant words in a given programming language. This makes code easier to read and keep organized. Here is an example of what we are going to make the nano text editor appear as below when it displays Python code.
Requirements
Text in bold is a terminal command.
- Installed copy of nano
sudo pacman -S nano - Linux OS
Create a .nanorc File with Syntax Highlighting Scripts
- In your home directory, we need to create a .nanorc file, because it likely doesn’t exist. If it does, just edit it.
cd ~/ && nano .nanorc - Open another terminal. We are going to use the default Python script for nano.
cat /usr/share/nano/python.nanorc - Paste the contents into your .nanorc file. You can also use this command.
sudo echo $(cat /usr/share/python.nanorc) >> ~/.nanorc - Now, exit your terminal, and open another.
nano test.py - Start typing Python-related commands, like print and you will see them become highlighted. Pretty cool, eh?
<
p>ch33rs 😀
Temporary troubles in my blog
unfortunately i’m having some misunderstandings with WordPress.com staff and i won’t be able to post new articles for a while. 😦