| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Tasks for colleges to learn python
Edit your code in editor like PyCharm (Community edition) or IntelliJ Idea (Community edition) because of context documentation and code completion.
Code completion. Shortcut ctrl + space.
source: https://realpython.com/python-ides-code-editors-guide/
Context documentation. Shortcut ctrl + q.
source: https://realpython.com/python-ides-code-editors-guide/
Use git to backup and share your project with others. Atlassian company has awesome git explanation: https://www.atlassian.com/git
It's important to orient in reading python exceptions. See this example
/home/develop/learning-python/venv/bin/python /home/develop/learning-python/test.py
Traceback (most recent call last):
File "/usr/lib/python3.5/xml/etree/ElementPath.py", line 263, in iterfind
selector = _cache[cache_key]
KeyError: ('//record/surname', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/develop/learning-python/test.py", line 4, in <module>
filtered = root.findall('//record/surname')
File "/usr/lib/python3.5/xml/etree/ElementPath.py", line 304, in findall
return list(iterfind(elem, path, namespaces))
File "/usr/lib/python3.5/xml/etree/ElementPath.py", line 268, in iterfind
raise SyntaxError("cannot use absolute path on element")
SyntaxError: cannot use absolute path on element
Key information is:
virtualenv is a tool to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need.
Links:
Commands:
TODO
pip is the package installer for Python.
Links:
Commands:
TODO
The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain
There is pretty nice introduction on youtube:
Pandas is a library for data manipulation and analysis. In particular, it offers data structures and operations for manipulating numerical tables and time series.
Video of 10-minute tour of pandas
NumPy is a library adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
Your first task is to create a hello word script in python. So your script has to print "hello word".
Hints:
Read file ./files/everything-is-awesome.txt and output the first row on the screen.
Hints:
Read file ./files/everything-is-awesome.txt and print count of all lines in the file.
Hint:
Split Everything Is AWESOME!!! and print each word on separate line.
Hints:
Regular expressions are patterns used to match character combinations in strings.
Read file ./files/everything-is-awesome.txt and count occurrence of word is (ignore case).
Hints:
There are several approaches to XML programming in Python. We will start with XML analysis using python ElementTree and XPath.
Learn about XPath:
Core example:
import xml.etree.ElementTree as ET
# Parse XML file and get its root element
root = ET.parse('./files/people.xml').getroot()
# Filter using XPath.
filtered = root.findall('.//record[firstname="John"]')
for element in filtered:
print(ET.tostring(element).decode('utf-8'))Change the example to find all users with surname Doe.
Print surnames to output, one surname per line. ElementTree class has limitations in xpath functionality.
Hint:
| Back | FazBrowse Home | New Git URL |