import time
print time.ctime()
this snippet will print the system time.
in my networking lab, i used this python snippet to print the system time.
actually i have to write a client, server program in c to achieve this. but i
have found a lazy way.
when mam ask us to show the output i planned to run this python snippet :) (don't tell her);
only problem is i cannot make it as an executable code.
./timecli
this wont work. because only sudoers can use the chmod command to make it executable.
but gcc can make an executables.
so i planned to write a c program to run the python snippet.
after the compilation using gcc i got a executable to my python snippet.
happy cheating :)
print time.ctime()
this snippet will print the system time.
in my networking lab, i used this python snippet to print the system time.
actually i have to write a client, server program in c to achieve this. but i
have found a lazy way.
when mam ask us to show the output i planned to run this python snippet :) (don't tell her);
only problem is i cannot make it as an executable code.
./timecli
this wont work. because only sudoers can use the chmod command to make it executable.
but gcc can make an executables.
so i planned to write a c program to run the python snippet.
#include "stdio.h" int main() { char cmd[20]; sprintf(cmd, "python time.py"); system(cmd); return 0; }
after the compilation using gcc i got a executable to my python snippet.
happy cheating :)
Comments
Post a Comment