How can I learn Python? I have learn the basics- loops, if-elif, functions, etc.
I want to learn intermediate things like classes, file managing and maybe website creation.
I do not know from where to learn. Please suggest free yet reliable sources to guide me to learn intermediate python. (I prefer free as I am learning as a hobby, not for professional use as of yet)
Also, is YouTube fine for learning? There are many 4-6 year old videos regarding the same. Has Python changed much since last 6 years enough that the old videos are now not up to date?
Thanks
#π How do I learn python?
18 messages Β· Page 1 of 1 (latest)
@weary storm
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
!res
Resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
is the most popular response
i think most old vieos are fine just theres stuff like all classes inherit from Object and stuff thats outdated
if it uses python 3.x.x its prob mostly fine
for filemanaging os, pathlib and open() for web js + Flask
!d os
Source code: Lib/os.py
This module provides a portable way of using operating system dependent functionality. If you just want to read or write a file see open(), if you want to manipulate paths, see the os.path module, and if you want to read all the lines in all the files on the command line see the fileinput module. For creating temporary files and directories see the tempfile module, and for high-level file and directory handling see the shutil module.
Notes on the availability of these functions:
Similar names: label.os
!d pathlib
Added in version 3.4.
Source code: Lib/pathlib/
This module offers classes representing filesystem paths with semantics appropriate for different operating systems. Path classes are divided between pure paths, which provide purely computational operations without I/O, and concrete paths, which inherit from pure paths but also provide I/O operations.
If youβve never used this module before or just arenβt sure which class is right for your task, Path is most likely what you need. It instantiates a concrete path for the platform the code is running on.
Pure paths are useful in some special cases; for example:
!d open
open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None)```
Open *file* and return a corresponding [file object](https://docs.python.org/3/glossary.html#term-file-object). If the file cannot be opened, an [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError) is raised. See [Reading and Writing Files](https://docs.python.org/3/tutorial/inputoutput.html#tut-files) for more examples of how to use this function.
*file* is a [path\-like object](https://docs.python.org/3/glossary.html#term-path-like-object) giving the pathname (absolute or relative to the current working directory) of the file to be opened or an integer file descriptor of the file to be wrapped. (If a file descriptor is given, it is closed when the returned I/O object is closed unless *closefd* is set to `False`.)
!d flask.Flask
class flask.Flask(import_name, static_url_path=None, static_folder='static', static_host=None, host_matching=False, subdomain_matching=False, template_folder='templates', ...)```
The flask object implements a WSGI application and acts as the central object. It is passed the name of the module or package of the application. Once it is created it will act as a central registry for the view functions, the URL rules, template configuration and much more.
The name of the package is used to resolve resources from inside the package or the folder the module is contained in depending on if the package parameter resolves to an actual python package (a folder with an `__init__.py` file inside) or a standard module (just a `.py` file).
For more information about resource loading, see [`open_resource()`](https://flask.palletsprojects.com/en/latest/api/#flask.Flask.open_resource).
Usually you create a [`Flask`](https://flask.palletsprojects.com/en/latest/api/#flask.Flask) instance in your main module or in the `__init__.py` file of your package like this:
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.