What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-24 19:41:56
bs4 table examples python
data = [] table = soup.find('table', attrs={'class':'lineItemsTable'}) table_body = table.find('tbody') rows = table_body.find_all('tr') for row in rows: cols = row.find_all('td') cols = [ele.text.strip() for ele in cols] data.append([ele for... Add solution -
Other 2022-01-22 08:01:08
alterning format when reading from a text file
with open("videos.txt") as f: lines = [l.strip() for l in f.readlines()] available_videos = "" for line in lines: title, video, tags = [x.strip() for x in line.split("|")] available_videos += f"{title} ({vid... Add solution -
Python 2021-10-26 19:59:13
Write a Python program to read a file line by line store it into an array
def conftolist(fname,mode='r+'): with open(fname) as f: lines = [line.strip() for line in f] print(lines) conftolist('file1.txt') ############ with open('file1.txt','r+') as f: # li = list(f) # print(li) ls=[] for l in f: ls.append(l.strip())... Add solution -
Rust 2021-10-16 12:25:03
read file rust
document = 'document.txt' file = open(document, 'r') # 'r' can be replaced with: # 'w' to write # 'a' to append (add to the end) # 'w+' makes a new file if one does not already exist of that name # 'a+' is the same as 'w+' but it appends if the file does ... Add solution -
Javascript 2021-10-12 00:46:12
Qwiklabs Assessment: Working with Regular Expressions
#!/usr/bin/env python3 import re import csv def contains_domain(address, domain): """Returns True if the email address contains the given,domain,in the domain position, false if not.""" domain = r'[\w\.-]+@'+domain+'$' ... Add solution
Best helpers
Wayne
+5
Abe bubush
+5
Kyle Carlson
+5
Myles
+5
Takje
+5
Trevorj
+5
David
+5
Mitsos
+5
Nuraxi
+5
Ahmed Masud
+5