0
Attach a file to a code
Dear all, is it possible to add a txt file to some code? Because my code wonât work without such a file. It should be the same directory, to keep it simple. Thank you and have a great night.
2 Answers
+ 2
Hi Marc Maurer,
You did not assign any language to your question.
Do you need to work with the file like delete, insert, remove, etc.. etc..?
Hope this helpsđ
In PHP to echo out the textfile.txt::
<?php
echo file_get_contents("YOUR_TEXT_FILE.txt");
?>
https://secure.php.net/manual/en/function.file-get-contents.php
0
Hi Vincent Berger,
my language is Python, but my question was about Sololearn. When I post a code here in the Playground, is it possible to add a txt file to work with? I need it as input for my code.