This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#51 2011-12-22 17:59:56

Solarbuddy
Scratcher
Registered: 2009-04-14
Posts: 500+

Re: Chat.PY and Other Features

Magnie wrote:

Solarbuddy wrote:

This is what my scripts look after I'm done:
http://troll.ws/mRoIWD
Is that right?

No.

It's When I Receive "^follow_update"

Is anyone even on it?
Is it broken?
How can you tell who's on?
Where do you see the text that I write?


http://bit.ly/Vn3zid
                  View my latest project

Offline

 

#52 2011-12-22 18:01:08

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

Solarbuddy wrote:

Magnie wrote:

Solarbuddy wrote:

This is what my scripts look after I'm done:
http://troll.ws/mRoIWD
Is that right?

No.

It's When I Receive "^follow_update"

Is anyone even on it?
Is it broken?
How can you tell who's on?
Where do you see the text that I write?

You aren't even connected. Did you run the ScratchMirror.exe?

1. I am, but no one else because only one person has successfully join the chat.
2. No it isn't
3. I can tell by the output on the server, no one else can see who is online.
4. I see it in the server and on the chat program.

Last edited by Magnie (2011-12-22 18:02:55)

Offline

 

#53 2011-12-22 18:06:51

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

I just tried connecting with the java one, and it either doesn't work on macs, or something is wrong.

Error:

Code:

java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
    at java.net.Socket.connect(Socket.java:529)
    at java.net.Socket.connect(Socket.java:478)
    at java.net.Socket.<init>(Socket.java:375)
    at java.net.Socket.<init>(Socket.java:189)
    at Mirror.main(Mirror.java:11)

Last edited by gbear605 (2011-12-22 18:08:08)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#54 2011-12-22 18:08:51

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

I just tried connecting with the java one, and it either doesn't work on macs, or something is wrong.

Hmm, what IP and port did you use?

Offline

 

#55 2011-12-22 18:11:17

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Magnie wrote:

gbear605 wrote:

I just tried connecting with the java one, and it either doesn't work on macs, or something is wrong.

Hmm, what IP and port did you use?

That came up as soon as the program started.  It didn't even say anything


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#56 2011-12-22 18:12:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

Magnie wrote:

gbear605 wrote:

I just tried connecting with the java one, and it either doesn't work on macs, or something is wrong.

Hmm, what IP and port did you use?

That came up as soon as the program started.  It didn't even say anything

I feel so stupid... Enable Remote Connections on Scratch first then try again.

Offline

 

#57 2011-12-22 18:16:32

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Oh XD


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#58 2011-12-22 18:19:09

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

Oh XD

Yeah, I had just realized.  tongue

It's broadcast "<var 1" not "var 1"

Offline

 

#59 2011-12-22 18:20:18

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Tell me if you arre getting stuff.


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#60 2011-12-22 18:22:07

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

Tell me if you arre getting stuff.

I am.  smile  You just aren't sending it correctly. It's "<var 1" to set a variable...

Offline

 

#61 2011-12-22 18:27:27

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Magnie wrote:

gbear605 wrote:

Tell me if you arre getting stuff.

I am.  smile  You just aren't sending it correctly. It's "<var 1" to set a variable...

I don't completely understand that  tongue

I'm opening up scratch while running the server, enable remote connections, and then I use the broadcast block to broadcast "<var1" or whatever (without quotes)

Also, I know it isn't scratch, but someone should make a java client for it, and release the source code.

Last edited by gbear605 (2011-12-22 18:28:59)


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#62 2011-12-22 18:29:15

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

Magnie wrote:

gbear605 wrote:

Tell me if you arre getting stuff.

I am.  smile  You just aren't sending it correctly. It's "<var 1" to set a variable...

I don't completely understand that  tongue

I'm opening up scratch while running the server, enable remote connections, and then I use the broadcast block to broadcast "<var1" or whatever (without quotes)

Did you read through the instructions?

Code:

broadcast "<var value1 value2 value3 etc"

Offline

 

