Ask coding questions

← Back to all posts
Change language of repl
ruiwenge2 (1183)

If I had a Python repl, how can I change the language to HTML without deleting it?

Comments
hotnewtop
JBloves27 (1903)

You could make a .replit file, add the following code: run = "html {filename}.html". Just replace the {filename} with the html file name and you should be good to go.

Hope this helps!

ruiwenge2 (1183)

@JBloves27 it just says the command isn’t found

Bluelight4251 (11)

@ruiwenge2 I'm not sure if you can do that but view this replit here. It's called 'Python but it's JavaScript' Here's the link: https://replit.com/@RayhanADev/Python-but-its-Javascript?c=79349

Hope this helps.

JakeHu2020 (34)

I don't think replit has an option to do that

InvisibleOne (3224)

You can jank you way around it like the other people said, but it's much better in the long run just for you to copy and paste the code into an actual HTML repl

MadMath123 (343)

Make a new repl (HTML in this case), and copy/paste your code into the new repl.

ruiwenge2 (1183)

@MadMath123 no look at the question, i meant how to change the language of the same repl

ch1ck3n (2380)

add a file called .replit and add language="html" to it

ruiwenge2 (1183)

@ch1ck3n then what should I put for run?

[deleted]

@ruiwenge2 replit says: run = "echo hello world"

[deleted]

@ch1ck3n if a chicken is a chicken then what is a ch1ck3n

[deleted]

@ch1ck3n EPIC comeback right there

[deleted]

@ch1ck3n are u a potato or a chicken god?

[deleted]

@ch1ck3n so ur the poch1ck3n god?

[deleted]

@ch1ck3n oh wow I never thought I might be able to meet you! Ur so amazing! My goodness I'm talking with a GOD!!!!! oh wait @Coder100 is the coder god. :(

ch1ck3n (2380)

@Aphmeta You better savor the moment

[deleted]

@ch1ck3n gulp nervous --> silently worrying

[deleted]

@ch1ck3n @ruiwenge2 well say say I'm talking to 2 of the greatest legends on replit. wow

ch1ck3n (2380)

@Aphmeta actually you were talking to my doge

this is me now

so you were talking to 3 gods

[deleted]

@ruiwenge2 well sort of also how did u get so many cycles dude(or girl, lady, man, boi, boy, person, human, alien, elder, for that matter)

[deleted]

@ch1ck3n GOSH this man is insane. he should be the most popular person on Reddit

[deleted]

@ch1ck3n dude im like legit chatting so hard to grind for cycles exhausted

[deleted]

@ruiwenge2 @ch1ck3n dang this chat is so long

[deleted]

@ruiwenge2 legend in the python community with @ch1ck3n

[deleted]

@ch1ck3n SHEESH!

[deleted]

@ch1ck3n

According to Linus Torvalds:

"Long chats = great programmers." (he never said that tho)(im only making it up to comfort my sad soul)

[deleted]

@ch1ck3n um bye gtg

[deleted]

@codingjlu what a cacophony of annoyingness

codingjlu (483)

@Aphmeta did you use that word just to use it?

[deleted]

@codingjlu "use to use it" 🤔 is that even common sense?

[deleted]

@codingjlu facepalm

[deleted]

Super long answer: NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO!!! OK, why? Well, there is always going to be a file that the console looks for, like index.html for HTML and main.py for Python, and if it doesn't find it, it won't run.

The only way to change the file is to delete the existing ones, then add a new one in the language that you wanted, but then it will say repl died unexpectedly because it can't find the main file.

codingjlu (483)

Short answer: no. Long answer: noooooooooooooooo. You can't. Just copy and paste the code, or put your code on Github, clone it, and select your language from there.

[deleted]

@codingjlu I feel like I'm the only person on replit who doesn't use github sad

codingjlu (483)

@Aphmeta lol there are plenty I bet

QuantumCodes (26)

@Aphmeta @codingjlu i dont have lol becauee i dont get the point of having github when i have replit

QuantumCodes (26)

@codingjlu uhmm.. its the same as replit right? Just with better collaboration features? Anyways i dont have enough knowledge to contribute anywhere

codingjlu (483)

@QuantumCodes on github you can't run code. It's famous for free storage, open source projects, and its git features.

QuantumCodes (26)

@codingjlu i cant run then no use of storage,.

QuantumCodes (26)

@codingjlu replit has git, code saving, collabing... then i dont see any use on github

codingjlu (483)

@QuantumCodes Replit doesn't have Git, nor does it have unlimited storage.

codingjlu (483)

@QuantumCodes also, that's replit connecting to github, so in the end it's still github

QuantumCodes (26)

@codingjlu lol, but i am able to use without connecting my account..

codingjlu (483)

@QuantumCodes what lol git what do you mean? I think you're not talking about git.

QuantumCodes (26)

@codingjlu ok nevermind... leave this arguement. I was talking about: i am able to use version control without connecting to github

[deleted]

@QuantumCodes ya me too :D

[deleted]

@Bluelight4251 lets go! we got another anti github person

codingjlu (483)

@Aphmeta anti-github?? Github is the best! You probably don't really know what Github is...

[deleted]

@codingjlu its a hosting website thingy where people share code but cant run it

codingjlu (483)

@Aphmeta not just that. You forgot about Git.

codingjlu (483)

@ruiwenge2 we should improve our project xD

[deleted]

@codingjlu what is git im dumb dumb

[deleted]

@codingjlu I freakin dont have google im in china for the summer

Bluelight4251 (11)

@Aphmeta I don't have a GitHub account.

dmacmakes (0)

@codingjlu I cloned my repo from github to repl and it didn't ask for a language. It tried to autodetect it and failed, leaving it as a bash repo. How were you able to select your language in the clone process?