Jump to content

Why do i get this syntax error

Bhavya Sharma
Go to solution Solved by DigitalGoat,
29 minutes ago, Bhavya Sharma said:

PXL_20230221_141624186.jpg

Try using single quote marks not doubles, ie print('a line of text')

29 minutes ago, Bhavya Sharma said:

PXL_20230221_141624186.jpg

Try using single quote marks not doubles, ie print('a line of text')

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, DigitalGoat said:

Try using single quote marks not doubles, ie print('a line of text')

Didn't work 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Bhavya Sharma said:

Didn't work 

I have just tried it in a blender python console, it does work. Are you importing the necessary headers for displaying text?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Bhavya Sharma said:

I don't understand what happened but i think vs code had some personal issues with me i restarted the laptop and the code worked ☠️🥲🥲🥲

Ah, ok, may be an issue with dependencies not loading then.

Link to comment
Share on other sites

Link to post
Share on other sites

You're trying to run python within a python prompt...

F@H
Desktop: i9-13900K, ASUS Z790-E, 64GB DDR5-6000 CL36, RTX3080, 2TB MP600 Pro XT, 2TB SX8200Pro, 2x16TB Ironwolf RAID0, Corsair HX1200, Antec Vortex 360 AIO, Thermaltake Versa H25 TG, Samsung 4K curved 49" TV, 23" secondary, Mountain Everest Max

Mobile SFF rig: i9-9900K, Noctua NH-L9i, Asrock Z390 Phantom ITX-AC, 32GB, GTX1070, 2x1TB SX8200Pro RAID0, 2x5TB 2.5" HDD RAID0, Athena 500W Flex (Noctua fan), Custom 4.7l 3D printed case

 

Asus Zenbook UM325UA, Ryzen 7 5700u, 16GB, 1TB, OLED

 

GPD Win 2

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Kilrah said:

You're trying to run python within a python prompt...

Yeah that's what was happening 

Link to comment
Share on other sites

Link to post
Share on other sites

In the terminal inside of VS Code, run python practice\ set.py. If you want to run a Python script you have to add it as an arg when you run the python command. Otherwise you're opening up a python session that's similar to writing code in the space above. 

Also you should rename your script to practice_set.py to avoid having to escape the space character.

Link to comment
Share on other sites

Link to post
Share on other sites

On 2/21/2023 at 7:50 PM, Bhavya Sharma said:

PXL_20230221_141624186.jpg

you are trying to run the file in that interactive python interface, this is what it looks like if you did it in a file,

 

import pandas

& C:/Python311/python.exe "e:/learning python/practice set.py"

 

that doesn't look right eh?

 

you should run the file in the terminal's prompt, when it says "PS E:\learning python> _", not inside the interactive python thing.. ( does anyone here know what t is called exactly? )

 

to exit from the python thing back to the terminal, you can try to press CTRL+D or CTRL+Z or just enter "exit()"  simply.

 

then, click on the run button given by vs code

hey! i know to use a computer

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×