#63 2011-12-22 18:32:12

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

I just tried saying something.  Did it work?


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#64 2011-12-22 18:32:54

Solarbuddy
Scratcher
Registered: 2009-04-14
Posts: 500+

Re: Chat.PY and Other Features

Ok, now this time the run program actually stayed up and not crash.  tongue
Can you see my messages?
How do you receive messages?
that
Set a Variable: <[var] [value]
Get a Variable: >[var]
Follow a Variable: ^[var]
stuff?
I don't get how to do that stuff.


http://bit.ly/Vn3zid
                  View my latest project

Offline

 

#65 2011-12-22 18:34:53

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

I just tried saying something.  Did it work?

I got stuff from Solarbuddy, but nothing from you. What mirror are you using?

Solarbuddy: What client are you using?

Code:

Overlap wait time...
Following 'chat' variable.
Overlap wait time...
Magnie has joined!
Solarbuddy: Hello?
Magnie: Hiya
Solarbuddy: la la la
Solarbuddy: lalala
Solarbuddy: hello?
Solarbuddy: Can you see this?
Magnie: Hello?
Magnie: Can you see this?

I can get your messages...

Offline

 

#66 2011-12-22 18:36:11

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Magnie wrote:

gbear605 wrote:

I just tried saying something.  Did it work?

I got stuff from Solarbuddy, but nothing from you. What mirror are you using?

Solarbuddy: What client are you using?

Code:

Overlap wait time...
Following 'chat' variable.
Overlap wait time...
Magnie has joined!
Solarbuddy: Hello?
Magnie: Hiya
Solarbuddy: la la la
Solarbuddy: lalala
Solarbuddy: hello?
Solarbuddy: Can you see this?
Magnie: Hello?
Magnie: Can you see this?

I can get your messages...

I am using the java mirror, and I'm just using scratch as a client  tongue


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#67 2011-12-22 18:37:31

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

I am using the java mirror, and I'm just using scratch as a client  tongue

The Java Mirror MathWhiz made doesn't send and receive at the same time, so it won't work with the chat project.

Offline

 

#68 2011-12-22 18:37:33

Solarbuddy
Scratcher
Registered: 2009-04-14
Posts: 500+

Re: Chat.PY and Other Features

I see my own!!!! :DDDDDD Used <Var1
I sorta get it.


http://bit.ly/Vn3zid
                  View my latest project

Offline

 

#69 2011-12-22 18:38:49

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Magnie wrote:

gbear605 wrote:

I am using the java mirror, and I'm just using scratch as a client  tongue

The Java Mirror MathWhiz made doesn't send and receive at the same time, so it won't work with the chat project.

See, I need someone to compile the python mirror for mac, because my python compiler isn't working  tongue


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#70 2011-12-22 18:41:23

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

Magnie wrote:

gbear605 wrote:

I am using the java mirror, and I'm just using scratch as a client  tongue

The Java Mirror MathWhiz made doesn't send and receive at the same time, so it won't work with the chat project.

See, I need someone to compile the python mirror for mac, because my python compiler isn't working  tongue

Just run the source code, Python is almost never compiled.

Offline

 

#71 2011-12-22 18:47:16

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

This is what I got when I tried to run it

Code:

>>> >>> # Version 1.5.0
  File "<stdin>", line 1
    >>> # Version 1.5.0
     ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CHOST is the IP Scratch is running on, if you are running it    #
... # on this computer, then the IP is 127.0.0.1                      #
... # Theoretically you could run this Mirror on another computer.    #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CPOST is the port Scratch is listening on, the default is       #
... # 42001. Usually this is only change by a Scratcher who knows a   #
... # about Squeak and networking with sockets.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... CHOST = '127.0.0.1'
>>> CPORT = 42001
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SHOST is the IP the server is running on.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SPORT is the port that the server is using. 42002 is the        #
... # unofficial port for Scratch Servers. The host will need to make #
... # sure to port-for>>> 
... >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 7
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>> Finished running.
  File "<stdin>", line 1
    Finished running.
                   ^
