![]() ![]() ![]() Because Windows machines ignore this line and Unix-based systems such as macOS use it, including the line makes the script transferable among the different types of computers. However, Unix computers use the line to find the version of Python to use to execute the code in the file. The # precedes a single-line comment, so the line of code isn’t read or executed on a Windows computer. Notice that the first character is the pound or hash character ( #). ![]() The first line is a special line called the shebang, which you should always include as the very first line in your Python scripts. Write the following two lines of code in the text file: #!/usr/bin/env python3 print ( "Output #1: I'm excited to learn Python." ) Open the Spyder IDE or a text editor (e.g., Notepad, Notepad++, or Sublime Text on Windows TextMate, TextWrangler, or Sublime Text on macOS). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |