0

I am using Intellij IDEA for Python. There is a terminal inside the IDE, on which I tried to run a command for making text file. I ran the command:

type null > HelloWorld.txt

It showed an error, but it worked correctly. The text file was created but it showed the following error (This problem is only in Intellij IDEA, it works correctly on command prompt):

type : Cannot find path 'D:\KARTEEK\document space\school\Class-7\My Python Projects\Kivy GUI\null' because it does not exist.
At line:1 char:1
+ type null > HelloWorld.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\KARTEEK\docu...s\Kivy GUI\null:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

But the file was made. Please help

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • I get the same error in the system terminal: https://i.imgur.com/7On92J0.png. Why don't you just use `cat HelloWorld.txt`? – CrazyCoder Feb 01 '22 at 16:48
  • Can you explain what the 'cat' command is? It is neither working in Intellij terminal, nor in the command prompt. I am using Windows as the operating system (if that helps you). – PythonBeginner Feb 02 '22 at 09:27
  • It shows: cat : Cannot find path *the path* because it does not exist. At line:1 char:1 + cat HelloWorld.txt + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (D:\KARTEEK\docu...\HelloWorld.txt:String) [Get-Content], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand – PythonBeginner Feb 02 '22 at 09:29
  • Try other options: https://stackoverflow.com/questions/1702762/how-can-i-create-an-empty-file-at-the-command-line-in-windows. – CrazyCoder Feb 02 '22 at 16:49
  • Thanks a lot for your kind help! – PythonBeginner Feb 04 '22 at 17:14

0 Answers0