SyntaxError: invalid syntax
>>> >>> # Scratch Mirror
  File "<stdin>", line 1
    >>> # Scratch Mirror
     ^
SyntaxError: invalid syntax
>>> ... # Version 1.5.0
  File "<stdin>", line 1
    ... # Version 1.5.0
    ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> 
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>>

Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#72 2011-12-22 18:48:41

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

This is what I got when I tried to run it

Code:

>>> >>> # Version 1.5.0
  File "<stdin>", line 1
    >>> # Version 1.5.0
     ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CHOST is the IP Scratch is running on, if you are running it    #
... # on this computer, then the IP is 127.0.0.1                      #
... # Theoretically you could run this Mirror on another computer.    #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CPOST is the port Scratch is listening on, the default is       #
... # 42001. Usually this is only change by a Scratcher who knows a   #
... # about Squeak and networking with sockets.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... CHOST = '127.0.0.1'
>>> CPORT = 42001
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SHOST is the IP the server is running on.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SPORT is the port that the server is using. 42002 is the        #
... # unofficial port for Scratch Servers. The host will need to make #
... # sure to port-for>>> 
... >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 7
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>> Finished running.
  File "<stdin>", line 1
    Finished running.
                   ^
SyntaxError: invalid syntax
>>> >>> # Scratch Mirror
  File "<stdin>", line 1
    >>> # Scratch Mirror
     ^
SyntaxError: invalid syntax
>>> ... # Version 1.5.0
  File "<stdin>", line 1
    ... # Version 1.5.0
    ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> 
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>>

Click "File" > "New Window" paste the code into that, save it, then open up the window again and press F5.

Offline

 

#73 2011-12-22 18:49:14

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

Magnie wrote:

gbear605 wrote:

This is what I got when I tried to run it

Code:

>>> >>> # Version 1.5.0
  File "<stdin>", line 1
    >>> # Version 1.5.0
     ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CHOST is the IP Scratch is running on, if you are running it    #
... # on this computer, then the IP is 127.0.0.1                      #
... # Theoretically you could run this Mirror on another computer.    #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # CPOST is the port Scratch is listening on, the default is       #
... # 42001. Usually this is only change by a Scratcher who knows a   #
... # about Squeak and networking with sockets.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... CHOST = '127.0.0.1'
>>> CPORT = 42001
>>> 
>>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SHOST is the IP the server is running on.                       #
... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
... # SPORT is the port that the server is using. 42002 is the        #
... # unofficial port for Scratch Servers. The host will need to make #
... # sure to port-for>>> 
... >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 7
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>> Finished running.
  File "<stdin>", line 1
    Finished running.
                   ^
SyntaxError: invalid syntax
>>> >>> # Scratch Mirror
  File "<stdin>", line 1
    >>> # Scratch Mirror
     ^
SyntaxError: invalid syntax
>>> ... # Version 1.5.0
  File "<stdin>", line 1
    ... # Version 1.5.0
    ^
SyntaxError: invalid syntax
>>> ... # By: Magnie
  File "<stdin>", line 1
    ... # By: Magnie
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> import socket # Network base
  File "<stdin>", line 1
    >>> import socket # Network base
     ^
SyntaxError: invalid syntax
>>> >>> import time # For delaying purposes mostly.
  File "<stdin>", line 1
    >>> import time # For delaying purposes mostly.
     ^
SyntaxError: invalid syntax
>>> >>> import threading # So it can send and receive at the same time anytime.
  File "<stdin>", line 1
    >>> import threading # So it can send and receive at the same time anytime.
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # CHOST is the IP Scratch is running on, if you are running it    #
  File "<stdin>", line 1
    ... # CHOST is the IP Scratch is running on, if you are running it    #
    ^
SyntaxError: invalid syntax
>>> ... # on this computer, then the IP is 127.0.0.1                      #
  File "<stdin>", line 1
    ... # on this computer, then the IP is 127.0.0.1                      #
    ^
