Attach a repl py file to another repl

I have 2 python repls: Login authentication, and a hangman game.
Once a user has successfully logged in and confirm that he wants to play, Is there a way that my hangman game will run automatically? I’ve been googling, but cant find the right answer

Repl link:

    if Game=="y".lower():
      ##insert game here
      ##--how to add---

I don’t know of a way to link two Python Repls. You can make Repl A into a PyPi package and Repl B import the package but that is complicated and would not be effective.


I’m still starting out, and doesnt know enough of Py and making a package. I might just delete it then. Thanks though!

You could put two Py files in one Repl if you wanted. That is easy to do.

# File ""
def fun():
# File ""
from other import fun
1 Like

What am i doing wrong? file
def game():
#rest of the code

#main Py file
import os, random, time
from replit import db
from import game

Line 60
if Game==“y”.lower():


The code in following def game(): is not indented. Python is whitespace sensitive. I looked at your code, and you have two functions called game in Try deleting line 1. That should do the trick.

Done. I changed the subroutine game() to fun() and indented all code below it.
But do i have to install something? Its throwing me another one.

Change the import to just Hangman instead of

Let’s use your import for these examples.
When you include the . in the import name, python tries to import the requested import from one of two places:

  1. (Higher priority) From a file with the name Hangman it tries to find py, then import fun from py.
  2. (Lower priority) From a folder called Hangman it tries to find a file called, then import fun from that.

Thank you for pointing it out, and explaining it in detail!

1 Like

hold on @CoderElijah @Firepup650 :man_facepalming: this was a school assignment and the thing he needed to do was make separate files for import ;-;

We didn’t know that until just now.


I know but I probably should have asked xD also we should have asked for the repl link because it was really hard to do it without it

@AshWinters Please mark this as solved if we solved your problem and please don’t let people give you the answers to school assignments. We are only allowed to point you in the right direction.


We have the Repl link.

1 Like

oh I’m dumb I can’t read sorry


Preferably, mark whichever post you found the most helpful as the solution.


Is it an issue that its for my assignment? :dizzy_face:

1 Like

No worries! Thanks either way!

1 Like

yes it is an issue that it is for the assignemnt

1 Like

It should have been at least mentioned, because we are only allowed to give hints as to how to resolve your problems when it is assignments.