Python Script Error in Windows 7
<p>I am trying to run this following script in here and getting this NameError. I have added path variable in Windows 7. </p>

<pre><code>C:\Users\myname&gt;python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

&gt;&gt;&gt; script.py
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
NameError: name 'script' is not defined
</code></pre>

<p>This is the script I am trying to run : </p>

<pre><code>#!/usr/bin/python
import sys, string, time
from socket import *
host = "192.168.0.98"
port = 80
print "Open TCP connections to: %s, port %s" % (host, port)
while (1):
    s = socket(AF_INET,SOCK_STREAM)
    s.connect((host, port))
    s.send("abc")    
### test: donot close.  s.close()  
time.sleep(0.1)
print ".",
</code></pre>

<p>Thank you all. </p>

<p>you have to run your script by using this command in command prompt <br /> <em>python [Address of your script]</em></p>

python python-3.x