기본적으로 나는 https://en.wikipedia.org/wiki/List_of_lists_of_lists의 목록을 내 클립 보드에 복사하고 있습니다. 프로그램을 실행하면 각 행의 앞이나 뒤에 글 머리 기호가 추가됩니다. 예를 들어(Python) 클립 보드에서 문자열을 수정하는 것에 대한 도움
: 등
•• Lists of Iranian films ••
그리고 :
Lists of Iranian films
가로 변환겠습니까. 이 프로그램은 줄 앞에 글 머리 기호를 추가 할 때 작동하지만, 뒤 따르면 줄 바꿈 문자없이 긴 문자열 하나만 인쇄합니다. 아무도 내가 뭘 잘못하고 있다고 말할 수 있습니까?
List of Israeli films before 1960
List of Israeli films of the 1960s
List of Israeli films of the 1970s
List of Israeli films of the 1980s
클립 보드 메모장에 붙여 : 내 클립 보드에
#bulletPointAdder.py - Adds Wikipedia bullet points to the start and end
#of each line of text on the clipboard
import pyperclip
text=pyperclip.paste() #paste a big string of text from clipboard into the 'text' string
# Separate lines and add stars
lines = text.split('\n') #'lines' contains a list of all the individual lines up until '\n'
#lines= ['list of iserael films', 'list of italian films' ...]
for i in range(len(lines)): #loop through all indexes in the "lines" list
lines[i] = '••' + lines[i] + '••' #add bullets before and after each line
text = '\n'.join(lines) #put a '\n' in between the list members (joins them) into a single string
pyperclip.copy(text)
: 여기
코드의••List of Israeli films before 1960••••List of Israeli films of the 1960s••••List of Israeli films of the 1970s••••List of Israeli films of the 1980s••
무엇이 질문입니까? '텍스트'의 종류는 무엇입니까? 'str' 요소의'list'입니까? – blacksite
죄송합니다. 유형은 클립 보드에 복사 된 문자열입니다. – tadm123