Ask coding questions

← Back to all posts
How do I run my second file?
hvaandres (6)

Here I have two different files where I'm trying to run the second file to see if it works or not but, I'm not able to do that since is reading the file instead of the file called

lfchao (3)

Create a file named ".replit" to include

language = "python3"
run = "python3"

If your filename contains space,

run = "python3 'other'"


You will need to import the code in string_basics into the file. You can do it like so:

import string_basics
...and so on

Note that you need to prefix the sentence name with the name of the module. To geta round this you could use a different import syntax, like so:

from string_basics import *
...and so on

The import statement can be read as "from the string_basics module import all"