Python, where to start?
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
Python, where to start?
Hello,
So I looking for what to learn new in my life.. And I found Python... I'm not sure, why this take my attention (I'm like new on programming), but it seems fun. And I don't know where to start? Any offers? I started basics on sololearn, but I think it should not be only one place from where I can learn something.
So I looking for what to learn new in my life.. And I found Python... I'm not sure, why this take my attention (I'm like new on programming), but it seems fun. And I don't know where to start? Any offers? I started basics on sololearn, but I think it should not be only one place from where I can learn something.
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Re: Python, where to start?
I bought this to get me started:
https://www.amazon.co.uk/gp/product/159 ... UTF8&psc=1
Also install idle, can be installed from software manager. It's a simple IDE for python. It's not my favourite language.
https://www.amazon.co.uk/gp/product/159 ... UTF8&psc=1
Also install idle, can be installed from software manager. It's a simple IDE for python. It's not my favourite language.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Python, where to start?
You talking about Idle-python2.7?AndyMH wrote: ⤴Wed Jan 23, 2019 4:20 am I bought this to get me started:
https://www.amazon.co.uk/gp/product/159 ... UTF8&psc=1
Also install idle, can be installed from software manager. It's a simple IDE for python. It's not my favourite language.
Re: Python, where to start?
Everything I've done to date, which is not a lot, with python has been 2.7. I've got idle for version 3.6 installed as well as the 2.7 version, but not used it yet and haven't had any reason yet to find out what the differences are between 2.7 and 3.6.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Python, where to start?
python2 is over a decade old and is already on extended life support, which will finally run out by the end of the year. You shouldn't be using it unless you have to.
PS: https://www.python.org/dev/peps/pep-0373/
Re: Python, where to start?
I'd suggest the Hitchhiker's Guide to Python: https://docs.python-guide.org/index.html. You can read it online or get the book. The official Python documentation can also be useful reference: https://docs.python.org/3/.
And indeed, go for Python 3 and skip anything that's about Python 2 because that's dead.
I like AndyMH's suggestion. The publisher of that book has other books on Python that might be interesting depending on what you want to do with Python.
You learn easiest when you also practice. So go write some programs. Whether they are practical or silly doesn't matter as long as you're exercising your programming skills. Automating things is a good place to start.
And indeed, go for Python 3 and skip anything that's about Python 2 because that's dead.
I like AndyMH's suggestion. The publisher of that book has other books on Python that might be interesting depending on what you want to do with Python.
You learn easiest when you also practice. So go write some programs. Whether they are practical or silly doesn't matter as long as you're exercising your programming skills. Automating things is a good place to start.
Re: Python, where to start?
But where to download something to write programs on Linux? And still I need basics about Python, so I'm learning from SoloLearn CPython, but there is nothing talking about versions . And thank you for answers!xenopeek wrote: ⤴Wed Jan 23, 2019 10:20 am I'd suggest the Hitchhiker's Guide to Python: https://docs.python-guide.org/index.html. You can read it online or get the book. The official Python documentation can also be useful reference: https://docs.python.org/3/.
And indeed, go for Python 3 and skip anything that's about Python 2 because that's dead.
I like AndyMH's suggestion. The publisher of that book has other books on Python that might be interesting depending on what you want to do with Python.
You learn easiest when you also practice. So go write some programs. Whether they are practical or silly doesn't matter as long as you're exercising your programming skills. Automating things is a good place to start.
Re: Python, where to start?
You don't need to download or install anything. Python 3 is already installed on your system and you can just use the Text Editor (xed) you'll find in your menu to write simple programs. When you open an existing Python program with Text Editor it will do syntax highlighting for you. For new, blank, files you can toggle Python syntax highlighting by selecting that at the bottom of the window (click on "Plain Text ⏷").
For example put these lines in a file and save it (the first line is special and makes Linux know this is a Python 3 program):
This program you can run from the terminal. Let's assume you saved it as "sayhello" in your Documents directory. Open the terminal from your menu and change directory (cd) to the directory where you put the file, so in this example with command:
Then you can execute your program by running:
You can also make your program executable with command
What I personally did was put a file called "Python 3" with only the line
You can also run Python 3 interactively with the command
Depending on your likes and needs a plain text editor will suffice for programming but you may prefer a generic programmer's editor (like Geany) or an IDE that supports Python (like IDLE mentioned above, but make sure to install idle3).
For example put these lines in a file and save it (the first line is special and makes Linux know this is a Python 3 program):
Code: Select all
#!/usr/bin/python3
print("Hello, World!")
cd Documents
Then you can execute your program by running:
python3 sayhello
You can also make your program executable with command
chmod +x sayhello
or by right-clicking the file in your file manager, select Properties and then on the Permissions tab enable to allow executing it. After making the program executable you can run it on the terminal as:./sayhello
What I personally did was put a file called "Python 3" with only the line
#!/usr/bin/python3
in it, and having made it executable, in my Templates directory. That way when you right-click in a directory you can select Create New Document > Python 3 from the context menu to quickly create a new Python 3 executable file for you to start editing.You can also run Python 3 interactively with the command
python3
on the terminal. It gives you a new prompt and any Python 3 code you type here is executed immediately. Can be useful for trying things out or accessing builtin help (like help(print)
will explain print). Type print("Hello, World!")
to be surprised Type quit()
to exit.Depending on your likes and needs a plain text editor will suffice for programming but you may prefer a generic programmer's editor (like Geany) or an IDE that supports Python (like IDLE mentioned above, but make sure to install idle3).
Re: Python, where to start?
Thanks, I'll try many ways . What about if I want to create a program? Like where I can input and read lines and other? Smth like .exe file from windows? What should I use?xenopeek wrote: ⤴Wed Jan 23, 2019 12:28 pm You don't need to download or install anything. Python 3 is already installed on your system and you can just use the Text Editor (xed) you'll find in your menu to write simple programs. When you open an existing Python program with Text Editor it will do syntax highlighting for you. For new, blank, files you can toggle Python syntax highlighting by selecting that at the bottom of the window (click on "Plain Text ⏷").
For example put these lines in a file and save it (the first line is special and makes Linux know this is a Python 3 program):This program you can run from the terminal. Let's assume you saved it as "sayhello" in your Documents directory. Open the terminal from your menu and change directory (cd) to the directory where you put the file, so in this example with command:Code: Select all
#!/usr/bin/python3 print("Hello, World!")
cd Documents
Then you can execute your program by running:
python3 sayhello
You can also make your program executable with commandchmod +x sayhello
or by right-clicking the file in your file manager, select Properties and then on the Permissions tab enable to allow executing it. After making the program executable you can run it on the terminal as:
./sayhello
What I personally did was put a file called "Python 3" with only the line#!/usr/bin/python3
in it, and having made it executable, in my Templates directory. That way when you right-click in a directory you can select Create New Document > Python 3 from the context menu to quickly create a new Python 3 executable file for you to start editing.
You can also run Python 3 interactively with the commandpython3
on the terminal. It gives you a new prompt and any Python 3 code you type here is executed immediately. Can be useful for trying things out or accessing builtin help (likehelp(print)
will explain print). Typeprint("Hello, World!")
to be surprised Typequit()
to exit.
Depending on your likes and needs a plain text editor will suffice for programming but you may prefer a generic programmer's editor (like Geany) or an IDE that supports Python (like IDLE mentioned above, but make sure to install idle3).
Re: Python, where to start?
Python is a scripted language, you run the text files. You don't need to compile it to a binary file (like .exe on Windows).
Re: Python, where to start?
https://opensource.com/resources/python/gui-frameworksI mean create a program with graphical design.
It is very easy to google!
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Re: Python, where to start?
You'd use a widget toolkit, like Gtk or Qt. There's user interface designers for both and libraries you can also use from Python. On Linux Mint most programs use Gtk but programs like VLC use Qt and all KDE programs use Qt.
Here is a tutorial on using Gtk with Python 3: https://python-gtk-3-tutorial.readthedocs.io/en/latest/. You can use Glade for user interface design (you can also make user interfaces progammatically or by hand writing the user interface definition file, both also covered in the previous link). Another option is to install GNOME Builder, an expansive IDE for programming for Gnome / Gtk which also comes with full Python support.
I don't have much experience with Qt but their IDE is called Qt Creator and I assume from https://www.qt.io/qt-for-python that it also has support for Python nowadays.
Here is a tutorial on using Gtk with Python 3: https://python-gtk-3-tutorial.readthedocs.io/en/latest/. You can use Glade for user interface design (you can also make user interfaces progammatically or by hand writing the user interface definition file, both also covered in the previous link). Another option is to install GNOME Builder, an expansive IDE for programming for Gnome / Gtk which also comes with full Python support.
I don't have much experience with Qt but their IDE is called Qt Creator and I assume from https://www.qt.io/qt-for-python that it also has support for Python nowadays.
Re: Python, where to start?
Wow.. Su much information.. I'm very thank you . +REP . You helped me a lot. Now let's go and study all the information . Thank you again!xenopeek wrote: ⤴Wed Jan 23, 2019 2:27 pm You'd use a widget toolkit, like Gtk or Qt. There's user interface designers for both and libraries you can also use from Python. On Linux Mint most programs use Gtk but programs like VLC use Qt and all KDE programs use Qt.
Here is a tutorial on using Gtk with Python 3: https://python-gtk-3-tutorial.readthedocs.io/en/latest/. You can use Glade for user interface design (you can also make user interfaces progammatically or by hand writing the user interface definition file, both also covered in the previous link). Another option is to install GNOME Builder, an expansive IDE for programming for Gnome / Gtk which also comes with full Python support.
I don't have much experience with Qt but their IDE is called Qt Creator and I assume from https://www.qt.io/qt-for-python that it also has support for Python nowadays.
Re: Python, where to start?
You're welcome. Have fun with it
Re: Python, where to start?
You might find use for the IMDB datasets you can download from https://www.imdb.com/interfaces/ for that. That way you could let users add a TV series by typing the name in a search field and your program would find the episodes list and titles itself. Anyway, just daydreaming—this is the perfect example of things you should postpone till you have a basic program running.
Re: Python, where to start?
Just wanted to add my thanks to all the contributors to this thread. I've been debating jumping into Python and there are some great ideas here for getting started.
Thanks also to Kibiras for asking this question. Hopefully this thread kicks me into gear on getting started myself!
Thanks also to Kibiras for asking this question. Hopefully this thread kicks me into gear on getting started myself!
Re: Python, where to start?
Thank you. Yeah, for now daydreaming is that I want to create this program only in text editor with no graphics.. Only with inputs, save system and other some features...xenopeek wrote: ⤴Wed Jan 23, 2019 3:42 pm You might find use for the IMDB datasets you can download from https://www.imdb.com/interfaces/ for that. That way you could let users add a TV series by typing the name in a search field and your program would find the episodes list and titles itself. Anyway, just daydreaming—this is the perfect example of things you should postpone till you have a basic program running.
I need to create my own .
It's good feeling when asking help and at the same I helping for otherMrEen wrote: ⤴Wed Jan 23, 2019 4:28 pm Just wanted to add my thanks to all the contributors to this thread. I've been debating jumping into Python and there are some great ideas here for getting started.
Thanks also to Kibiras for asking this question. Hopefully this thread kicks me into gear on getting started myself!