LINUX LITE 7.2 FINAL RELEASED - SEE RELEASE ANNOUNCEMENTS SECTION FOR DETAILS


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginning with Python
#21
I will save your instructions until I get used to doing this. Smile

I have tried to install a theme "monokai-exteded" by adding it to this folder using copy/paste
/usr/share/gtksourceview-3.0/styles/

When I right click inside the folder the menu option for paste is greyed out, how do I change this so I can add the theme ?
Will the theme still work if I change its filename before moving it has missing n.
Reply
#22
Hi bitsnpcs,

If you have a look at the ownership and permissions of the folder you want to write to, you'll see it's owned by root (the Linux name for the administrator) and only root has write permission. Therefore the menu option for paste is greyed out for any other user.

If you would like to copy/move the files there with your file manager, right click on the folder and choose "Open as Administrator".

Via command line:
Code:
sudo cp -va monokai-exteded /usr/share/gtksourceview-3.0/styles/
assuming you run this command within the folder monokai-exteded is located in. Otherwise you need to hand over the path.

Hope that helps Smile
Reply
#23
Hello LL-user,
Thank you  Smile

At the base of Gedit it has a menu, by default it reads "Plain text", are these colours a guideline set for the chosen input, or are they specific to the one chosen, eg; I want to use the colours for CSS setting on this theme for Python.
Reply
#24
You're welcome Smile

Regarding gedit (I'm also using more and more instead of leafpad), sorry I don't get your question.
Here is some general info in the hope it provides you some answer. Otherwise let us know Smile

[1] Syntax highlighting

gedit provides syntax highlighting for a wide range of markup, programming, and scientific languages. If gedit recognizes the syntax being used when you open a file, it will automatically highlight the text.

If your syntax or language is not highlighted upon startup, you can select the appropriate syntax or language by clicking View ▸ Highlight Mode, and then choosing the desired syntax. Alternately, you can select the syntax name from a list at the bottom of the gedit window.

[2] How do I add a syntax highlighter format to Gedit?

[3] Create a custom syntax highlight in gedit

Hope that helps Smile
Reply
#25
Yes, it helps thank you  Smile
Reply
#26
I noticed in July 2017 the follow on book called - "Learn More Python the Hard Way - Zed Shaw" comes out, it is now available on Amazon pre-order, with a small discount of the price.


Reply
#27
Hello,

for those using the book "Learn Python the Hard Way" I have found an error in the book.

Page 253 - Exercise 5 - Command Line Crash Course

Line 30 reads

cd ../../ ..

It needs to read

cd ../ ../ ../

I had tried the exercise 3 or 4 times and got an error in the terminal each time, eventually I cd back to home and began further on in the exercise, and where the cd ../ is used later to move up 7 levels with no error, after completing the exercise I then tried the line 30 adding the final / like is in the later part of the exercise, this command then didn't give an error.
I redone the entire exercise with that added to line 30 and there were no errors produced in the terminal.

So I think he has made a mistake, that you will need to add in the book a / to the end of line 30 to complete the exercise.

I am using the Third Edition.

If you found any errors when using the book, or find any errors as you work through the book please can you also add them in the thread to help each other.
Reply
#28
I finished these 15 exercise now, other than the self learning in exercise 15 which I will use The Linux Command Line book for, 3 are covered in Chapter 9 and the first is covered in Chapter 17, being only on Chapter 4 its a long way off for me.

I didn't find any other errors as such.
But... exercise 13 -
he says to create a test2.txt then cat it, he does not say to type that contents in to the file so it will produce zero results, and will waste your time.
Better to cat test.txt to see the lines from previous exercise, he writes after exercise 13 in the "You learned this", also to cat test.txt and see the output from last exercise, it was the only way I managed to understand wtf he was on about.
Hopefully it will save someone not to waste their time also on exercise 13, and to read after the exercise ,what you have learned, before learning it, then you will actually be able to learn it etc.

The printed url for the Bash Cheat Sheet under title Unix Bash References is incorrect it has cli at the start of the url and this goes to the sales page not the free pdf.
This is the correct url


I am hoping the Python chapters are of a better quality.

Update -
They are.
I have completed the Python exercise 0, 1, 2, and began 3, (before my available time ran out), his style of writing in the Python Chapters is very different to the command line course. It's extremely easy to follow and learn from. 8) (even for me)
Reply
#29
I noticed a lot of people (and me too) have trouble with this one initially, so I decided to add it here to save people time so they can understand it sooner and continue the learning rather than get hung up on more advanced details if searching about it.

% - Modulus explained -

100-25*3%4
answer 97

Why -
25*3%4
25*3=75
75%4
answer 3

How it works -
75 divided into 4= 18 times
18x4=72
75-72= r3
%=3

Actual calculation at the final stage is -
100-3
so it is why the answer was 97


First of the ex3 explained

3+2+1-5+4%2-1/4+6

3+2+1=6
6-5=1
4%2=0  (4 divided into 2=2, zero remains, modulus %=0)
1+0=1
1/4=0 (1 cannot divide into 4 using whole numbers)
1-0=1
1+6=7
so it is why the answer was 7

I used Python calculating to work it out.
Just open python in terminal then trial error the various breakdowns until I understood what was happening.
Which was part of the #2 extra practices, so it also means can multi-task and 2 things at same time, if trying this.

I hope it helps someone else learning if they get stuck on modulus.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)