What are the Python thread + Unix signals semantics?
What are the rules surrounding Python threads and how Unix signals are handled?
KeyboardInterrupt, which is triggered by
SIGINT but handled internally by the Python runtime, handled differently?
Python does not print traceback messages from exceptions raised in daemon threads. For example, this code creates a daemonic thread and raises an exception in the new thread: def error_raiser(): raise
How can one create a thread in unix programming? What is difference between forking and threading? Is threading more useful than forking?
What are the delete semantics for RestKit when using it with Core Data? For example, assume I correctly set a primaryKeyAttribute in RestKit for Organization entities. If I do a GET on, say, /organiza
I was wondering how to create a flexible CLI interface with Python. So far I have come up with the following: $ cat cat.py #!/usr/bin/env python from sys import stdin from fileinput import input from
Are there any conventions/design pattern for using signals and signal handlers in a library code? Because signals are directed to the whole process and not to specific thread or library, i feel there
I'm using python to manage some simulations. I build the parameters and run the program using: pipe = open('/dev/null', 'w') pid = subprocess.Popen(shlex.split(command), stdout=pipe, stderr=pipe) My
I have several questions regarding Python threads. Is a Python thread a Python or OS implementation? When I use htop a multi-threaded script has multiple entries - the same memory consumption, the sa
What is the correct way to make my PyQt application quit when killed from the console (Ctrl-C)? Currently (I have done nothing special to handle unix signals), my PyQt application ignores SIGINT (Ctrl
What data type should I use for saving unix_timestamp value (MySQL)?
I'd like to ask a question for which my extensive web search would suggest the answer is 'no' but maybe I've overlooked something ... Are there Python abstraction layers sitting on top of Unix and Win
I'm writing a program that adds normal UNIX accounts (i.e. modifying /etc/passwd, /etc/group, and /etc/shadow) according to our corp's policy. It also does some slightly fancy stuff like sending an em
I would like to stop a Python thread when the main program stops. It is for a class that connects to a server. The connection is maintained by the background thread, the foreground thread answers to c
I'm using the python signals library to kill a function if it runs longer than a set period of time. It works well in my tests but when hosted on the server I get the following error signal only work
I'm a little confused about what setting a thread to be a daemon means. The documentation says this: A thread can be flagged as a “daemon thread”. The significance of this flag is that the entire Pyt
am having problem with django custom signals not being able to see signals across application. I made a simple call in my core/signals.py from django.dispatch.dispatcher import Signal # Signal-emitti
I am curious if there is a built-in python join function like the unix version (see http://linux.about.com/library/cmd/blcmdl_join.htm). I know the functionality is included through the built in sqlit
I am currently reproducing the following unix command: cat command.info fort.13 > command.fort.13 in python with the following: with open('command.fort.13', 'w') as outFile: with open('fort.13',
I'm working on an assignment that involves writing a program to process data (calculate pi) using fork (processes), signals and select. I'm working right now on the signals and what I think I want to
What is the best unix compression utility available?
I want to write up a Program either in C / Python - Unix(Open SUSE) for the following:- 1) Report / alarm mechanism : wherin if some updatation has been done in particular folder, or anything else cha
I've seen a similar post here however it refers to Python 2.6 and I was hoping there was an easier way. From reading the thread it seems the best way is to just replace all my print statements with s
Can someone explain in simple terms the signals and slots pattern?
I am writing a program by a framework using pygtk. The main program doing the following things: Create a watchdog thread to monitor some resource Create a client to receive data from socket call gob
How would you assess a Unix sys-admin. What programming competences should a Unix admin have?
What is a Unix timestamp? In PHP, when working with dates, the function strtotime() outputs some integer value -- what is that? I tried to learn about this but I couldn't get satisfactory answer, espe
In Python, using calendar.timegm(), I get a 10 digit result for a unix timestamp. When I put this into Javscript's setTime() function, it comes up with a date in 1970. It evidently needs a unix timest
I'm switching from xlobjects to boost::signals2 as my signal/slot framework in the hope that the establishment of connections, threir removal, signal emission, etc is thread-safe. I'm not interested i
Below is the example of abort functionality implementation using signals as given in Advanced Programming in Unix. Few doubts in the below code - void abort(void) /* POSIX-style abort() function */
How does is operator determine if two objects are the same? How does it work? I can't find it documented.
Can anybody tell me about 'profiling' in unix by giving a small example. Thank you!
Both stdin and stdout file descriptors point to it. How does it work? Can some one point to a good resource for understanding UNIX terminals and system calls that interact with it.
I am learning Signal handling in Unix and having a hard time understanding what are SIG_SETMASK and o_set in sigprocmask() and what do they do? I understand that set contains the list of signals to be
Can anybody tell me what a 'call out table' is in Unix? Maurice J. Bach gives an explanation in his book Design of the UNIX Operating System, but I'm having difficulty in understanding the examples, e
I'm trying to kill a thread in python. An exception would be the preferred way to do it, as a graceful exit of the run method of the thread through a try:except: pair would allow to close resources. I
I was studying the signals topic in python and came across this example import signal import os import time def receive_signal(signum, stack): print 'Received:', signum signal.signal(signal.SIGUSR1, r
Is there a way to kill a specific thread with Python? I have a thread running a function that is a loop and it is interfering with other parts of the program. I need to kill it when a certain function
This question already has an answer here: Python Time Seconds to h:m:s 3 answers a = time.time() b = time.time() c = b - a I know c is in seconds. Is there a mod out there (maybe datetime or t
Searched for this but could not find anything, so I suspect it can't be done. I need to update arguments to a running thread: def doLeds(*leds): onoff = 0 while 1: onoff=not onoff for led in leds: wpi
Currently I'm not a python programmer, but I'm giving some maintenance to some python code, and I have what's more or less the following: class DerivedThread(threading.Thread): def __init__(self): thr
Can you recommend a high-performance, thread-safe and stable ORM for Python? The data I need to work with isn't complex, so SQLAlchemy is probably an overkill.
Currently i can list my processes with a simple python script: import os os.system(Tasklist) I would like to list all the threads associated with those processes, if any. The count of threads per pr
What difference it makes when I set python thread as a Deamon, using thread.setDaemon(True) ?
On a Unix server, I am using smtplib in python to send an email to myself ; the email also contains a unix file attachment. I use outlook client to view the email and when I open the file, it does not
I'm trying to learn vim :-) Having some real trouble with auto-indent changing the meaning of my python code. Is there any way to get the goodness of autoindent without running into behaviors like the
I want to be able to at first call a simple script to enable or disable an external monitor from my netbook. I am running Fedora 17 with XFCE as my desktop. I see that I should be able to use python a
This is an algorithm in python to validate a day entry. I want to know what does that mean exactly the expression if day (semantics). I only know the effect of if on boolean expressions not on var
Is python logger thread-safe or not? I use python 2.6.
I have been trying to write a python script that initiates a thread to listen on a socket and send HTTP data to another application to be launched by the same program. There is a requirement for the s
What's the difference between connecting signals and slot in your c++ code and setting them in QtCreator Signals and Slots Editor window? I saw in QtCreator window, there is also a Signals and Slot