Re: SQLite problems

2007-04-12 Thread bayer . justin
> Why fink ?, it is very easy to make sqlite. download the source, > configure, make and install from terminal I did so and now I have the latest sqlite version. But it did not make a difference. -- http://mail.python.org/mailman/listinfo/python-list

SQLite problems

2007-04-12 Thread bayer . justin
Hi there, I run Python 2.5 on a Mac OS X system with SQLite 3.2.8 installed via fink. Today I stumbled over the problem, that the sqlite3 module and sqlite3 from fink do not seem to work well together. I brought it down to this: >>> from sqlite3 import Connection >>> c = Connection("foo.bar") #

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-02 Thread bayer . justin
> If you are both waiting for input, you have a Mexican standoff... That is not the problem. The problem is, that the buffers are not flushed correctly. It's a dialogue, so nothing complicated. But python does not get what the subprocess sends onto the subprocess' standard out - not every time, an

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-01 Thread bayer . justin
Okay, here is what I want to do: I have a C Program that I have the source for and want to hook with python into that. What I want to do is: run the C program as a subprocess. The C programm gets its "commands" from its stdin and sends its state to stdout. Thus I have some kind of dialog over stdi

Re: Dialog with a process via subprocess.Popen blocks forever

2007-03-01 Thread bayer . justin
Hi, Thanks for your answer. I had a look into the fcntl module and tried to unlock the output-file, but >>> fcntl.lockf(x.stdout, fcntl.LOCK_UN) Traceback (most recent call last): File "", line 1, in IOError: [Errno 9] Bad file descriptor I wonder why it does work with the sys.stdin It's real

Dialog with a process via subprocess.Popen blocks forever

2007-02-28 Thread bayer . justin
Hi, I am trying to communicate with a subprocess via the subprocess module. Consider the following example: >>> from subprocess import Popen, PIPE >>> Popen("""python -c 'input("hey")'""", shell=True) >>> hey Here hey is immediately print to stdout of my interpreter, I did not type in the "hey"

Re: a=b change b a==b true??

2007-02-26 Thread bayer . justin
If you want to copy lists, you do it by using the [:] operator. e.g.: >>> a = [1,2] >>> b = a[:] >>> a [1, 2] >>> b [1, 2] >>> b[0] = 2 >>> a [1, 2] >>> b [2, 2] If you want to copy a list of lists, you can use a list comprehension if you do not want to use the copy module: >>> a = [[1,2],[3,4]]