Getting information 'randomly' placed inside a string

getting information in science
giving information in communication
giving and taking information
4 methods of collecting information
what are the various methods of information gathering?
to get and give information in communication
gathering information example
giving information definition

I need to extract information from this string (was bytes, but I decoded it):

\x00\x00\x00!broadcast "updatedirection 126.0"

I need to see whether it contains broadcast, updatedirection and also see what the number is at the end. My first solutions were:

data = data.split('!')
data = data[1]

but the symbol in that position seemed to change randomly and with no apparent pattern at all. Then I tried:

data = data[12:]

But the string length changed all the time, so that didn't work.

I am doing this for a computer science project in school where I am using BYOB (based on Scratch, a simple language to teach young people how to program) and sockets to send data between them to make a LAN multiplayer. This is literally the only thing that doesn't work yet.

Hope someone can give me a solution to find this data.

You could hit it with a hammer

import re

s = '\x00\x00\x00!broadcast "updatedirection 126.0"'
pat = re.compile(r'(?:\x00){3}\Wbroadcast "updatedirection ([\d.]+)"')
m = pat.match(s)
if m:
    print( # '126.0'

Checking for different cases,

s = '\x00\x00\x00#broadcast "updatedirection 126.0"'
pat.match(s).group(1) # '126.0'

s = '\x00\x00\x00!foo "bar 126.0"'
pat.match(s) # None

You could make it more robust by changing the first part for null bytes of regex to something like giving it a range(?:\x00){m,n} or something similar.

Getting and Giving Information, Getting and Giving Information is probably the #1 competency required of leaders​. If you cannot communicate effectively, then no other leadership skill will  There are many ways to get information. The most common research methods are: literature searches, talking with people, focus groups, personal interviews, telephone surveys, mail surveys, email surveys, and internet surveys. A literature search involves reviewing all readily available materials. These materials can include internal company information, relevant trade publications, newspapers, magazines, annual reports, company literature, on-line data bases, and any other published materials.

To check if a string contains a word:

if word in string:

Then I would use rfind() to find where the last space is, extract the text after this space and check whether it is a number.

You can test for both words in a single statement:

str = "test it here"

if "test" in str and "here" in str:
    print("they are")

Getting to the source: Where can I get more information?, Chapter 8 - Getting and Giving Information. This competency enables a learner to​: Develop an understanding of the types of communication--verbal, written and  Use the Settings App to Check Basic Info. If you just need a basic overview of your system, you can find it in your Settings app in Windows 8 or 10. Hit Windows+I to open the Settings app, and then click the “System” icon. On the System page, switch to the “About” tab on the left. On the right, you’ll find two pertinent sections.

Try this,

import re

s = '\x00\x00\x00!broadcast "updatedirection 126.0"'

# if 'broadcast' in s  and 'updatedirection' in s:
if all([item in s for item in ['broadcast', 'updatedirection']]):
    result = re.findall('[-+]?\d*\.\d+|\d+', s)  # extract all numbers from a string

    print(result[-1]) # the last number
    # Output

Refer to re.findall.

a way of getting information | English examples in context, With your stuffy nose and scratchy throat, the idea sounds appealing — but you need more information about side effects, drug interactions, and the supporting  Information definition is - knowledge obtained from investigation, study, or instruction. How to use information in a sentence.

Sources Of Information For Study, High quality example sentences with “a way of getting information” in context from reliable sources - Ludwig is the linguistic search engine that helps you to write  Get information about schools. This is a register of schools and colleges in England. You can search for and download information on establishments, establishment

to find out information, To get a fuller idea of the event you may look at more than one primary source of information – taking into account biases, points-of-view and personal or cultural  Taxpayers can complete and send either Form 4506-Tor Form 4506T-EZto the IRS to get one by mail. They use Form 4506-T to request other tax records: tax account transcript, record of account, wage and income and verification of non-filing. These forms are available on the Forms, Instructions and Publicationspage on

Informational Interviewing: Getting Information You Can Use, find. verb. to discover something, or to see where it is by searching for it. find. verb. to discover something by chance · read. verb. to get information from books,​  GettingOut by Telmate helps friends or family connect with incarcerated inmates.

  • Use a regular expression
  • import re print re.findall('!broadcast "updatedirection [\d.]+"', INPUT)