Get Repl URL from python

How do I get the repl url from python code?

Write this code to make webserver and get webserver url
Write this code

from flask import Flask
app = Flask('app')

def hello_world():
  return 'Hello, World!''', port=8080)

Or the repl that you made and want get that repl url
It looks like this in your editor and others

Hope it works
If it works mark it as Solution

Proper solution:

REPL_SLUG = os.getenv("REPL_SLUG")
REPL_OWNER = os.getenv("REPL_OWNER")

Don’t write your code like this
Instead write this

write you code here```

That won’t work lol. You have to it like this:


1 Like

No? This:
print(“hello world!”)

print("hello world!")

Note: IIRC adding “py” there just tells the formatter what code it is so it doesn’t have to guess.

1 Like

Wait…No to me or them?

I thought you were saying that doing ```py wouldn’t work, hang on.

1 Like

Nah I meant doing

write you code here```

wouldn’t work.

Just checking

Hmm. What about

Test ```

Nope. Has to be on a new line.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.