Skip to content

flask python website save user input and add it to the list

this website currently starts out with two input fields at the tope left corner. The first input is the persons name and the second input is the question they have.Currently it just prints successful and unsuccessful. when you press submit button I want the website to print and save the name and question. whe…

How to delete a line from a file?

I have two files (file1 and file2) and want to compare each line of file2 with all lines in file1. And if this condition is satisfied: (ln2[1][0] != ln1[1][0]) and (ln2[1][0] != ‘-‘) then I want to remove the current line of file2, i.e. ln2, from the file2. I wrote this code in python, but I have …

Get date using subprocess python?

I used subprocess to get information on a directory in my VM. and i get the output as How can i get just the date from the above output? Thank you Answer As an alternative, since you are already using a subprocess might as well use it all the way: should get you output in the format: Apr 25 2019