Linked Questions
17 questions linked to/from syntax error when using command line in python
323
votes
6
answers
1.3m
views
Why does "pip install" inside Python raise a SyntaxError?
I'm trying to use pip to install a package. I try to run pip install from the Python shell, but I get a SyntaxError. Why do I get this error? How do I use pip to install the package?
>>> ...
0
votes
2
answers
3k
views
Run Python script on windows from .py file in Latest Version Python 3.5.1 [duplicate]
I am learning Python now.
At my very first program I am getting following error.
>>> python first_tutorial.py
File "<stdin>", line 1
python first_tutorial.py
...
0
votes
0
answers
2k
views
File "<stdin>", line 1 in python 3.6 version [duplicate]
I am a beginner in using python.
I created a file script.py which the code is only one line: print("hello"), but when I executed it on windows command prompt (I use windows 10), it results error
...
-1
votes
1
answer
2k
views
unexpected character after line continuation character when opening file in command line [duplicate]
I have just started learning python and make a python file called "helloworld.py" and store it inside a file called "python py" on the desktop, but this keep poping out whenever I am trying to open ...
-4
votes
1
answer
831
views
Python3 http.sever invalid syntax [duplicate]
Hello everyone!
I am trying to get a basic python server running. But unfortunately it doesn't work and after hours of googling I have simply no clue.
I installed Python3, checked the version and ...
0
votes
0
answers
21
views
How do i Open an IDLE file (filename.py) in macOS terminal? [duplicate]
I made a new file in IDLE named intro.py insdie it i typed print('Hello World') and saved it in Desktop, then i open python in the terminal and type in python Desktop/intro.py this happens:
File "...
4
votes
1
answer
27k
views
Python/Invalid Syntax
I'm new to programming language and started learning python. While practicing writing code in VS code editor, I'm getting invalid syntax error for the following code:
sidekick = "WonderBoy"
print("...
-3
votes
1
answer
22k
views
SyntaxError: invalid syntax in python, why? [duplicate]
This is the error i get:
File "<stdin>", line 1
& "C:/Users/myName/AppData/Local/Microsoft/WindowsApps/python3.9.exe" "c:/xampp/htdocs/SD/UAS Prak/No1.py"
^
...
0
votes
3
answers
6k
views
Python program with arguments on Windows
How to run this program saved in the file test.py on Windows XP with python 2.7 installed.
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('...
0
votes
1
answer
3k
views
How to quit the interpreter in python?
I'm having this exact beginner problem.
syntax error when using command line in python
As suggested I try to quit the interpreter. But when I try to quit the interpreter/shell with exit() or ctrl d ...
adiga's user avatar
- 35.4k
-1
votes
5
answers
995
views
Where is the syntax error in my Python Script?
I'm trying to make a GUI for a password logger program. Right now I'm only trying to learn how making a GUI works but only ten lines in, My program wont run because of a supposed syntax error.
import ...
0
votes
2
answers
1k
views
Using python to do webpage login and scraping
I'm new to Python and have limited coding experience. Recently I wanted to scrape some information from a website and was suggested that Python is a good language to use. I tried to search online and ...
2
votes
2
answers
391
views
Creating a dictionary
my goal is to create a dictionary in Python. I have a .csv file which contains two columns, first one being 'word', other being 'meaning'. I am trying to read the csv file in the dictionary format and ...
-1
votes
1
answer
585
views
how to run pdb in a nested loop in python
I have a nested loop as shown below,
for num in range(10,20): #to iterate between 10 to 20
for i in range(2,num): #to iterate on the factors of the number
if num%i == 0: #...
-4
votes
1
answer
595
views
SyntaxError: invalid syntax mkdir [duplicate]
I'm doing for having mqtt python..
I'm beginer
# Create a workspace directory to hold all the SDK files
mkdir sdk-workspace
File "<ipython-input-12-5c70212e7b48>", line 2
mkdir ...