I'm trying to start learning Python, but I became confused from the first step.
I'm getting started with Hello, World
, but when I try to run the script, I get:
Syntax Error: Non-UTF-8 code starting with '
\xe9
' in fileC:\Documents and Settings\Home\workspace\Yassine frist stared\src\firstModule.py
on line 5 but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details.
Step 1. Create and run your first Python project Step 1. Create and run your first Python project You have installed Python itself. If you're using macOS or Linux, your computer already has Python installed. You can get Python from python.org.
Step 1: Open an editor of your choice to write the Python code. Here we will simply use Notepad but it is completely up to you what you prefer. print("Welcome to GeeksForGeeks!") Step 3: Now that we have completed the code save it as gfg.py (‘gfg’ is just a name that we gave to the python file)
The best way to get started using Python for machine learning is to complete a project. It will force you to install and start the Python interpreter (at the very least). It will given you a bird’s eye view of how to step through a small project.
The syntax of the Python language can be intuitive if you are new to it. Just like other languages, focus on function calls (e.g. function ()) and assignments (e.g. a = “b” ). This will get you most of the way. You are a developer, you know how to pick up the basics of a language real fast.
add to the first line is
# -*- coding: utf-8 -*-
Put as the first line of your program this:
# coding: utf-8
See also Correct way to define Python source code encoding
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With