-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path01-versionsconventions.tex
46 lines (42 loc) · 1.51 KB
/
01-versionsconventions.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
\documentclass[MASTER.tex]{subfiles}
\begin{document}
%===========================================================%
\begin{frame}
\frametitle{Versions of Python}
\LARGE
Two Main Versions of Python
\begin{itemize}
\item Version 2.7
\item Version 3
\end{itemize}
\end{frame}
%===========================================================%
\begin{frame}
\frametitle{Python Coding Conventions}
\large
There are a number of common practices which can be adopted to produce Python code which looks
more like code found in other modules:
\begin{itemize}
\item Use 4 spaces to indent blocks – avoid using tab, except when an editor automatically converts tabs
to 4 spaces
\item Avoid more than 4 levels of nesting, if possible
\item Limit lines to 79 characters. The $\backslash$ symbol can be used to break long lines
219
\item Use two blank lines to separate functions, and one to separate logical sections in a function.
\end{itemize}
\end{frame}
%===========================================================%
\begin{frame}
\frametitle{Python Coding Conventions}
\large
\begin{itemize}
\item Use ASCII mode in text editors, not UTF-8
\item One module per import line
\item Avoid from module \texttt{import $\ast$} (for any module). Use either \texttt{from module import func1, func2} or
\texttt{import module as shortname}.
\item Follow the NumPy guidelines for documenting functions
\end{itemize}
% More suggestions can be found in PEP8.
\end{frame}
%===========================================================%
\end{document}