Python Forum
hardest week yet: some guidence please
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hardest week yet: some guidence please
#10
(Aug-16-2019, 09:19 PM)jefsummers Wrote: Besides being the wrong type, intruder_log is empty. You won't find anything.

yes it seems I got ahead of myself. I have removed the directory.
I am supposed to creat a slice
I have got this much done of step 3

text_file = open("auth.log.1")

with open("auth.log.1") as text_file:
    for line in text_file:
        if "Failed password" in line:
            start = line.find("user")
            end = line.find(" from")
            name = line[start:end]
            print("{}".format(name))
my output is the column of user names but it has user infront of it and I can not figure out why
my output

user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
user root
Reply


Messages In This Thread
RE: hardest week yet: some guidence please - by raymond2688 - Aug-16-2019, 11:02 PM
slice help - by raymond2688 - Aug-17-2019, 12:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating the number of day of the week RbaPhoenix 3 2,599 Mar-27-2020, 09:23 PM
Last Post: Larz60+
  week 1 python help - string formatting ? raymond2688 20 8,147 Jul-09-2019, 08:10 PM
Last Post: snippsat
  Trying to get the week number from a string of numbers fad3r 2 3,301 Apr-15-2018, 06:52 PM
Last Post: ljmetzger

Forum Jump:

User Panel Messages

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