Python, Programming Languages

Assignment Help:
Write a python script that will take two file names as input (src, dest). Open src reading each line in the file, and replacing any occurrences of name with the string "redacted". The resulting rewritten lines will be written to dest. Hint: The re.sub function will be your friend.

This is my attempted solution:

import re

def q12(src, dst):
file_open = (''scr'',''r'')

re.sub(''name'', ''redacted'', string, count=0, flags=0)

file.readline()

outfile = open(''dst'', ''w'')

outfile.write(''dst'')

Related Discussions:- Python

String cost, A string S is said to be "Super ASCII", if it contains the cha...

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Calculate the total price to purchase all the components req, Calculate the...

Calculate the total price to purchase all the components required to build a state-of-the-art gaming computer from components available on the internet. Before attempting this exer

Programming logic???, write c++ source code to find the number of digits i...

write c++ source code to find the number of digits in a given integer? pls ans

Explain the while statement - computer programming, Explain the While State...

Explain the While Statement - Computer Programming? A 'while statement' is an entry controlled loop statement. When the expression is calculated and the condition is not satisf

Pseudo-code to illustrate the breakpoint in a program, The standard way for...

The standard way for debuggers to plant interactive breakpoints in a program in RAM (whatever the processor instruction set) is to save the break pointed instruction and replace it

MATLAB, Who can help with MATLAB?

Who can help with MATLAB?

ARM LANGUAGE, I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

Memory hierarchy for linux systems, Memory Hierarchy for Linux Systems ...

Memory Hierarchy for Linux Systems A cache line has one or more valid bit(s), tag entry and list of bytes in a block in one set of a cache, as shown below: If you were

Triple eigenvalue with 2 linearly independent eigenvectors, 1 Triple Eigenv...

1 Triple Eigenvalue with 2 Linearly Independent Eigenvectors       In this case we will have the eigen-value l with the two linearly independent eigenvectors  ?h 1 and  ?h 2

Implement a lunar lander simulation, 1. Modify your solution to #8 so that ...

1. Modify your solution to #8 so that if an ellipse is touched by the mouse, it turns permanently green.Bonus (up to +5): a green ellipse stops moving, but recovers after 5 seconds

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd