Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 893939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:18:04+00:00 2026-05-15T14:18:04+00:00

Hey all. Trying to get a little more efficient with lists in Python but

  • 0

Hey all. Trying to get a little more efficient with lists in Python but I cant seem to figure out if I can do what I want or even if it is worth figuring out.

stream is a list. Each item in the list is something like :

10,123400FFFE001DB9AA

I am trying to get to the second part of each item after the comma so I run through the list splitting each one and storing it in temp . I them append temp[1) to the other list called incoming_data.

I would like to combine the line that splits and saves to temp and appends to the incoming_data list into one line, something like:

incoming_data.append(item.split(‘,’))

I know the above syntax is totally incorrect but I hope it gets the point across. Here is my current code.

Other critiques welcome as usual. Thanks!

#init the final list
incoming_data = list()

#iterate over each item in the list
for item in stream:

      #clear the temp variable for next time
      temp = ''

      #we sometimes get blank items in the stream list so check first
      if item <> '':

             #split each item in the stream list using the comma as delimiter
             temp = item.split(',')

             #append to the final data lis
             incoming_data.append(temp[1])
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:18:05+00:00Added an answer on May 15, 2026 at 2:18 pm
    incoming_data = [item.split(",")[1] for item in stream if item]
    

    The if item discards the blank lines in stream.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all i am in need of some help trying to figure out how
Hey all i am trying to figure out how to go about calculating this
Hey all. Im trying to sort out how to get MATLAB running as best
Hey all, i am trying to figure out how to calculate the wage for
Hey all. I can't for the life of me seem to get this blasted
hey all, I'm very confused here, i've been trying to figure this one out.
Hey all, I'm trying to get the MKMapView up and running however I can't
Hey all, i am in need of some help trying to figure out why
Hey all, i have a problem with trying to get 2 forms to close
Hey all i am trying to figiure out why my code is not triggering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.