From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Code completion: Python
From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code
Code completion: Python
We just looked at how JavaScript code completion works with Copilot. Copilot offers the same functionality in most code editors so I thought it would be interesting to look at creating these same functions this time in a Python file. I'll start by using the def keyword to define a function. Isn't that interesting? The first suggestion is a function named format date. What's What's happening here is that Copilot is using context from my open files, recent edits, and comments. If it detects similar logic, it may proactively offer a translated version, even if I didn't explicitly ask for it. Also, notice it's using Python naming conventions. That's because Copilot adapts its suggestions to match the styling conventions of the language I'm working in. Notice that the word format underscore date and the parameter are in italicized text. That means that's the suggested text. So I'll press the tab key to accept that. And now Copilot is suggesting the rest of the function. So press tab a…
Contents
-
-
-
-
-
(Locked)
Completions, chat, and agent modes8m 3s
-
(Locked)
Code competion: JavaScript2m 59s
-
(Locked)
Making sense of nondeterministic predictions1m 38s
-
(Locked)
Code completion: Python1m 46s
-
(Locked)
HTML and CSS completion1m 40s
-
(Locked)
More inline suggestions features3m 6s
-
(Locked)
Use comments to guide completion2m 32s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-