I have a file called myFile.py on my desktop. This is the file:
class Node:
def __init__(self, data, next):
self.data = data
self.next = next
def __str__(self):
self = node
while node.next:
print(node.data)
node = node.next
return node.data
I normally edit the file in IDLE. In IDLE I can click Run->Run Module (F5) to run the file. After clicking "Run Module" in IDLE, it opens up the python shell and I can create a Node and work with the current file.
I don't use IDLE any more (I use GVim to type / edit code). Is it possible with GVim to run the current open file in the python shell?
I tried doing
:!python3 %
but when I do this, GVim just says:
Press ENTER or type command to continue
and when I press enter, nothing happens.
Note: I am using Python3.