Skip to main content

All Questions

0 votes
0 answers
45 views

"invalid syntax" error while importing from lumibot

I am encountering an "invalid syntax" error while trying to import from Lumibot and I have no Idea how to fix. Tried Chatgpt for finding a solution but didn't work. Here is my code: from ...
Bardia's user avatar
  • 5
-2 votes
3 answers
117 views

Error in syntax of fstrings in function input() [closed]

I have the following code in Python 3 def inputWithDefault(text:str, default): result = input(f"{" " * int(len(text))}{default}\r{text}") return default if not(result is ...
JK Bot's user avatar
  • 27
0 votes
0 answers
40 views

SQL syntax error (mysql.connector.errors.ProgrammingError: 1064 (42000):) while trying to update records in python

Part of my code calls up an edit window. In this window it pulls the information from the record you want to update based of the C_ID unique ID number. You enter the ID number in the box for either ...
Corpghent's user avatar
1 vote
1 answer
54 views

getting syntax error for & sign that does not exist in VS Code

When I am running my code from inside VS Code i get this error. As I understand its warning me about a & sign which does not exist in my code or it is something else?: & C:/Users/iwanh/AppData/...
Giannis Tsakas's user avatar
0 votes
0 answers
33 views

which static analysis tool can give a report on code issues even if there is syntax errors?

i tried to use pylint and some other linters, but they get stuck parsing when they come across syntax error. I need to find a tool or library that find code smells related issues like pylint even with ...
Lutfar Rahman Alif's user avatar
0 votes
0 answers
16 views

How to solve this error with a parser from this extract of source code?

I'm getting an error as %tb full traceback: SystemExit Traceback (most recent call last) <ipython-input-5-f0865fee28b7> in <module> 127 parser....
A55ia's user avatar
  • 1
0 votes
0 answers
24 views

Python cmd string with import and if statements throws SyntaxError

A synopsis: Using python -c <cmd>, I get a SyntaxError when using both an import statement and an if statement. If I only use the import, it's fine. If I only use the if statement, again, it's ...
user23962359's user avatar
0 votes
0 answers
30 views

How can I fix a "SyntaxError: invalid syntax" in my Python solution for finding maximum index difference? [duplicate]

I'm attempting to solve a problem where I need to find the maximum index difference in an array while adhering to certain constraints. I wrote the code in java and tried to replicate it in Python. ...
Yahya Adhikari's user avatar
0 votes
0 answers
39 views

I am having a problem with the module mp3play

import mp3play import time loc=r'C:\Users\user\Desktop\Francisco\music.mp3' tocar=mp3play.load(loc) tocar.play() time.sleep(10) I used this code to try to play an mp3 file on my computer but I ...
Francisco Frieza's user avatar
1 vote
1 answer
58 views

Why do parentheses as a python argument cause a syntax error? [duplicate]

When following a python2 tutorial, it often defines functions like this: def scale(self, (centre_x, centre_y), scale): which throws a SyntaxError in python3, highlighting the parenthesis in front of &...
FlashStopFall's user avatar
0 votes
1 answer
202 views

Fix Python3 syntax error in CheckMK plugin

I'm using CheckMK 2.2.0 and its plugin for Nginx to monitor some hosts. The agent is running on a host using Python 3.4.2 that can not be updated. When running the Nginx plugin on this host, I'm ...
rabudde's user avatar
  • 7,700
0 votes
0 answers
45 views

python extract_msg module -env-3.7 - .tokenize_rtf - invalid Syntax error

getting syntax error in okenizeRTF python 3.7 . please advise from .tokenize_rtf import tokenizeRTF Error: File "C:\Users\vvv\Miniconda3\envs\env-py37\lib\site-packages\extract_msg\_rtf\...
Rajesh's user avatar
  • 1
0 votes
1 answer
47 views

Python SyntaxError on fstring in the __repr__ method of the class [duplicate]

My code: class Book: all = [] def __init__(self, ISBN, title, subject, publisher, language, number_of_pages): self.__ISBN = ISBN self.__title = title self.__subject = ...
Raj's user avatar
  • 4,061
0 votes
1 answer
959 views

SyntaxError: name 'retry' is assigned to before global declaration

It keeps saying this: SyntaxError: name 'retry' is assigned to before global declaration Any tips as to how I can fix this? This is the code: import time global retry retry = 1 def message(...
omardabookwyrm's user avatar
0 votes
1 answer
52 views

Can you import a class from a sub-directory (from library.directory import subdirectory.class)?

Can you import a class from a sub-directory like from library.directory import subdirectory.class? Let's take Selenium as an example. Its file structure is like this: selenium webdriver support ui ...
The Amateur Coder's user avatar

15 30 50 per page
1
2 3 4 5
28