Attach a file to a code | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
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.

11th Sep 2018, 9:07 PM
Marc Maurer
Marc Maurer - avatar
2 Respostas
+ 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
11th Sep 2018, 11:48 PM
šŸŒ“Vincent BergeršŸŒ“
šŸŒ“Vincent BergeršŸŒ“ - avatar
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.
12th Sep 2018, 3:30 AM
Marc Maurer
Marc Maurer - avatar