0

I am new to repl.it and I was trying to print the python version using this code Print Version of the Python Running on the Machine

Here's the code:

import sys
print("Python version")
print (sys.version)
print("Version info.")
print (sys.version_info)

but it prints absolutely nothing. Trying to do the same thing onto Jupyter Notebook and my code works. While I know I can print the version directly from the shell tab out there but I was wondering what's wrong with my code and why it isn't working with repl.it

This seems to be the same for user input as well where I try to do

name = input("Print my name?\n")

but it prints absolutely nothing onto the console. I am sure someone here must know what am I missing here. Sorry if this is a noob question.

siricat
  • 13
  • 4

1 Answers1

1

"Help! My REPL won't run"

Here are six reasons your Python REPL.it environment may not be working.

Checklist to fix common problems

  1. Have you configured your Run ▶️? Run button on REPL.it
    Repl.it doesn't automatically run your current working document. Configuring your Run ▶️ button will enable replit to know what to do when you hit the button.
    Configuring the "Run" Button
    A file named .replit can be added to any repl in order to customize the behavior of the "Run" button. Written in toml, a .replit file looks something like:

    run = "<run command here>"
    language = "<repl language>" # optional
    

    In the snippet above, run is a string which will be executed in the shell whenever you hit the "Run" button. The language helps the IDE understand how to provide features like packaging and code intelligence. This is normally configured for you when you clone from a Git repository.
    The .replit file can also provide other configuration hints. The full specification is provided below:

    • run: Command that is executed when the run button is clicked
    • language: Reserved
    • onBoot: Command that is executed once when the repl first starts up
    • packager.afterInstall: Command that is executed after a new package is installed
    • packager.ignoredPaths: List of paths to ignore while attempting to guess packages (More about installing packages)
    • packager.ignoredPackages: List of modules to never attempt to guess a package for, when installing packages (More about installing packages)

    Example .replit File

    run="python main.py"
    language="python3"
    onBoot="echo Booting up!"
    
    [packager]
    afterInstall="date >> package_install_log"
    ignoredPaths=[".git"]
    ignoredPackages=["twitter", "discord"]
    
  2. Attempt running the *.py script through the interactive shell instead of console. Screen recording of running the Python script in shell If the script runs in console, you may be needing to diagnose the shell. See choices below.

  3. Check that the Browser Developer Console is not showing any errors Screenshot of developer console If you see errors, you may be having issues with your browser or extensions. Try disabling browser extensions temporarily.

  4. REPL.it relies on Google Cloud Platform services for its backend functionality and sometimes those servers are unresponsive. Check the REPL.it status page or the REPLIT Twitter account to see if they're having a GCP backend service outage. If they haven't updated recently, they may be responding to an unreported outage. Check Google's own GCP status page here. You can also Tweet at the CEO of Repl.it here.

  5. Try refreshing the REPL.it environment locally. Clear the console output and scroll-back by using the ✖️ next to the search icon . clear your console
output Also, try exiting the Python REPL with exit() to see if it will respond. type exit() to terminate the active Python repl

  6. If #5 doesn't work, try an empty-cache hard reload.screenshot of hard reload in Google Chrome browser This can help to expunge unresponsive javascript, broken html, misbehaving css, and any unmetabolized toxins from the bowels of your browser.

Mavaddat Javid
  • 491
  • 4
  • 19