The following gives you a quick overview of steps we'll use to get you from 'what is python' to 'I love the smell of python in the morning'. Kick of with the basics of variables and logics through to loops and hacky fun things.
• 1. What is Python? (why python, environment, file extension, how it works, ...)
• 2. The 'language' - layout, formatting, comments, print statement, command prompt, ...
• 3. Functions and conditional logic
• 4. Loops and recursion
• 5. Libraries (imports)
• 6. Data, array, dictionaries, external files, ..
• 7. Hacky fun things you can do with Python
• 8. Serious projects for the serious developer
So don't worry, you'll be writing viruses and scrapping web pages in no time - you'll be surprised at just how easy and powerful python is.
The Cable Guy (2002). Don't worry, I'll help you get juiced up with python in no time at all!
- I'll juice you up.
- Call it one guy doing another guy a solid.
- That is so nice.
- Well, you're a nice guy. Many customers treat me like snot.
- You'd be surprised how many customers treat me like snot. Like I'm a goddamn plumber or something.
- You're a Python programmer
1. What is Python? (why python, environment, file extension, how it works, ...)
Why Python?
Python is a powerful programming language that uses 'indentation' for conditional statments and functions. It's also an 'interpreted' language (processes the raw python files in real-time - does not need compiling).
Key points
• Open source (and free)
• Easy to learn and very powerful
• Lots of tutorials and resources
• Highly supported in many areas, such as machine learning and AI
• Easy to find a fix online (stackoverflow)
What is the Python File Type? What Editor?
Start with the files, a python file has the extension '.py', and is just a text file. So you can open it in any text editor, like notepad, notepad++, visual studio, vim, ...
Microsoft Word does not work with text files - it works with 'word' files with the extension '.doc' or '.docx' - so it's not a very good choice for editing your python file.
You open your text editor, create a new text file called 'test.py', type a few lines of python code and save your file. Then you can run it using the command prompt:
G:>python test.py
Example: test.py
Run Simple Python in Browser
A cool thing as well, for learning, is you can actually run python 3.0 in a web browser! Here is a library for running python using html script blocks.
There are different versions of python - however, the two main flavours are version 2 and version 3. Version 3 introduces lots of changes, such as, strict unicode (support all languages like Chinese), also there was new libraries introduces (not all libraries will work with all versions of python)
You can find out which version of python you're using either at the command prompt or in code directly
Command prompt, type python --version and press enter
Visitor:
Copyright (c) 2002-2025 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.