SyntaxError: invalid syntax
>>> ... # Theoretically you could run this Mirror on another computer.    #
  File "<stdin>", line 1
    ... # Theoretically you could run this Mirror on another computer.    #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # CPOST is the port Scratch is listening on, the default is       #
  File "<stdin>", line 1
    ... # CPOST is the port Scratch is listening on, the default is       #
    ^
SyntaxError: invalid syntax
>>> ... # 42001. Usually this is only change by a Scratcher who knows a   #
  File "<stdin>", line 1
    ... # 42001. Usually this is only change by a Scratcher who knows a   #
    ^
SyntaxError: invalid syntax
>>> ... # about Squeak and networking with sockets.                       #
  File "<stdin>", line 1
    ... # about Squeak and networking with sockets.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... CHOST = '127.0.0.1'
  File "<stdin>", line 1
    ... CHOST = '127.0.0.1'
    ^
SyntaxError: invalid syntax
>>> >>> CPORT = 42001
  File "<stdin>", line 1
    >>> CPORT = 42001
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # SHOST is the IP the server is running on.                       #
  File "<stdin>", line 1
    ... # SHOST is the IP the server is running on.                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... # SPORT is the port that the server is using. 42002 is the        #
  File "<stdin>", line 1
    ... # SPORT is the port that the server is using. 42002 is the        #
    ^
SyntaxError: invalid syntax
>>> ... # unofficial port for Scratch Servers. The host will need to make #
  File "<stdin>", line 1
    ... # unofficial port for Scratch Servers. The host will need to make #
    ^
SyntaxError: invalid syntax
>>> ... # sure to port-forward the port so people can connect from the    #
  File "<stdin>", line 1
    ... # sure to port-forward the port so people can connect from the    #
    ^
SyntaxError: invalid syntax
>>> ... # internet.                                                       #
  File "<stdin>", line 1
    ... # internet.                                                       #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... SHOST = raw_input("Server IP: ")
  File "<stdin>", line 1
    ... SHOST = raw_input("Server IP: ")
    ^
SyntaxError: invalid syntax
>>> Server IP: SPORT = int( raw_input("Server Port: ") )
  File "<stdin>", line 1
    Server IP: SPORT = int( raw_input("Server Port: ") )
            ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    >>> # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
     ^
SyntaxError: invalid syntax
>>> ... # Some extra settings that are more for advanced users are below. #
  File "<stdin>", line 1
    ... # Some extra settings that are more for advanced users are below. #
    ^
SyntaxError: invalid syntax
>>> ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
  File "<stdin>", line 1
    ... # ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### #
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> # Time between checking the threads for broken ones.
  File "<stdin>", line 1
    >>> # Time between checking the threads for broken ones.
     ^
SyntaxError: invalid syntax
>>> ... THREADCHECK = 5
  File "<stdin>", line 1
    ... THREADCHECK = 5
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
  File "<stdin>", line 1
    >>> class Client(threading.Thread): # This class listens for messages sent from Scratch and sends it to the Server.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, CHOST, CPORT):
  File "<stdin>", line 1
    ...     def __init__(self, CHOST, CPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
  File "<stdin>", line 1
    ...         self.sock.connect((CHOST, CPORT)) # Connect to Scratch
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Scratch!")
  File "<stdin>", line 1
    ...         print("Connected to Scratch!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):
  File "<stdin>", line 1
    ...     def run(self):
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Scratch messages."
  File "<stdin>", line 1
    ...         print "Listening for Scratch messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from Scratch.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         server.sock.send(message) # Send the data to the server.
  File "<stdin>", line 1
    ...         server.sock.send(message) # Send the data to the server.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
  File "<stdin>", line 1
    >>> class Server(threading.Thread): # This class listens for messages from the Server and sends it to Scratch.
     ^
SyntaxError: invalid syntax
>>> ...     def __init__(self, SHOST, SPORT):
  File "<stdin>", line 1
    ...     def __init__(self, SHOST, SPORT):
    ^
SyntaxError: invalid syntax
>>> ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
  File "<stdin>", line 1
    ...         threading.Thread.__init__(self) # Initialize it, basically just separate it from the main thread.
    ^
SyntaxError: invalid syntax
>>> ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
  File "<stdin>", line 1
    ...         self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Defines the type of connection ( UPD, TCP on IPv4 or IPv6 )
    ^
SyntaxError: invalid syntax
>>> ...         print("Connecting to Scratch Server...")
  File "<stdin>", line 1
    ...         print("Connecting to Scratch Server...")
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
  File "<stdin>", line 1
    ...         self.sock.connect((SHOST, SPORT)) # Connect to the Server.
    ^
SyntaxError: invalid syntax
>>> ...         print("Connected to Server!")
  File "<stdin>", line 1
    ...         print("Connected to Server!")
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...         self.alive = 1
  File "<stdin>", line 1
    ...         self.alive = 1
    ^
SyntaxError: invalid syntax
>>> ...         
  File "<stdin>", line 1
    ...         
    ^
SyntaxError: invalid syntax
>>> ...     def run(self):   
  File "<stdin>", line 1
    ...     def run(self):   
    ^
SyntaxError: invalid syntax
>>> ...         global running
  File "<stdin>", line 1
    ...         global running
    ^
SyntaxError: invalid syntax
>>> ...         print "Listening for Server messages."
  File "<stdin>", line 1
    ...         print "Listening for Server messages."
    ^
SyntaxError: invalid syntax
>>> ...         while running:
  File "<stdin>", line 1
    ...         while running:
    ^
SyntaxError: invalid syntax
>>> ...             try:
  File "<stdin>", line 1
    ...             try:
    ^
SyntaxError: invalid syntax
>>> ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
  File "<stdin>", line 1
    ...                 data = self.sock.recv(1024) # Listens for messages sent from the Server.
    ^
SyntaxError: invalid syntax
>>> ...                 self.send(data)
  File "<stdin>", line 1
    ...                 self.send(data)
    ^
SyntaxError: invalid syntax
>>> ...             except:
  File "<stdin>", line 1
    ...             except:
    ^
SyntaxError: invalid syntax
>>> ...                 self.alive = 0
  File "<stdin>", line 1
    ...                 self.alive = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def send(self, message):
  File "<stdin>", line 1
    ...     def send(self, message):
    ^
SyntaxError: invalid syntax
>>> ...         scratch.sock.send(message) # Sends messages to Scratch.
  File "<stdin>", line 1
    ...         scratch.sock.send(message) # Sends messages to Scratch.
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     def disconnect(self):
  File "<stdin>", line 1
    ...     def disconnect(self):
    ^
SyntaxError: invalid syntax
>>> ...         self.sock.close()
  File "<stdin>", line 1
    ...         self.sock.close()
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> running = 1
  File "<stdin>", line 1
    >>> running = 1
     ^
SyntaxError: invalid syntax
>>> >>> server = Server(SHOST, SPORT) # Start up the class for Server
  File "<stdin>", line 1
    >>> server = Server(SHOST, SPORT) # Start up the class for Server
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'SPORT' is not defined
  File "<stdin>", line 1
    NameError: name 'SPORT' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> server.start() # This starts the 'run' function on the class as well.
  File "<stdin>", line 1
    >>> server.start() # This starts the 'run' function on the class as well.
     ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 1, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
  File "<stdin>", line 1
    >>> scratch = Client(CHOST, CPORT) # Start up the class for Scratch
     ^
SyntaxError: invalid syntax
>>> Connecting to Scratch...
  File "<stdin>", line 1
    Connecting to Scratch...
                ^
SyntaxError: invalid syntax
>>> Connected to Scratch!
  File "<stdin>", line 1
    Connected to Scratch!
               ^
SyntaxError: invalid syntax
>>> >>> scratch.start() # This starts the 'run' function.
  File "<stdin>", line 1
    >>> scratch.start() # This starts the 'run' function.
     ^
SyntaxError: invalid syntax
>>> Listening for Scratch messages.
  File "<stdin>", line 1
    Listening for Scratch messages.
                ^
SyntaxError: invalid syntax
>>> 
>>> >>> 
  File "<stdin>", line 1
    >>> 
     ^
SyntaxError: invalid syntax
>>> >>> while running:
  File "<stdin>", line 1
    >>> while running:
     ^
SyntaxError: invalid syntax
>>> ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
  File "<stdin>", line 1
    ...     time.sleep(THREADCHECK) # The longer the wait time, the less CPU is used I think.
    ^
SyntaxError: invalid syntax
>>> ...     if scratch.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if scratch.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     if server.alive != 1: running = 0
  File "<stdin>", line 1
    ...     if server.alive != 1: running = 0
    ^
SyntaxError: invalid syntax
>>> ...     
  File "<stdin>", line 1
    ...     
    ^
SyntaxError: invalid syntax
>>> ...     if running == 0:
  File "<stdin>", line 1
    ...     if running == 0:
    ^
SyntaxError: invalid syntax
>>> ...         running = 0
  File "<stdin>", line 1
    ...         running = 0
    ^
SyntaxError: invalid syntax
>>> ...         server.disconnect() # Tell the server thread to disconnect
  File "<stdin>", line 1
    ...         server.disconnect() # Tell the server thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ...         scratch.disconnect() # Tell the scratch thread to disconnect
  File "<stdin>", line 1
    ...         scratch.disconnect() # Tell the scratch thread to disconnect
    ^
SyntaxError: invalid syntax
>>> ... 
  File "<stdin>", line 1
    ... 
    ^
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
  File "<stdin>", line 1
    Traceback (most recent call last):
                         ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 4, in <module>
  File "<stdin>", line 1
    File "<stdin>", line 4, in <module>
    ^
IndentationError: unexpected indent
>>> NameError: name 'server' is not defined
  File "<stdin>", line 1
    NameError: name 'server' is not defined
             ^
SyntaxError: invalid syntax
>>> >>>         server.join() # End the server thread.
  File "<stdin>", line 1
    >>>         server.join() # End the server thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     server.join() # End the server thread.
  File "<stdin>", line 1
    server.join() # End the server thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    >>>         scratch.join() # End the scratch thread.
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     scratch.join() # End the scratch thread.
  File "<stdin>", line 1
    scratch.join() # End the scratch thread.
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>         print 'Error Check: Yes.'
  File "<stdin>", line 1
    >>>         print 'Error Check: Yes.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     print 'Error Check: Yes.'
  File "<stdin>", line 1
    print 'Error Check: Yes.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    >>>     else: print 'Error Check: No errors.'
     ^
SyntaxError: invalid syntax
>>>   File "<stdin>", line 1
  File "<stdin>", line 1
    File "<stdin>", line 1
    ^
IndentationError: unexpected indent
>>>     else: print 'Error Check: No errors.'
  File "<stdin>", line 1
    else: print 'Error Check: No errors.'
    ^
IndentationError: unexpected indent
>>>     ^
  File "<stdin>", line 1
    ^
    ^
IndentationError: unexpected indent
>>> IndentationError: unexpected indent
  File "<stdin>", line 1
    IndentationError: unexpected indent
                    ^
SyntaxError: invalid syntax
>>> >>> print "Finished running."
  File "<stdin>", line 1
    >>> print "Finished running."
     ^
SyntaxError: invalid syntax
>>>

Click "File" > "New Window" paste the code into that, save it, then open up the window again and press F5.

Works now!


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#74 2011-12-22 18:55:37

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Chat.PY and Other Features

BTW, you should make it so the mirror doesn't say that there are no errors, it should only says if there are errors XD


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#75 2011-12-22 18:56:39

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Chat.PY and Other Features

gbear605 wrote:

BTW, you should make it so the mirror doesn't say that there are no errors, it should only says if there are errors XD

Yeah, that was meant for debugging.  tongue

Offline

 

Board footer