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

#1 2012-01-31 19:34:00

tunasushi
Scratcher
Registered: 2009-10-07
Posts: 15

A GUI python program to send broadcasts to computers

The command line version has existed for some time, so I decided to make a Python script that can send broadcasts to any computer with Scratch Remote Sensor Connections enabled (that is of course on your network). I made a page on the Scratch Wiki on how to do it, so that it becomes more widespread than this forum thread that *knock on wood* probably will get like 2 views. Here is the tutorial: http://wiki.scratch.mit.edu/wiki/Commun … with_a_GUI

Offline

 

#2 2012-01-31 20:14:49

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

Re: A GUI python program to send broadcasts to computers

When I ran it, I got:

Code:

(location, beginning line stuff) python connect.py
connecting...
(I inserted the IP here)
connected
Traceback (most recent call last):
  File "connect.py", line 21, in <module>
    a.append(chr((n >> 24) & 0xFF))
NameError: name 'n' is not defined

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

 

#3 2012-01-31 21:08:54

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

Re: A GUI python program to send broadcasts to computers

gbear605 wrote:

When I ran it, I got:

Code:

(location, beginning line stuff) python connect.py
connecting...
(I inserted the IP here)
connected
Traceback (most recent call last):
  File "connect.py", line 21, in <module>
    a.append(chr((n >> 24) & 0xFF))
NameError: name 'n' is not defined

What version of Python are you using? Cause n was clearly defined.  hmm

Offline

 

#4 2012-02-01 22:53:54

tunasushi
Scratcher
Registered: 2009-10-07
Posts: 15

Re: A GUI python program to send broadcasts to computers

gbear605 wrote:

When I ran it, I got:

Code:

(location, beginning line stuff) python connect.py
connecting...
(I inserted the IP here)
connected
Traceback (most recent call last):
  File "connect.py", line 21, in <module>
    a.append(chr((n >> 24) & 0xFF))
NameError: name 'n' is not defined

As Magnie said, you should state the Python version. Also, what OS are you using? I have also noticed that you might be using a different version of the code, it should say connecting and connected after you enter the IP, at least for the GUI version.

Offline

 

Board footer