Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l = range(0,100000)
- for i in l:
- if i%1000==0:
- print i
- for j in l:
- s = i + j
- screen -d -m -L python test.py
- #define _GNU_SOURCE
- #include <stdlib.h>
- #include <stdio.h>
- #include <dlfcn.h>
- char *getenv(const char *s) {
- static char *(*getenv_real)(const char *s) = NULL;
- if (getenv_real == NULL) {
- getenv_real = dlsym(RTLD_NEXT, "getenv");
- setlinebuf(stdout);
- }
- return getenv_real(s);
- }
- gcc -O2 -o linebufferedstdout.so -fpic -shared linebufferedstdout.c -ldl -lc
- $ LD_PRELOAD=./linebufferedstdout.so python test.py | tee -a test.out
- 0
- 1000
- 2000
- 3000
- 4000
- ./program | tee a.txt
- $ sudo apt-get install expect
- $ unbuffer python program.py | cat -
- <watch output immediately show up here>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement