Python Forum
Search for Player ID and return games played and number of times
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Search for Player ID and return games played and number of times
#2
Hello, welcome to Python and the forums!
It is advisable that instead of using "open" on its own, you use the "with" statement (so-called context manager). You can read about that and how to handle files in the official docs, as well as numerous other sources available online for free.
You will probably want to loop through the file and read each line as a string. Some string methods will come handy, for example splitting the text. After that you will probably be best off saving the read data in a dictionary, or dictionaries.
If you get stuck feel free to post your attempt and explain what the problem is or what the desire result would be compared to actual one.
Reply


Messages In This Thread
RE: Search for Player ID and return games played and number of times - by j.crater - May-03-2018, 05:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to compare two cards games? python_beginner99 7 3,786 Nov-30-2021, 06:53 PM
Last Post: deanhystad
  times greater number than the previous rhai 4 3,483 Oct-08-2018, 03:27 AM
Last Post: woooee
  How to used the edge detection in opencv python to return number of edge? Vivian 2 2,708 May-04-2018, 08:31 PM
Last Post: nilamo
  Find how many times a user played an artist and how many times disruptfwd8 1 2,619 May-04-2018, 08:32 AM
Last Post: killerrex
  PLayer vs.PLayer game candylicious 1 3,081 Nov-04-2017, 08:33 PM
Last Post: Lux
  The int that appears an odd number of times. MeeranRizvi 6 6,607 Dec-30-2016, 09:54 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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