Parallel execution (CGI)

2005-06-24 Thread mmf
Hi! I am using Python for CGI scripting. I had the following script: #!/usr/bin/python import sys print 'Content-type: text/html\r\n\r\n' print 'starting...' sys.stdout.flush() x = 99 y = 5478 counter = 0 while counter < 1000: z = x^y counter += 1 print 'finished!' sys.std

cpu usage limit

2005-05-27 Thread mmf
Hi. My problem: How can I make sure that a Python process does not use more that 30% of the CPU at any time. I only want that the process never uses more, but I don't want the process being killed when it reaches the limit (like it can be done with resource module). Can you help me? Thanks in ad

No encodings after freezing

2005-05-23 Thread mmf
Hi. I have the following script (for example): #!/usr/bin/python text = 'Hallo' text_new = text.encode('utf_8') print text_new The I tried to "freeze" this script with cx_freeze 3.0.1 (command ./FreezePython example.py). Everything worked finde, a binary was created correctly. But everytime I r

Problem: embedding Python

2005-05-21 Thread mmf
Hallo! I tried to use Python from C like it is described in the Python Docmentation. So I wrote the following C source file: #include int main(int argc, char *argv[]) { Py_Initialize(); PyRun_SimpleString("print 'Hallo World!'\n"); Py_Finalize(); return 0; } I sa