Coding / Programming Language : Python - Tips, Advice & Discussion

What Is Your Level With Python?


  • Total voters
    8
Jul 24, 2012
8,365
8,137
Following on from another thread it seems there's a few people learning or already coding in Python, so the thread is set up as a place to give advice, get tips or even get started and learn the basics of the Python coding language (i.e. me)

Feel free to ask questions and contribute.
 
Reactions: Dazl1212

Jay

May 31, 2012
12,770
1,001,600
Stoke-ish
There was a good course on www.codeacademy.com but it was in python 2. This is almost End of Life/support, so is useful only for legacy code, if you're learning, it's python 3. There's not much difference, just a bit of syntax especially in print() etc.

I have quite a few things and links at home which I'll put up. I'm not close to an expert and haven't really coded anything from scratch, but I've learnt it enough to read/amend most exploits and scripts I use in Penetration Testing
 
Jul 24, 2012
8,365
8,137
I'm starting from scratch so downloaded Python 3.7 from the python website last night for Windows using their web installer.

https://www.python.org/downloads/

No previous coding language experience, used html a bit and got the bare basics of Javascript and that's about it s anything that helps me understand even the fundamentals is of benefit.

Is an open source text editor like Notepad++ useful for this?
https://notepad-plus-plus.org/

@Haggis I remember you were looking to learn a coding language some time back, did you get anywhere with that?
 
Reactions: Dazl1212
Jul 29, 2014
1,842
1,193
UK
Just posted this in the other thread but I personally like Atom for coding python. The interface is clean and It has a nice autocomplete feature.

https://atom.io/

This is a fairly decent book in PDF format that you could use to teach you the ropes if you are just starting out. It is worth following along whilst reading so its handy to have two monitors.

https://github.com/MrAlex6204/Books/blob/master/python-crash-course.pdf

Have you any targets for things you want to program? I think having a few clear objectives will help keep you motivated. One project I am going to work on is making a twitter bot.
 
Reactions: Broxi
Jul 29, 2014
1,842
1,193
UK
I also have available a python programming course from CBT nuggets if anyone is interested I'll upload it somewhere for you guys to download. I find a mixture of reading, watching videos and of course doing the best combination to learn.
 
Jul 24, 2012
8,365
8,137
Notepad++ is decent, but visual studio code https://code.visualstudio.com/ is a much better IDE for python, much more intuitive and features better designed for writing code rather than being a text editor.
I'll give that a go instead, cheers.

I've signed up for the "Introduction to Computer Science" course on CodeAcademy which is Python based, it didn't mention version though.
 

Jay

May 31, 2012
12,770
1,001,600
Stoke-ish
basically the easiest way to tell if it's python2 or python3


print("test") = python3
print "test" = python2

there's other differences but it's the simplest way to check
 
Jul 24, 2012
8,365
8,137
Just posted this in the other thread but I personally like Atom for coding python. The interface is clean and It has a nice autocomplete feature.

https://atom.io/

This is a fairly decent book in PDF format that you could use to teach you the ropes if you are just starting out. It is worth following along whilst reading so its handy to have two monitors.

https://github.com/MrAlex6204/Books/blob/master/python-crash-course.pdf

Have you any targets for things you want to program? I think having a few clear objectives will help keep you motivated. One project I am going to work on is making a twitter bot.
That's a major stumbling point for me, I have no real idea what you can use this for so have no clear idea of what sort of project I want to build. I'm hoping that I may be able to do some automation stuff at work but until I get to the point where I understand what is and isn't possible, I don't really know what I want to do with it.
 

Jay

May 31, 2012
12,770
1,001,600
Stoke-ish
There's not much you can't do with python tbh. It's a scripting language, and you can control websites, windows file management, scrape websites, maths/excel shit, all kinds of stuff.

Automate The Boring Stuff with Python is a popular book which covers stuff like that.
 

Dazl1212

Ripley, strong independent woman who don't no man
May 16, 2013
19,521
5,927
UK
I'd love to get into Pen-testing or more unrealistically AI.
 
Jun 4, 2013
23,468
5,618
Python is used for the bioinformatics program I use. I guess I have some experience. I've never gotten into developing my own script, but I would like to learn, maybe. As someone mentioned, you have to have a specific reason in mind.

@Jay what is an example of using Python for Excel stuff if you don't mind saying? I do use Excel a bit for keeping matrices, but other than that, I don't get much use out of it. If you can use Python to make Excel do some permutation-based statistics or something, that'd be interesting.
 

Jay

May 31, 2012
12,770
1,001,600
Stoke-ish
Well, I'm not an expert or anything of the sort, I've just seen references mostly

https://automatetheboringstuff.com/chapter12/

You can control excel from python, so essentially you can do your normal script - which interacts with software, websites, scraping from websites, and then within the script state exactly how you want it to interact with excel.

Googling for python excel permutation seems to bring up a lot of results.


http://pbpython.com/xlwings-pandas-excel.html
 
Reactions: Mexi-Box