#๐Ÿ”’ Syntax Error invalid decimal

9 messages ยท Page 1 of 1 (latest)

feral iglooBOT
#

@hollow seal

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

high galleon
#

!paste

feral iglooBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

wind needle
#

I just got an AI chatbot to give me a simple code to produce a desktop clock. I ran pyinstaller and got the following syntax error:
"d:\Py>python clock.py
File "d:\Py\clock.py", line 1
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
^
SyntaxError: invalid decimal literal"

Attached is the code (hopefully I did this attachment right). If not let me know and I'll paste in in comments.

#

Recovered your original message

#

You can't share py files here though, you'll have to use a paste link

high galleon
#

And the error appears to be because you pasted a REPL session into a file and ran the file?

#

If you intended to "move" code from a REPL into a script file, you need to omit the stuff that gets printed at the start of the REPL session.

feral iglooBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.