my code:
#!/usr/bin/python3
import getopt
import sys
import re
def readfile():
with open("hello.c", "r") as myfile:
data=myfile.read()
print data
readfile()
in file hello.c:
#include <stdio.h>
void main()
{
auto
printf("Hello World!");
}
I try to read file into variable and then printout it... it writes this thing:
} printf("Hello World!");
I know it's probably some stupid error(I'm beginner)..WHY it doesn't print all the file? can you help?