Changeset 391 for python/trunk/Demo/embed/loop.c
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Demo/embed/loop.c
r2 r391 7 7 main(int argc, char **argv) 8 8 { 9 10 9 int count = -1; 10 char *command; 11 11 12 13 14 15 16 12 if (argc < 2 || argc > 3) { 13 fprintf(stderr, "usage: loop <python-command> [count]\n"); 14 exit(2); 15 } 16 command = argv[1]; 17 17 18 19 20 18 if (argc == 3) { 19 count = atoi(argv[2]); 20 } 21 21 22 22 Py_SetProgramName(argv[0]); 23 23 24 25 24 /* uncomment this if you don't want to load site.py */ 25 /* Py_NoSiteFlag = 1; */ 26 26 27 28 29 30 31 32 27 while (count == -1 || --count >= 0 ) { 28 Py_Initialize(); 29 PyRun_SimpleString(command); 30 Py_Finalize(); 31 } 32 return 0; 33 33 }
Note:
See TracChangeset
for help on using the changeset viewer.