can i run html code in python? | Sololearn: Learn to code for FREE!

+3

can i run html code in python?

I observed that I can run HTML code in python on Sololearn with following code: print('<h1>python</h1>') import os os.system('touch file.png') why is that so? It doesn't work on other IDEs.

10/26/2021 4:14:58 PM

Harsha S

7 Answers

New Answer

+3

sololearns system is linux based. Hence, the 'touch' command. Your os my not be a linux distro

+2

Slick is there a way to run it in windows?

+2

There's no touch in windows but you could use fsutil: fsutil file createnew filename  requiredSize just sub in the options and use it as a string to feed to os.system() read about it here: https://www.windows-commandline.com/create-empty-file/

+2

On windows you can use "echo > filename to create files using powershell

+1

Harsha S please stop mentioning me and people in your questions

0

michal ok

0

https://www.facebook.com/groups