Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)
Write a string to file

Write the given *msg* to a file named *tofile*

*Notice*, `echo` will overwrite the file if it already exists

:param msg: Message to write to file
:param tofile: file to which the message is written

        def echo(msg, tofile):
    """Write a string to file

    Write the given *msg* to a file named *tofile*

    *Notice*, `echo` will overwrite the file if it already exists

    :param msg: Message to write to file
    :param tofile: file to which the message is written
    """
    with open(tofile, "w") as file_to_write:
        file_to_write.write(msg)
        


src/x/n/Xnt-0.6.3/xnt/tests/taskmisctests.py   Xnt(Download)
    def test_echo(self):
        """Test Echo Task"""
        xnt.tasks.echo("this is my cool echo", "temp/mynewcoolfile")
        self.assertTrue(os.path.exists("temp/mynewcoolfile"))
        with open("temp/mynewcoolfile", "r") as temp_file: