To create a file from terminal I type the following...
$ touch filename.py
To open the file I just created from terminal, I then type...
you can use:
cat > youNewFile.someExtension
Example:
cat > myNewFile.txt
After you are done press Ctrl + d to save or Ctrl + c to abort (but in this case it's gonna save an empty file. The redirection operator ( > ) will create the file if it doesn't already exists in your folder and you will be able to edit it right a way through the terminal.