Hi all,
I receive the string messages from my Mobile via UDP as below:
A, 0.1, 0.6, 0.7
B, 0.2, 0.3, 0.8
I want to arrange them to two array as below:
a = (0.1, 0.6, 0.7)
b = (0.2, 0.3, 0.8)
all the number are float.
Thanks!
Paul Z
___
Tutor mailli
On 20/02/16 09:15, Paul Z wrote:
> Hi all,
>
> I receive the string messages from my Mobile via UDP as below:
> A, 0.1, 0.6, 0.7
> B, 0.2, 0.3, 0.8
I think we need a bit more detail.
How do you receive these messages? UDP requires some
kind of receiving service, so what is it that is
receiving th
Hi,
I writed some codes as the UDP messages:
import socket
import random
from array import *
port = 8088
host = "localhost"
s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
num = array('f')
x = 0
while x < 6:
num.append(random.random())
x += 1
a0 = str("%.2f"%num[0]) + ','
a1 = st
Paul Z wrote:
> Hi,
>
> I writed some codes as the UDP messages:
>
> import socket
> import random
> from array import *
>
> port = 8088
> host = "localhost"
>
> s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
>
> num = array('f')
> x = 0
> while x < 6:
> num.append(random.random())
> x +
On 20/02/16 13:23, Paul Z wrote:
> Hi,
>
> I writed some codes as the UDP messages:
>
> import socket
> import random
> from array import *
>
> port = 8088
> host = "localhost"
>
> s = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
>
> num = array('f')
> x = 0
> while x < 6:
> num.append
I want learn Python programming. Many years ago I taught myself BASIC so
I have some programming experience.
I have installed Python 2.7.11 and Notepad ++ on my Win 7 computer. I
have also edited the PATH variable to include C:\Python27.
However I am unable to run any scripts.
When I type (
On 20 February 2016 at 17:25, Erol Gericke wrote:
> I want learn Python programming. Many years ago I taught myself BASIC so I
> have some programming experience.
>
> I have installed Python 2.7.11 and Notepad ++ on my Win 7 computer. I have
> also edited the PATH variable to include C:\Python27.
On 20/02/16 16:25, Erol Gericke wrote:
> However I am unable to run any scripts.
>
> When I type (into the COMMAND PROMPT window) python test.py or
> python C:\python27\test.py I get SyntaxError: invalid syntax
As Chris has hinted it sounds like you are running the script
at the wrong comma