Python Forum
Print the number of items in a list on ubuntu terminal
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print the number of items in a list on ubuntu terminal
#1
Hey all.
In return of a command, I have the following output on my ubuntu terminal.
Output:
tshark: Display filters were specified both with "-Y" and with additional command-line arguments. 21 List of ARFCNs = 62 53 List of ARFCNs = 62 60 58 57 55 54 53 52 51 50 49 25
I want a python code that prints the number of entries in the first list i.e. 2.
Please help.
Reply
#2
what have you tried so far?
Please show code working or not
Reply
#3
Why Python? Why not just a shell pipeline with say, AWK (other tools are probably also suitable)? Is your goal to learn Python?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  deleting select items from a list Skaperen 13 759 Oct-11-2021, 01:02 AM
Last Post: Skaperen
  Getting All Items From A List knight2000 4 452 Sep-25-2021, 12:56 AM
Last Post: knight2000
  Using print command to send command to rasberry pi terminal MondazeBear 2 505 Aug-02-2021, 03:15 PM
Last Post: Larz60+
  Feed List items with Integer euras 9 1,291 May-19-2021, 07:45 PM
Last Post: snippsat
  Parse String between 2 Delimiters and add as single list items lastyle 5 1,094 Apr-11-2021, 11:03 PM
Last Post: lastyle
  Sum of list items tristanfermat 2 821 Feb-06-2021, 12:04 PM
Last Post: tristanfermat
  print two different sequence number mantonegro 2 610 Nov-16-2020, 06:19 PM
Last Post: mantonegro
  Count number of occurrences of list items in list of tuples t4keheart 1 932 Nov-03-2020, 05:37 AM
Last Post: deanhystad
  How do I add a number to every item in a list? john316 2 653 Oct-28-2020, 05:29 PM
Last Post: deanhystad
  concatenating 2 items at a time in a python list K11 3 916 Oct-21-2020, 09:34 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020