Diferències

Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.

Enllaç a la visualització de la comparació

Ambdós costats versió prèvia Revisió prèvia
Següent revisió
Revisió prèvia
info:cursos:udemy:python-mega-course [09/10/2024 02:30] – [Cheatsheet: List Comprehensions] mateinfo:cursos:udemy:python-mega-course [18/10/2024 04:12] (actual) – [Curso python udemy] mate
Línia 1: Línia 1:
 = Curso python udemy = Curso python udemy
 +  * [[https://www.udemy.com/course/former-python-mega-course-build-10-real-world-applications/learn/lecture/34362798#overview]]
 +== interesante
 +  * Numpy: manejo de matrices
 +  * Web Mapping: creación mapas interactivos HTML
 +  * Manejo Webcam
 +  * Bokeh: libreria representación gráficos -> [[development:python:bokeh|]]
 +  * Pandas: libreria de analisis de datos -> [[development:python:pandas|]]
 +  * Flask: web development
 +  * openCV: image processing library
 +  * Mobile app: apk
 +  * Web Scraping
 +  * pyinstaller: creación de ejecutables
 +
 +== jupyter notebook
 +  * <code bash>sudo apt install libsqlite3-dev</code>
 +  * <code bash>pip3 install jupyter notebook</code>
 +  * <code bash>jupyter notebook</code>
 == Cheatsheet: Data Types == Cheatsheet: Data Types
   * Integers are used to represent whole numbers:<code python>rank = 10   * Integers are used to represent whole numbers:<code python>rank = 10
Línia 253: Línia 270:
 </code> </code>
  
-  * Here's a summary of function elements:{{:info:cursos:udemy:pasted:20241009-022827.png}}+  * Here's a summary of function elements:{{:info:cursos:udemy:pasted:20241009-022827.png?300}}
  
 +== Cheatsheet: File Processing
 +  * You can read an existing file with Python:<code python>
 +with open("file.txt") as file:
 +    content = file.read()
 +</code>
 +
 +  * You can create a new file with Python and write some text on it:<code python>
 +with open("file.txt", "w") as file:
 +    content = file.write("Sample text")
 +</code>
 +  * You can append text to an existing file without overwriting it:<code python>
 +with open("file.txt", "a") as file:
 +    content = file.write("More sample text")</code>
 +
 +  * You can both append and read a file with:<code python>
 +with open("file.txt", "a+") as file:
 +    content = file.write("Even more sample text")
 +    file.seek(0)
 +    content = file.read()
 +</code>
 +    
 +== Cheatsheet: Imported Modules
 +  * Builtin objects are all objects that are written inside the Python interpreter in C language.
 +  * Builtin modules contain builtins objects.
 +  * Some builtin objects are not immediately available in the global namespace. They are parts of a builtin module. To use those objects the module needs to be imported first. E.g.:<code python>
 +import time
 +time.sleep(5)
 +</code>
 +  * A list of all builtin modules can be printed out with:<code python>
 +import sys
 +sys.builtin_module_names
 +</code>
 +  * Standard libraries is a jargon that includes both builtin modules written in C and also modules written in Python.
 +  * Standard libraries written in Python reside in the Python installation directory as .py files. You can find their directory path with ''sys.prefix''.
 +  * Packages are a collection of .py modules.
 +  * Third-party libraries are packages or modules written by third-party persons (not the Python core development team).
 +  * Third-party libraries can be installed from the terminal/command line:
 +    * Windows:<code python>
 +pip install pandas # or use 
 +python -m pip install pandas # if that doesn't work.
 +</code>
 +    * Mac and Linux:<code python>
 +pip3 install pandas # or use 
 +python3 -m pip install pandas # if that doesn't work.
 +</code>
 +
 +== Flask
 +<code bash>pip install Flask</code>
 +
 +<code python script1.py>
 +from flask import Flask, render_template
 +
 +app=Flask(__name__)
 +
 +@app.route("/")
 +def home():
 +    return render_template("home.html")
 +
 +@app.route("/about")
 +def about():
 +    return render_template("about.html")
 +
 +if __name__=="__main__":
 +    app.run(debug=True) 
 +</code>
 +
 +<code html templates/menu.html>
 +<!DOCTYPE html>
 +<html>
 +    <head>
 +        <title>Flask app </title>
 +        <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
 +    </head>
 +    <body>
 +        <header>
 +            <div class="container">
 +                <h1 class="logo">Python Flask test page</h1>
 +                <ul class="menu">
 +                    <li><a href="{{ url_for('home') }}">HOME</a></li>
 +                    <li><a href="{{ url_for('about') }}">ABOUT</a></li>
 +                </u1>
 +            </div>
 +        </header>
 +        <div class="container">
 +            {%block content%}
 +            {%endblock%}
 +        </div>
 +    </body>
 +</html>
 +</code>
 +<code html templates/home.html>
 +{%extends "menu.html"%}
 +{%block content%}
 +    <h2>HOME PAGE</h1>
 +{%endblock%}
 +</code>
 +
 +<code html templates/about.html>
 +{%extends "menu.html"%}
 +{%block content%}
 +    <h2>ABOUT PAGE</h1>
 +{%endblock%}
 +</code>
 +
 +<code css static/css/main.css>
 +body {
 +  margin: 0;
 +  padding: 0;
 +  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
 +  color: #060;
 +}
 +
 +/*
 + * Formatting the header area
 + */
 +
 +header {
 +  background-color: #DFB887;
 +  height: 35px;
 +  width: 100%;
 +  opacity: .9;
 +  margin-bottom: 10px;
 +}
 +
 +header h1.logo {
 +  margin: 0;
 +  font-size: 1.7em;
 +  color: #fff;
 +  text-transform: uppercase;
 +  float: left;
 +}
 +
 +header h1.logo:hover {
 +  color: #fff;
 +  text-decoration: none;
 +}
 +
 +/*
 + * Center the body content
 + */
 +
 +.container {
 +  width: 1200px;
 +  margin: 0 auto;
 +}
 +
 +div.home {
 +  padding: 10px 0 30px 0;
 +  background-color: #E6E6FA;
 +  -webkit-border-radius: 6px;
 +     -moz-border-radius: 6px;
 +          border-radius: 6px;
 +}
 +
 +div.about {
 +  padding: 10px 0 30px 0;
 +  background-color: #E6E6FA;
 +  -webkit-border-radius: 6px;
 +     -moz-border-radius: 6px;
 +          border-radius: 6px;
 +}
 +
 +h2 {
 +  font-size: 3em;
 +  margin-top: 40px;
 +  text-align: center;
 +  letter-spacing: -2px;
 +}
 +
 +h3 {
 +  font-size: 1.7em;
 +  font-weight: 100;
 +  margin-top: 30px;
 +  text-align: center;
 +  letter-spacing: -1px;
 +  color: #999;
 +}
 +
 +.menu {
 +  float: right;
 +  margin-top: 8px;
 +}
 +
 +.menu li {
 +  display: inline;
 +}
 +
 +.menu li + li {
 +  margin-left: 35px;
 +}
 +
 +.menu li a {
 +  color: #444;
 +  text-decoration: none;
 +}
 +
 +</code>
  • info/cursos/udemy/python-mega-course.1728466205.txt.gz
  • Darrera modificació: 09/10/2024 02:30
  • per mate