Re: [Tutor] error when using using subprocess.popen in Python wrapper script

2012-05-06 Thread Rogelio
On Sun, May 6, 2012 at 8:23 PM, Martin A. Brown wrote: > Or, if I were in your shoes, I would do something a bit more like > this: > >  cmd = [ '/usr/bin/perl', '/path/to/perlprog.pl', '-h' ] >  subprocess.call(cmd) Thank you, Martin. This was helpful. Installed Strace and found out that I mis

Re: [Tutor] error when using using subprocess.popen in Python wrapper script

2012-05-06 Thread Martin A. Brown
Hello, : perl_prog = "perl perlprog.pl" : perl_prog_h ="-h" : #this is where it breaks : subprocess.call([perl_prog, perl_prog_h]) This is asking your Linux to search your $PATH and execute a program called: 'perl perlprog.pl' Rather than to execute a program called 'perl' and pass as t

[Tutor] error when using using subprocess.popen in Python wrapper script

2012-05-06 Thread Rogelio
I am new to Python and am trying to figure out how to execute Linux commands via a Python wrapper. This works ** #this works okay import subprocess uname = "uname" uname_arg = "-a" subprocess.call([uname,uname_arg]) ** But this doesn't.

Re: [Tutor] Sorting the parts of a dictionary into a list

2012-05-06 Thread Peter Otten
Jacob Bender wrote: > Dear tutors, > > I'm trying to create a neural network program. Each neuron is in a > dictionary and each of its connections and their strengths are in a nested > dictionary. So {0:{1:4, 2:5}}, 1:{0:6}, 2:{1:2}} would mean that neuron 0 > is connected to neuron 1 with a stre

[Tutor] Sorting the parts of a dictionary into a list

2012-05-06 Thread Jacob Bender
Dear tutors, I'm trying to create a neural network program. Each neuron is in a dictionary and each of its connections and their strengths are in a nested dictionary. So {0:{1:4, 2:5}}, 1:{0:6}, 2:{1:2}} would mean that neuron 0 is connected to neuron 1 with a strength of 4. And it also means that