find tag

7 questions


1 answers
130 views
0
Find only one last string without using Python find function method rfind

def findLast(filename,key): infile = open(filename,r) outfile = open(result.txt,w) text = infile.read() position = text.find(key) if position == -1: outfile.write(key + is not found.\n) else: outf...

2 years ago

2 answers
95 views
0
Find specific characters in a Python string

I wonder how to find a specific string in Python.Actually, you can just do the string.find (the string to find), butI'd like to do a right-to-left examination, not a left-to-right examination What sho...

2 years ago

1 answers
88 views
0
You want to determine if the list containing the string contains a specific string

my_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456']How do I find out if there is an 'abc' in the list from the same list?What I know is that list items like 'abc-123' and 'abc-456' have to match ex...

2 years ago

1 answers
118 views
0
Searching for a specific string in Python multiple times

def find(): for n in range(len(P_list)): if intext.find(P_list[n]) >= 0: print (P_list[n]) print (Initial start position: %d% (intext.found(P_list[n])+1))) else: print(P_list[n]) print (...

2 years ago

1 answers
131 views
0
I have a question for Python if.

per1=25per2 = .75if row[23] == 'sale1' or row[23] == 'sale2': if row[27].find(per1) == -1: cursor.execute(sql)else: cursor.execute(sql)Or per2 = .75if row[23] == 'sale1' or row[23] == 'sale2': if row...

2 years ago

1 answers
139 views
0
Why can't I use ll instead of ls - l when I use the find command?

find . -name test -exec ls -l {} \; Why can't I use ll instead of ls -l when I use this command?Can't I use it because it's an alias?This is centOS6.

2 years ago

2 answers
136 views
0
Python found

message_content = message.contentban = message_content.found (test)I'm making a bot in DiscordI want to make several test phrases, what should I do?

2 years ago

© 2024 OneMinuteCode. All rights reserved.