Problem description:
Python 3: Nothing is outputting to the console when I call functions in the console
Expected behavior:
Calling a function should return the functions output
Actual behavior:
Calling the function does nothing
Bug appears at this link:
https://replit.com/@CSPR23/The-Random-Library-Project#main.py
1 Like
@LaurenTan Prybar was removed from the default Python template. Instead, if you put python3
in front of any command in the console, it will work. For your case, run this in the console:
python3 flip()
Or, if you’d like to directly use it, check out this post:
Hello Replit users,
Replit is updating the default run button behavior for Python and Node.js Repls. Python Repls will now use the python3 executable to execute your code and Node.js Repls will use the node executable.
Wait, it didn’t do that before?
An artifact of Replit’s origins, Python 3 and Node.js Repls’ run button has been configured to use prybar - which in turn delegates execution to the python3 and nodejs interpreters. prybar is a multi-language REPL (that’s read-evaluate-print-lo…
1 Like
That shouldn’t work, since that’s not a builtin function.
2 Likes
I tried that, but I am getting the following error:
bash: syntax error near unexpected token `(’
1 Like
I tried that, but I am getting the following error:
bash: syntax error near unexpected token `(’
1 Like
Run python3 -i main.py
in the console, or just use the prybar template.
5 Likes
Hi @LaurenTan !
Since @CoderElijah 's post solved your issue, could you mark that post as a Solution?
3 Likes
Just for completion’s sake, Replit Staff released a python+prybar template:
@ParkerGriffith I see. You can either start with the Prybar template . Or your can add:
modules = ["python-with-prybar-3.10:v2-20230925-77b13e4"]
to the top of .replit and remove most of what’s currently in it. Or simply replace it with:
entrypoint = "main.py"
modules = ["python-with-prybar-3.10:v2-20230925-77b13e4"]
hidden = [".pythonlibs"]
[nix]
channel = "stable-23_05"
because you don’t need most of what the existing contents anyway.
3 Likes
system
Closed
October 4, 2023, 11:44pm
11
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.