+ 1
How do I create file urls.py in folder named pages
Folder 'pages' was created by me, so you shouldn't mind the name of it. Could anyone explain how to create urls.py in python if the following command in terminal is not working: $ touch pages/urls.py P.S. I'm working on Windows. Also created and activated virtual environment, for the time being use django framework. Don't know if that's important... Thanks
13 Respostas
+ 3
Also, what terminal are you using? It seems that windows powershell does not have the touch command.
https://www.shellhacks.com/windows-touch-command-equivalent/
+ 2
I don't know if I am missing something but you can use the pycharm editor directly to create a file?
+ 2
+ 1
Make sure that the path is available in your virtual environment and that you have writing permissions.
+ 1
Simon Sauter I've checked the path, and it's available
+ 1
I rarely use the cmd terminal to create folders and files.
It's not like you always have to do it this way.
But here is a good reference topic:
https://stackoverflow.com/questions/30011267/create-an-empty-file-on-the-commandline-in-windows-like-the-linux-touch-command/37756874#37756874
+ 1
You can also try the Hyper terminal. In hyper terminal, you can run Linux commands
https://hyper.is/
0
Simon Sauter yeah, I'm using PyCharm terminal
0
You can install bash on windows if you want. A lot (most?) of "command line" tutorials use bash and not powershell -- sometimes without making this explicit.
https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
0
FF9900 I'd check this out right away