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
  How to parse and group hierarchical list items from an unindented string in Python? ann23fr 0 96 Mar-27-2024, 01:16 PM
Last Post: ann23fr
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 1,259 May-22-2023, 10:39 PM
Last Post: ICanIBB
  How do you get Python to print just one value in a list? 357mag 3 968 May-17-2023, 09:52 PM
Last Post: rob101
  Delete strings from a list to create a new only number list Dvdscot 8 1,466 May-01-2023, 09:06 PM
Last Post: deanhystad
  find random numbers that are = to the first 2 number of a list. Frankduc 23 3,049 Apr-05-2023, 07:36 PM
Last Post: Frankduc
  Finding combinations of list of items (30 or so) LynnS 1 838 Jan-25-2023, 02:57 PM
Last Post: deanhystad
  Python VS Code: using print command twice but not getting output from terminal kdx264 4 1,035 Jan-16-2023, 07:38 PM
Last Post: Skaperen
  Print Player Name and Number of Pokemon webmanoffesto 1 1,069 Aug-23-2022, 08:54 PM
Last Post: deanhystad
  For Word, Count in List (Counts.Items()) new_coder_231013 6 2,500 Jul-21-2022, 02:51 PM
Last Post: new_coder_231013
  TypeError: float() argument must be a string or a number, not 'list' Anldra12 2 4,767 Jul-01-2022, 01:23 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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