Python Forum
opening files and output of parsing
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
opening files and output of parsing
#3
(Oct-01-2020, 02:27 AM)bowlofred Wrote: Usually you'll want to rstrip(), which by default removes any whitespace from the right end.

result = [line.rstrip() for line in testfile if "2" in line]
Reply


Messages In This Thread
RE: opening files and output of parsing - by leodavinci1990 - Oct-12-2020, 04:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unexpected output when trying to attach files in a mail application PythonU2Novel 0 403 May-17-2024, 02:59 AM
Last Post: PythonU2Novel
  Phyton Opening files on windows C: pc EddieG 3 1,099 Mar-29-2023, 03:19 PM
Last Post: buran
  merge two csv files into output.csv using Subprocess mg24 9 1,991 Dec-11-2022, 09:58 PM
Last Post: Larz60+
  Increment text files output and limit contains Kaminsky 1 3,339 Jan-30-2021, 06:58 PM
Last Post: bowlofred
  Opening and closing Mac applications and files Nickd12 5 5,998 Sep-05-2020, 04:39 AM
Last Post: perfringo
  Parsing Xml files >3gb using lxml iterparse Prit_Modi 2 2,485 May-16-2020, 06:53 AM
Last Post: Prit_Modi
  PYHTON not opening files profficial 11 13,988 Feb-15-2020, 09:06 AM
Last Post: bharathendra
  Four text files input combinations into an output file mhyga 2 2,299 Jul-28-2019, 06:52 PM
Last Post: ThomasL
  Parsing Attached .MSG Files with Python3 ericl42 1 3,792 Apr-12-2019, 06:28 PM
Last Post: ericl42
  parsing local xml files to csv erdem_ustunmu 8 5,464 Feb-27-2019, 12:37 PM
Last Post: erdem_ustunmu

Forum Jump:

User Panel Messages

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