![]() |
|
[Python] How can i edit a file without extension? [Python3] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] How can i edit a file without extension? [Python3] (/showthread.php?tid=5095365) |
How can i edit a file without extension? [Python3] - ilikepython - Dec 15, 2015 this is what i've tried, seems the most simplest way to me: Code f = open ("C:\users\user\desktop\noextension","w+") #This shows no errorAny suggestions? * - bbbysmth - Dec 15, 2015 Quote:How can i edit a file without extension? [Python3] I'm guessing you edit the same way you would edit a file with an extension. * - RootBite - Dec 15, 2015 Hmm. well that means it has insufficient permissions probably. try just "w" not "w+". If not, see if you can find the file extension * - NON- - Dec 15, 2015 It shouldn't have a problem reading a file that doesn't have an extension. I just double checked it for myself. Code @pandora:~$ cat noextIf you want to create the file using Python first, then I would recommend using... Code import os; os.mknod("newfile.txt")* - Pseudonym - Dec 16, 2015 I think that backslashes in path should be all escaped. Try it with ("C:\\users\\user\\desktop\\noextension","w+") |