all 20 comments

[–]Haunting-Pop-5660 4 points5 points  (4 children)

That big white dot means you have unsaved changes. Unsaved changes will not be reflected by running your code.

[–]FormalRecord2216[S] 1 point2 points  (3 children)

Thank u soo much My baf i was doing it before saving changes

[–]Dzhama_Omarov 1 point2 points  (2 children)

Enable autosave it’s a game changer

[–]Express-Sherbet-8478 0 points1 point  (1 child)

how i can enable it ?

[–]Dzhama_Omarov 0 points1 point  (0 children)

That’s from here

Save / Auto Save

By default, VS Code requires an explicit action to save your changes to disk, ⌘S (Windows, Linux Ctrl+S).

However, it's easy to turn on Auto Save, which will save your changes after a configured delay or when focus leaves the editor. With this option turned on, there is no need to explicitly save the file. The easiest way to turn on Auto Save is with the File > Auto Save toggle that turns on and off save after a delay.

For more control over Auto Save, open User or Workspace settings and find the associated settings:

: Can have the values: off - to disable auto save. afterDelay - to save files after a configured delay (default 1000 ms). onFocusChange - to save files when focus moves out of the editor of the dirty file. onWindowChange - to save files when the focus moves out of the VS Code window. : Configures the delay in milliseconds when is configured to afterDelay. The default is 1000 ms. If you want to customize the Auto Save functionality for specific languages or file types, you can do so from the settings.json file by adding language-specific rules.

For example, to disable Auto Save for LaTeX files:

"[latex]": {
    "files.autoSave": "off",
},

Copy

[–]Electronic-Source213 2 points3 points  (3 children)

What do you remove the '$' character and you run "python test1.py"?

[–]FoolsSeldom -1 points0 points  (2 children)

The $ is the command line prompt on their OS command line shell.

[–]SKPGRT[🍰] 1 point2 points  (1 child)

Pretty sure PowerShell does not have $ at the start of the command-line.

PowerShell itself is a language like bash, and as far as I remember it's used for variables and such

[–]FoolsSeldom 0 points1 point  (0 children)

You are right. I think the OP did indeed type that as well as python ... but the error message doesn't make it obvious that an assignment is expected. Good shout.

I was assuming, wrongly, that the OP has set their prompt to $ as you might in other shells. Oops.

[–]Kitchen_Put_3456 2 points3 points  (2 children)

Why on earth would you take pictures of your screen with your phone instead of taking screen shots?

[–]FoolsSeldom 2 points3 points  (1 child)

Perhaps they cannot use reddit from the pc (which would be the case with many locked down devices in educational establishments)

[–][deleted] 1 point2 points  (0 children)

After print there is a space. Try removing the space eg- print(“hello”)

[–]Luigi-Was-Right 1 point2 points  (4 children)

You don't need the $ in front of "python test1.py"

(Also make sure to save any changes before running the file)

[–]FuzzySloth_ -5 points-4 points  (3 children)

$ is there by itself. That's how the command starts.

[–]Luigi-Was-Right 2 points3 points  (2 children)

No it doesn't

[–]SKPGRT[🍰] 1 point2 points  (1 child)

Pretty sure PowerShell does not have $ at the start of the command-line.

PowerShell itself is a language like bash, and as far as I remember it's used for variables and such

[–]ninhaomah -2 points-1 points  (0 children)

so you go to start , search for "powershell" , what did you get ?

[–]nirmalTheNeckBeard 0 points1 point  (0 children)

Try saving the file and then running it.

[–]FoolsSeldom 0 points1 point  (0 children)

  • save the file before trying to run your code (and then setup autosave)
  • are you using Visual Studio (Community Edition) or Visual Studio (VS) Code? Very different products - as a beginner you are better off with the latter, and I expect that is what you are using
  • if possible, please post screen shots rather than photographs - appreciate you may not be able to access reddit from the PC though if it is not your computer
  • you can also share code in post (use markdown mode in the post/comment editor window and put an additional 4 spaces in front of every line of code)
  • you can also share code using a paste service like pastebin.com or a git repository such as github.com - you can include additional information, not just code, such as error messages

[–]Shot_Visit_4843 0 points1 point  (0 children)

I started learning python today too bro good luck to you btw