{ "cells": [ { "cell_type": "markdown", "id": "appreciated-barrel", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Matematikai Algoritmusok és Felfedezések I.\n", "\n", "## 5. Előadás: Objektum orientált programozás 2\n", "### 2021 március 8." ] }, { "cell_type": "markdown", "id": "living-potential", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Öröklődés\n" ] }, { "cell_type": "code", "execution_count": null, "id": "reliable-grain", "metadata": {}, "outputs": [], "source": [ "class Ember:\n", " pass\n", " \n", "class Matematikus(Ember):\n", " pass\n", "\n", "e = Ember() \n", "m = Matematikus()\n", "print(isinstance(e, Matematikus))\n", "print(isinstance(m, Ember))\n", "print(issubclass(Ember, Matematikus))\n", "print(issubclass(Matematikus,Ember))" ] }, { "cell_type": "markdown", "id": "communist-agreement", "metadata": {}, "source": [ "Ha nem írunk semmilyen osztályt, automatikusan az `object` osztály a szülő osztály:" ] }, { "cell_type": "code", "execution_count": null, "id": "congressional-beatles", "metadata": {}, "outputs": [], "source": [ "o=object()" ] }, { "cell_type": "code", "execution_count": null, "id": "occupational-roman", "metadata": {}, "outputs": [], "source": [ "class A: pass\n", "class B(object): pass\n", "\n", "print(issubclass(A, object))\n", "print(issubclass(B, object))" ] }, { "cell_type": "markdown", "id": "danish-eagle", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Metódus öröklődés\n", "\n", "A metódusok öröklődnek, de felülírhatóak." ] }, { "cell_type": "code", "execution_count": null, "id": "composite-yacht", "metadata": {}, "outputs": [], "source": [ "class A(object):\n", " def foo(self):\n", " print(\"A.foo függvény\")\n", " \n", " def bar(self):\n", " print(\"A.bar függvény\")\n", " \n", "class B(A):\n", " def foo(self):\n", " print(\"B.foo függvény\")\n", " \n", "b = B()\n", "b.foo()\n", "b.bar()" ] }, { "cell_type": "markdown", "id": "western-michigan", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Attribútum öröklődés\n", "Mivel az adat attribútumok bárhol létrehozhatóak, csak akkor \"öröklődnek\", ha a szülő osztályban lévő kód meghívódik." ] }, { "cell_type": "code", "execution_count": null, "id": "authorized-sequence", "metadata": {}, "outputs": [], "source": [ "class A(object):\n", " \n", " def foo(self):\n", " self.value = 42\n", " \n", "class B(A):\n", " pass\n", "\n", "b = B()\n", "print('b',b.__dict__) # a __dict__ kiírja az összes attribútumot \n", "a = A()\n", "print('a',a.__dict__)\n", "\n", "a.foo()\n", "print('a',a.__dict__)\n", "print('b',b.__dict__)\n", "\n", "b.foo()\n", "print('b',b.__dict__)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "revised-therapist", "metadata": {}, "outputs": [], "source": [ "dir(a)" ] }, { "cell_type": "code", "execution_count": null, "id": "large-report", "metadata": {}, "outputs": [], "source": [ "a.__dict__" ] }, { "cell_type": "markdown", "id": "revised-fashion", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### A szülő osztály konstruktora\n", "\n", "- meghívódik az szülő osztály `__init__` függvénye. Viszont mivel az `__init__` nem egy szokásos konstruktor, így nem hívódik meg automatikusan a szülő osztály init függvénye, ha felülírja a gyerek osztály." ] }, { "cell_type": "code", "execution_count": null, "id": "gorgeous-messaging", "metadata": {}, "outputs": [], "source": [ "class A(object):\n", " def __init__(self):\n", " print(\"A.__init__ called\")\n", " \n", "class B(A):\n", " #pass\n", " def __init__(self):\n", " print(\"B.__init__ called\")\n", " \n", "class C(A):\n", " pass\n", " \n", "b = B()\n", "print(\"c létrehozása\")\n", "c = C()" ] }, { "cell_type": "markdown", "id": "connected-floor", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "A szülő osztály metódusai kétféleképpen is elérhetőek\n", "1. a már tanult módon, az osztály nevével\n", "2. vagy pedig a **super** függvény segítségével" ] }, { "cell_type": "code", "execution_count": null, "id": "occupied-nitrogen", "metadata": { "slideshow": { "slide_type": "-" } }, "outputs": [], "source": [ "class A(object):\n", " def __init__(self):\n", " print(\"A.__init__ \")\n", " \n", " \n", "class B(A):\n", " def __init__(self):\n", " A.__init__(self)\n", " print(\"B.__init__ \")\n", " \n", "class C(A):\n", " def __init__(self):\n", " super().__init__()\n", " print(\"C.__init__ \")\n", " \n", "print(\"B\")\n", "b = B()\n", "print(\"C\")\n", "c = C()" ] }, { "cell_type": "markdown", "id": "sharing-exposure", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 1. Példa: polinomok" ] }, { "cell_type": "code", "execution_count": null, "id": "drawn-kansas", "metadata": {}, "outputs": [], "source": [ "class Polinom:\n", " \n", " def __init__(self, lista):\n", " self.ehlista=lista \n", " \n", " def __str__(self):\n", " szoveg=\"\"\n", " for i,eh in enumerate(self.ehlista):\n", " szoveg=szoveg+str(eh)+\"x^\"+str(i)+\"+\"\n", " szoveg=szoveg.rstrip(\"+\") \n", " return szoveg\n", " \n", " def deri(self):\n", " l=[]\n", " for i,eh in enumerate(self.ehlista):\n", " if i==0:\n", " pass\n", " else:\n", " l.append(i*eh)\n", " return Polinom(l)" ] }, { "cell_type": "code", "execution_count": null, "id": "practical-sword", "metadata": {}, "outputs": [], "source": [ "a=Polinom([1,2,4,5])\n", "print(a)\n", "print(a.deri().deri())" ] }, { "cell_type": "code", "execution_count": null, "id": "intense-shade", "metadata": {}, "outputs": [], "source": [ "class Masodfoku(Polinom):\n", " def egyikgyok(self):\n", " a=self.ehlista[2]\n", " b=self.ehlista[1]\n", " c=self.ehlista[0]\n", " return (-b+(b**2-4*a*c)**(1/2))/(2*a) " ] }, { "cell_type": "code", "execution_count": null, "id": "controlled-rebecca", "metadata": { "scrolled": true }, "outputs": [], "source": [ "p=Masodfoku([2,3,1])\n", "print(p)\n", "p.egyikgyok()\n", "print(p.deri())" ] }, { "cell_type": "code", "execution_count": null, "id": "respiratory-elements", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "worth-government", "metadata": {}, "outputs": [], "source": [ "# for ciklusok nélkül is meg tudjuk oldani :)\n", "class Polinom:\n", " \n", " def __init__(self, lista):\n", " self.ehlista=lista\n", " \n", " def __str__(self):\n", " szoveg=\"\".join([str(eh)+\"x^\"+str(i)+\"+\" for i,eh in enumerate(self.ehlista)][::-1])\n", " szoveg=szoveg.rstrip(\"+\") \n", " return szoveg\n", " \n", " def deri(self): \n", " l=[i*eh for i,eh in enumerate(self.ehlista) if i!=0]\n", " return Polinom(l)\n", " \n", " def beh(self,x):\n", " valasz=sum([eh*x**i for i,eh in enumerate(self.ehlista)])\n", " return valasz\n", " \n", " def __add__(self, other):\n", " \n", " l=max(len(self.ehlista),len(other.ehlista))\n", " bovitett_eh1=self.ehlista + [0]*(l - len(self.ehlista))\n", " bovitett_eh2=other.ehlista + [0]*(l - len(other.ehlista))\n", " \n", " uj_ehlista=[bovitett_eh1[i]+bovitett_eh2[i] for i in range(l) ]\n", " \n", " return Polinom( uj_ehlista )\n", " \n", "class Masodfoku(Polinom):\n", " def egyikgyok(self):\n", " a=self.ehlista[2]\n", " b=self.ehlista[1]\n", " c=self.ehlista[0]\n", " return (-b+(b**2-4*a*c)**(1/2))/(2*a) \n", " \n", "p=Polinom([1,2])\n", "print(p,p.beh(5))\n", "print(p.deri())\n", "\n", "m=Masodfoku([1,2,7])\n", "print(m.beh(m.egyikgyok()))\n", "print(p+p)\n", "print(Polinom([1,2,3])+Polinom([2,1]))" ] }, { "cell_type": "markdown", "id": "renewable-thirty", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### 2. Példa: Sárkányok\n", "![sarkany](dragon.jpg) " ] }, { "cell_type": "code", "execution_count": null, "id": "african-conversation", "metadata": {}, "outputs": [], "source": [ "class sarkany:\n", " def __init__(self, nev):\n", " self.nev=nev" ] }, { "cell_type": "code", "execution_count": null, "id": "contained-bryan", "metadata": {}, "outputs": [], "source": [ "class repulo_sarkany(sarkany):\n", " def __init__(self, nev, szarnyfesztav):\n", " super().__init__(nev)\n", " self.szarnyfesztav=szarnyfesztav\n", " \n", " def tamadas(self):\n", " print(\"A\", self.nev, \"nevű sárkány a levegőből rád vetette magát\", )\n", " \n", " def repules(self):\n", " print(\"A\", self.nev, \"nevű sárkány repül\", )\n", " " ] }, { "cell_type": "code", "execution_count": null, "id": "balanced-royal", "metadata": {}, "outputs": [], "source": [ "smaug=repulo_sarkany(\"Smaug\",12)\n", "smaug.repules()\n", "smaug.tamadas()\n", "smaug.szarnyfesztav" ] }, { "cell_type": "code", "execution_count": null, "id": "laden-winter", "metadata": {}, "outputs": [], "source": [ "class tuzokado_sarkany(sarkany):\n", " def __init__(self, nev):\n", " super().__init__(nev)\n", " \n", " def tamadas(self):\n", " print(\"A\", self.nev, \"nevű sárkány szénné égetett\", )\n", " \n", " def tuzokadas(self):\n", " print(\"A\", self.nev, \"nevű sárkány a tüzet okád\", )\n", " " ] }, { "cell_type": "code", "execution_count": null, "id": "coastal-plymouth", "metadata": {}, "outputs": [], "source": [ "susu=tuzokado_sarkany(\"Süsü\")\n", "susu.tuzokadas()\n", "susu.tamadas()" ] }, { "cell_type": "markdown", "id": "coastal-authorization", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Többszörös öröklődés\n", "- mindegyik osztály metódusai öröklődnek" ] }, { "cell_type": "code", "execution_count": null, "id": "mysterious-lecture", "metadata": {}, "outputs": [], "source": [ "class repulo_tuzokado_sarkany(repulo_sarkany,tuzokado_sarkany):\n", " def __init__(self, nev, szarnyfesztav):\n", " self.nev=nev \n", " self.szarnyfesztav=szarnyfesztav\n", " \n", " def tamadas(self):\n", " tuzokado_sarkany.tamadas(self)\n", " " ] }, { "cell_type": "markdown", "id": "wired-negotiation", "metadata": {}, "source": [ "#### Vajon mi lesz az eredmény?" ] }, { "cell_type": "code", "execution_count": null, "id": "residential-flooring", "metadata": {}, "outputs": [], "source": [ "viserion=repulo_tuzokado_sarkany(\"Viserion\",25)\n", "viserion.repules()\n", "viserion.tuzokadas()\n", "viserion.tamadas()\n" ] }, { "cell_type": "markdown", "id": "turkish-committee", "metadata": {}, "source": [ "Azt, hogy melyik hívódik meg, az MRO (Method Resolution Order) határozza meg. Ez egy sorrend az osztályokon, és egy metódus hívásnál addig megy a sorrendben még meg nem találja valamelyik osztályban a metódust. Nem pontosan így működik, de ökölszabálynak jó, hogy felfelé mélységi kersést végez, balról jobbra sorrendben. \n" ] }, { "cell_type": "markdown", "id": "fifty-briefs", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "# Modulok importálása\n", "\n", "- Az `import` két műveletet hajt végre\n", " 1. megkeresi a megadott név alapján a modult, \n", " 2. elérhetővi teszi a lokális scopeban\n", "\n", "### Teljes modul importálása\n", "`import modulnév` " ] }, { "cell_type": "code", "execution_count": 2, "id": "refined-cradle", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'__breakpointhook__, __displayhook__, __doc__, __excepthook__, __interactivehook__, __loader__, __name__, __package__, __spec__, __stderr__, __stdin__, __stdout__, _base_executable, _clear_type_cache, _current_frames, _debugmallocstats, _enablelegacywindowsfsencoding, _framework, _getframe, _git, _home, _xoptions, api_version, argv, base_exec_prefix, base_prefix, breakpointhook, builtin_module_names, byteorder, call_tracing, callstats, copyright, displayhook, dllhandle, dont_write_bytecode, exc_info, excepthook, exec_prefix, executable, exit, flags, float_info, float_repr_style, get_asyncgen_hooks, get_coroutine_origin_tracking_depth, get_coroutine_wrapper, getallocatedblocks, getcheckinterval, getdefaultencoding, getfilesystemencodeerrors, getfilesystemencoding, getprofile, getrecursionlimit, getrefcount, getsizeof, getswitchinterval, gettrace, getwindowsversion, hash_info, hexversion, implementation, int_info, intern, is_finalizing, maxsize, maxunicode, meta_path, modules, path, path_hooks, path_importer_cache, platform, prefix, ps1, ps2, ps3, set_asyncgen_hooks, set_coroutine_origin_tracking_depth, set_coroutine_wrapper, setcheckinterval, setprofile, setrecursionlimit, setswitchinterval, settrace, stderr, stdin, stdout, thread_info, version, version_info, warnoptions, winver'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import sys\n", "\n", "\", \".join(dir(sys)) # a dir függvény megadja az objektum attribútumait és metódusait. " ] }, { "cell_type": "code", "execution_count": 4, "id": "challenging-tooth", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "module" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import random\n", "type(random)" ] }, { "cell_type": "markdown", "id": "anonymous-economy", "metadata": {}, "source": [ "importálás után `modulnev.attribútum` alakban érjük el a modul tartalmát. " ] }, { "cell_type": "code", "execution_count": 8, "id": "referenced-easter", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "random.choice([3,4,5]) " ] }, { "cell_type": "markdown", "id": "published-enlargement", "metadata": {}, "source": [ "### Saját modult is készíthetünk\n", "A notebookal azonos mappában készítsünk egy mod.py fájlt." ] }, { "cell_type": "code", "execution_count": 9, "id": "bottom-bronze", "metadata": { "slideshow": { "slide_type": "subslide" } }, "outputs": [], "source": [ "import mod " ] }, { "cell_type": "code", "execution_count": 10, "id": "still-monkey", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['Foo',\n", " '__builtins__',\n", " '__cached__',\n", " '__doc__',\n", " '__file__',\n", " '__loader__',\n", " '__name__',\n", " '__package__',\n", " '__spec__',\n", " 'a',\n", " 'foo',\n", " 's']" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dir(mod)" ] }, { "cell_type": "code", "execution_count": 11, "id": "moving-content", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[100, 200, 300]\n", "arg 1\n", "If Comrade Napoleon says it, it must be right.\n" ] } ], "source": [ "print(mod.a)\n", "mod.foo(1)\n", "print(mod.s)" ] }, { "cell_type": "markdown", "id": "different-librarian", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### almodulok importálása\n", "`from modulnév import almodul`\n", "\n", "Az almodult ezután `almodul` néven érjük el és nem `modulnév.almodul` néven." ] }, { "cell_type": "code", "execution_count": 12, "id": "fleet-tulsa", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "os nincs definiálva\n", "path megtalálva\n", "os.path nincs definiálva\n" ] } ], "source": [ "from os import path\n", "\n", "try:\n", " os\n", "except NameError:\n", " print(\"os nincs definiálva\")\n", " \n", "try:\n", " path\n", " print(\"path megtalálva\")\n", "except NameError:\n", " print(\"path nincs definiálva\")\n", " \n", "try:\n", " os.path\n", " print(\"os.path megtalálva\")\n", "except NameError:\n", " print(\"os.path nincs definiálva\")" ] }, { "cell_type": "markdown", "id": "optional-nature", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "Az `as` kulcssszó segítségével megadhatunk egy másik nevet is:" ] }, { "cell_type": "code", "execution_count": null, "id": "assisted-johnston", "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": 13, "id": "internal-manitoba", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "os nincs definiálva\n", "os_module megtalálva\n" ] } ], "source": [ "import os as os_module\n", "\n", "try:\n", " os\n", "except NameError:\n", " print(\"os nincs definiálva\")\n", " \n", "try:\n", " os_module\n", " print(\"os_module megtalálva\")\n", "except NameError:\n", " print(\"os_module nincs definiálva\")" ] }, { "cell_type": "markdown", "id": "level-faith", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Egyszerre több mindent is importálhatunk" ] }, { "cell_type": "code", "execution_count": 14, "id": "agricultural-ticket", "metadata": {}, "outputs": [], "source": [ "import os, sys\n", "from sys import stdin, stderr, stdout" ] }, { "cell_type": "markdown", "id": "fuzzy-source", "metadata": {}, "source": [ "### Konkrét függvényeket és osztályokat is importálhatunk" ] }, { "cell_type": "code", "execution_count": 15, "id": "false-calvin", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "True" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from argparse import ArgumentParser\n", "import inspect\n", "\n", "inspect.isclass(ArgumentParser) " ] }, { "cell_type": "markdown", "id": "finished-rabbit", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "### Minden importálása egy modulból\n", "\n", "`from modulnév import *` után a modul teljes tartalma elérhető a `modulnév.` nélkül. \n", "\n", "**NAGYON NEM AJÁNLOTT** mert tudtunkon kívül felülírhatunk dolgokat. " ] }, { "cell_type": "code", "execution_count": 16, "id": "split-criminal", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Én egy statisztika vagyok\n" ] }, { "ename": "TypeError", "evalue": "stat() missing required argument 'path' (pos 1)", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[0mstat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mos\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mstat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mTypeError\u001b[0m: stat() missing required argument 'path' (pos 1)" ] } ], "source": [ "def stat():\n", " print(\"Én egy statisztika vagyok\")\n", "stat()\n", "from os import *\n", "stat()" ] }, { "cell_type": "code", "execution_count": null, "id": "outstanding-procedure", "metadata": {}, "outputs": [], "source": [ "stat" ] }, { "cell_type": "markdown", "id": "satellite-queensland", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Modulok instalálása" ] }, { "cell_type": "code", "execution_count": 18, "id": "infinite-judges", "metadata": {}, "outputs": [], "source": [ "import wikipedia" ] }, { "cell_type": "markdown", "id": "postal-slope", "metadata": {}, "source": [ "Ha `ModuleNotFoundError`-t kapunk, akkor a Python nem találta meg a számítógépünkön a modult. Ekkor általában az a gond, hogy tényleg nincs is a gépünkön, így instalálni kell. " ] }, { "cell_type": "markdown", "id": "interracial-royalty", "metadata": {}, "source": [ "### pip (pip installs packages)\n", "A pip program automatikusan telepítődik az Anaconda keretében. Windowson az Anaconda Promptból érjük el, Linuxon pedig a terminálból. Használat:\n", "- `pip install modulnev` Modul instalálása \n", "- `pip uninstall modulnev` Modul törlése\n", "- `pip list` Instalált modulok listája \n", "\n", "Olyan packageket tudunk installálni amik megtalálhatóak a PyPi-ben. (https://pypi.org/)" ] }, { "cell_type": "code", "execution_count": null, "id": "amino-child", "metadata": {}, "outputs": [], "source": [ "!pip list # a ! a mögötte lévő parancsot lefuttatja a terminálban" ] }, { "cell_type": "markdown", "id": "massive-symposium", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Hasznos beépített packagek, standard library\n", "Részletek: https://docs.python.org/3/library/\n", "\n", "Numeric and Mathematical Modules\n", "- numbers — Numeric abstract base classes\n", "- math — Mathematical functions\n", "- cmath — Mathematical functions for complex numbers\n", "- decimal — Decimal fixed point and floating point arithmetic\n", "- fractions — Rational numbers\n", "- random — Generate pseudo-random numbers\n", "- statistics — Mathematical statistics functions\n", "\n", "Functional Programming Modules\n", "- itertools — Functions creating iterators for efficient looping\n", "- functools — Higher-order functions and operations on callable objects\n", "- operator — Standard operators as functions\n" ] }, { "cell_type": "markdown", "id": "common-nelson", "metadata": { "slideshow": { "slide_type": "subslide" } }, "source": [ "## Hasznos külső packagek\n", "- matek és tudományos modulok \n", " - numpy \n", " - scipy\n", " - sympy\n", "- vizualizáció\n", " - Matplotlib\n", " - bokeh \n", "- deep, machine és mindenféle learning, adatbányászat\n", " - Keras\n", " - TensorFlow\n", " - PyTorch\n", " - Pandas\n", "- nyelvi feldolgozás\n", " - NLTK \n", "- parszolás\n", " - BeautifulSoup" ] }, { "cell_type": "markdown", "id": "ecological-paint", "metadata": { "collapsed": true, "slideshow": { "slide_type": "subslide" } }, "source": [ "## Kiegészítő anyagok\n", "- Saját package létrehozása https://packaging.python.org/tutorials/distributing-packages/\n", "- Virtualenv: Komolyabb Python használat esetén különböző projektekhez különböző verizói lehetnek szükségesek egy adott packagenek. A Virtualenv ennek kezelésében (is) segít.\n" ] } ], "metadata": { "celltoolbar": "Slideshow", "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.9" } }, "nbformat": 4, "nbformat_minor": 5 }