{"id":68144,"date":"2022-09-27T12:14:13","date_gmt":"2022-09-27T10:14:13","guid":{"rendered":"https:\/\/eiposgrados.com\/?p=68144"},"modified":"2022-09-27T12:14:16","modified_gmt":"2022-09-27T10:14:16","slug":"install-python","status":"publish","type":"post","link":"https:\/\/eiposgrados.com\/eng\/blog-python\/instalar-python\/","title":{"rendered":"How to install Python quickly"},"content":{"rendered":"<p>A few weeks ago, we told you <a href=\"https:\/\/eiposgrados.com\/eng\/python-blog\/10-reasons-why-you-should-learn-python-in-2022-you-still-have-time\/\"><strong>10 reasons why you should learn to program in Python<\/strong><\/a>. But if you are still not convinced, in this article, we will talk about how to start programming with Python and the best way to do it.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-daf578e1 gb-headline-text\"><strong>Before starting<\/strong>:<\/h2>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Programming in Python is fun.<\/strong><\/h3>\n\n\n\n<p>Python code is easier to write and understand than other comparable programming languages. This is due to its easy syntax. Even if you&#039;ve never programmed before, you&#039;ll be able to understand what the code does just by reading it normally.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. The syntax is not too strict<\/strong><\/h3>\n\n\n\n<p>In Python, it is not necessary to specify the data type of a variable. In addition, the semicolon is not necessary after each statement (something that more than one will appreciate \ud83d\ude09)<\/p>\n\n\n\n<p>Python forces you to follow best practices (like proper indentation). This may seem like torture at first, but it can make programming much easier for beginners.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Expressiveness of language<\/strong><\/h3>\n\n\n\n<p>Python allows you to write programs with extensive functionality in just a few lines of code. It&#039;s amazing what you can do with Python once you master the fundamentals.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. A great community and support<\/strong><\/h3>\n\n\n\n<p>Python is supported by a large community. There are several active online forums that can help you if you get stuck.<\/p>\n\n\n\n<p>Here are some examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/www.reddit.com\/r\/learnpython\" target=\"_blank\" rel=\"noreferrer noopener\">reddit<\/a><\/li><li><a href=\"https:\/\/groups.google.com\/g\/comp.lang.python\" target=\"_blank\" rel=\"noreferrer noopener\">Google Forum<\/a><\/li><li><a href=\"https:\/\/stackoverflow.com\/tags\/python\" target=\"_blank\" rel=\"noreferrer noopener\">StackOverflow<\/a><\/li><\/ul>\n\n\n\n<p>Once we have everything clearer, the next question is:<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to install the program?<\/strong><\/h2>\n\n\n\n<p>At this point I must refer you to my previous article, where we talked about <strong><a href=\"https:\/\/eiposgrados.com\/eng\/python-blog\/what-operating-system-to-use-if-i-want-to-start-programming-in-python-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">operating systems<\/a><\/strong> to start working with Python.<\/p>\n\n\n\n<p>Once you have chosen yours, we will explain the installation process for each of them.<\/p>\n\n\n\n<p>We want to show you how to install and use Python on your operating system in the easiest way possible. This way, you can quickly get started in programming.<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-804622e7 gb-headline-text\"><strong>Python Installation Guide on MacOSX<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Open the page <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noreferrer noopener\">python download<\/a> in your browser and select Download Python 3.10.7 (you may see a different version, always select the latest one).<\/li><li>When the download is complete, you must open the .dmg file and follow the installation instructions.<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\"><li>A good editor can be a great help for Python development. We recommend Sublime Text (<a href=\"https:\/\/www.sublimetext.com\/3\" target=\"_blank\" rel=\"noopener\">download Sublime Text 3<\/a>) either <a href=\"https:\/\/eiposgrados.com\/eng\/python-blog\/python-vs-extensions\/\" target=\"_blank\" rel=\"noreferrer noopener\">Visual Studio Code<\/a>. Both editors can be used for free. To simplify, we are going to select the Sublime Text editor in this guide.<\/li><li>The installation works like any other program.<\/li><li>Open Sublime Text and select File &gt; New File (shortcut: Cmd+N). Then save (Cmd+S or File &gt; Save) the file with the .py extension (for example, Helloworld.py).<\/li><li>Write your code and save it. You can use this code to test:<\/li><\/ul>\n\n\n\n<p><strong>print(\u201cHello, world!\u201d)<\/strong><\/p>\n\n\n\n<p>For this simple program, type \u201cHello World\u201d into the command line. Select Tools &gt; Build (Cmd + B). You\u2019ll see \u201cHello World\u201d in the Sublime Text console. Congratulations, you\u2019ve just run your first Python program!<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-8cbaaca0 gb-headline-text\"><strong>Installation instructions for Windows<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Open the page <a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">python download<\/a> in your browser and select Download Python 3.10.7 (you may see a different version, always select the latest one).<\/li><li>When the download is complete, double-click the file to open it.<\/li><li>Along with Python, a small IDE called IDLE will be installed.<\/li><li>Open IDLE and write the following code.<\/li><li>print(\u201cHello, world!\u201d)<\/li><li>To create a new file in IDLE, select File &gt; New Window (shortcut: Ctrl+N).<\/li><li>Write your Python code (you can use the code below for now) and save it (shortcut: Ctrl+S) with the file extension .py (e.g. hello.py)<\/li><\/ol>\n\n\n\n<p><strong>print(\u201cHello, world!\u201d)<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Choose Run &gt; Run Module (Shortcut: F5) to see the output of your program. Congratulations, you just ran your first Python program.<\/li><\/ul>\n\n\n\n<p><strong>At this point, it&#039;s time to move on to the next step.<\/strong><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-5e8e2e08 gb-headline-text\"><strong>Your first Python program<\/strong><\/h2>\n\n\n\n<p>The classic way to start programming is always the \u201cHello World\u201d example. A \u201cHello World\u201d program simply produces the text \u201cHello World,\u201d as we saw in the previous section.<\/p>\n\n\n\n<p>Therefore, let&#039;s choose another example:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li># Sum of two numbers<\/li><li>number1 = 2<\/li><li>number2 = 4<\/li><li>sum = number1+number2<\/li><li>print(sum)<\/li><\/ol>\n\n\n\n<p><strong>How does this Python program work?<\/strong><\/p>\n\n\n\n<p>Line 1: # Sum of two numbers<\/p>\n\n\n\n<p>All lines starting with # in Python programming are comments.<\/p>\n\n\n\n<p>Comments are used in programming to explain the purpose of the code. This helps other programmers understand the intent of the code. Comments are completely ignored by compilers and interpreters.<\/p>\n\n\n\n<p>Line 2: number1 = 2<\/p>\n\n\n\n<p>Here, number1 is a variable. You can store a value in a variable. Therefore, the number 2 is stored in this variable.<\/p>\n\n\n\n<p>Line 3: number2 = 4<\/p>\n\n\n\n<p>Likewise, the number 4 is stored in the variable number2.<\/p>\n\n\n\n<p>Line 4: sum = number1+ number2<\/p>\n\n\n\n<p>The variables number1 and number2 are added together using the &quot;+&quot; operator. The result of the addition is stored in another variable, sum.<\/p>\n\n\n\n<p>Line 5: print(sum)<\/p>\n\n\n\n<p>The print() function outputs to the screen. In our case, the number 6 is displayed on your monitor.<\/p>\n\n\n\n<p>It is important to remember something:<\/p>\n\n\n\n<p>To represent a statement in Python, a new line is used. The use of semicolons (cf. C\/C++, PHP) is optional and it is recommended to omit this one. Braces are used to represent a block. <\/p>\n\n\n\n<p>Yes, I know\u2026 it&#039;s something very simple. <strong>How do I keep moving forward?<\/strong><\/p>\n\n\n\n<p> \u00a1<a href=\"https:\/\/eiposgrados.com\/eng\/programs\/master-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\">Discover much more complex cases in our <strong>Master in Advanced Programming in Python for Big Data, Hacking and Machine Learning<\/strong><\/a>!<\/p>","protected":false},"excerpt":{"rendered":"<p>A few weeks ago, we told you 10 reasons why you should learn to program in Python. But if you still haven&#039;t been convinced, in this... <a title=\"How to install Python quickly\" class=\"read-more\" href=\"https:\/\/eiposgrados.com\/eng\/blog-python\/instalar-python\/\" aria-label=\"Read more about How to install Python quickly\">Read more<\/a><\/p>","protected":false},"author":90,"featured_media":68165,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[407],"tags":[],"class_list":["post-68144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-python"],"acf":[],"_links":{"self":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/68144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/users\/90"}],"replies":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/comments?post=68144"}],"version-history":[{"count":0,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/68144\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media\/68165"}],"wp:attachment":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media?parent=68144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/categories?post=68144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/tags?post=68144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}