0

I want to make my txt file hidden cross platform,but everything I found didn't work for me. Can someone help me in my situation please.

file = open("helloworld.txt","a")
file.write("HELLO WORLD")
file.close()
return

so thats a simple version of my code,how do I make helloworld.txt hidden,with something like a file format.

  • 1
    Your version of code does not include anything that would make the file hidden, could You add what You tried and what failed? Also I doubt that it would be a cross platform solution. One way would be to use pyautogui. – Matiiss Apr 18 '21 at 02:55
  • 1
    Does this answer your question? [How can I make a file hidden on Windows?](https://stackoverflow.com/questions/43441883/how-can-i-make-a-file-hidden-on-windows) – Matiiss Apr 18 '21 at 02:57
  • no,I want it to be crossplatform –  Apr 18 '21 at 16:51
  • ok, but You can just use OS detection (probably a `try/except` will suffice) and apply different methods, for windows the one above for the rest I don't know – Matiiss Apr 18 '21 at 18:00
  • intersting I guess –  Apr 18 '21 at 18:30

0 Answers0