Re: [Tutor] Expanding a variable with subprocess on Windows

2011-03-07 Thread Sander Sweers
On Tue,  8 Mar 2011, 07:44:31 CET, Becky Mcquilling wrote: > gpg = 'c:/program files (x86)/gnu/gnupg/gpg2.exe' > gpg = 'c:/program files (x86)/gnu/gnupg/gpg2.exe' > > subprocess.Popen('gpg', shell=True) > > It fails to run gpg and is not expanding the variable.  Is there a way > to do this th

Re: [Tutor] Expanding a variable with subprocess on Windows

2011-03-07 Thread Becky Mcquilling
I'm working on a Windows machine and want to use subprocess to run several commands from the command line. Normally with bat files or some of the other scripting languages on Windows, I would set up a variable with the path to the command like so: gpg = 'c:/program files (x86)/gnu/gnupg/gpg2.exe'

Re: [Tutor] Does try-except "lock out scope" or similar?

2011-03-07 Thread Andre Engels
On Tue, Mar 8, 2011 at 5:40 AM, Benjamin Serrato wrote: > I wrote a short script to clean up a csv file but had trouble when > date_time = time.strptime(date_string, "%m/%d/%y") >  would choke on intermittent Null characters in the file.  I put it into a > try-except, but then I found I couldn't d

Re: [Tutor] BLAS Implementation on Python

2011-03-07 Thread Knacktus
Am 07.03.2011 22:44, schrieb Steven D'Aprano: On Tue, 8 Mar 2011 12:28:56 am Knacktus wrote: Am 07.03.2011 01:50, schrieb Mahesh Narayanamurthi: Hello, I am thinking of implementing a BLAS package in pure python. I am wondering if this is a good idea. Sure, why not? Even if nobody uses it, i

[Tutor] Does try-except "lock out scope" or similar?

2011-03-07 Thread Benjamin Serrato
I wrote a short script to clean up a csv file but had trouble when date_time = time.strptime(date_string, "%m/%d/%y") would choke on intermittent Null characters in the file. I put it into a try-except, but then I found I couldn't do del row because I receive a "row is not defined" complaint

Re: [Tutor] [RFI] Resources for graphic modeling of dynamic systems

2011-03-07 Thread Wayne Werner
On Mon, Mar 7, 2011 at 7:28 PM, Jeff Horn wrote: > Hi tutors! > > I have a very basic understanding of Python, and have played a bit > with SymPy. I'd like to use Python to accomplish many of the same > things that are done in Mathematica. > > Right now, I have a project that could benefit from a

[Tutor] [RFI] Resources for graphic modeling of dynamic systems

2011-03-07 Thread Jeff Horn
Hi tutors! I have a very basic understanding of Python, and have played a bit with SymPy. I'd like to use Python to accomplish many of the same things that are done in Mathematica. Right now, I have a project that could benefit from a dynamic model. I envision defining a series of differential eq

Re: [Tutor] help with re module and parsing data

2011-03-07 Thread Steven D'Aprano
On Mon, 7 Mar 2011 06:54:30 pm vineeth wrote: > Hello all I am doing some analysis on my trace file. I am finding the > lines Recvd-Content and Published-Content. I am able to find those > lines but the re module as predicted just gives the word that is > being searched. But I require the entire l

Re: [Tutor] Init Script (RHEL 5 Linux)

2011-03-07 Thread Steven D'Aprano
On Tue, 8 Mar 2011 08:49:12 am Tom Tucker wrote: > Hello. I am trying implement a *one time* execution of an init > script. Any recommendation on how to fork or detach this > script from the normal init 3 execution process so that it doesn't > hold up other activities? This mailing list is for be

[Tutor] Init Script (RHEL 5 Linux)

2011-03-07 Thread Tom Tucker
Hello. I am trying implement a *one time* execution of an init script. Any recommendation on how to fork or detach this script from the normal init 3 execution process so that it doesn't hold up other activities? Thanks Here is the high level logic. 1. Execute script 1. perform these

Re: [Tutor] BLAS Implementation on Python

2011-03-07 Thread Steven D'Aprano
On Tue, 8 Mar 2011 12:28:56 am Knacktus wrote: > Am 07.03.2011 01:50, schrieb Mahesh Narayanamurthi: > > Hello, > > > > I am thinking of implementing a BLAS package in pure python. I am > > wondering if this is a good idea. Sure, why not? Even if nobody uses it, it looks good on a resume and you

Re: [Tutor] ctypes question

2011-03-07 Thread Alan Gauld
"Pacific Morrowind" wrote but that path doesn't actually exist... replace that path with either r"d:/temp/spssio32.dll" or with "d://temp//spssio32.dll"; otherwise the /t will be transformed into a tab. You've got your / and \ mixed up. Forward slashes (/) are fine in Windows paths. It's

Re: [Tutor] ctypes question

2011-03-07 Thread Joel Goldstick
On Mon, Mar 7, 2011 at 10:36 AM, Pacific Morrowind < pacificmorrow...@gmail.com> wrote: > Hi > > > On 07/03/2011 7:02 AM, Albert-Jan Roskam wrote: > > Hi, > > I want to use a dll to read Spss data files. But when I use > lib = ctypes.cdll.LoadLibary("d:/temp/spssio32.dll") > I get a WindowsError

Re: [Tutor] ctypes question

2011-03-07 Thread Pacific Morrowind
Hi On 07/03/2011 7:02 AM, Albert-Jan Roskam wrote: Hi, I want to use a dll to read Spss data files. But when I use lib = ctypes.cdll.LoadLibary("d:/temp/spssio32.dll") I get a WindowsError (cannot find module), even though the path exists. Why is that? Do I need to extend some environment varia

[Tutor] ctypes question

2011-03-07 Thread Albert-Jan Roskam
Hi, I want to use a dll to read Spss data files. But when I use lib = ctypes.cdll.LoadLibary("d:/temp/spssio32.dll") I get a WindowsError (cannot find module), even though the path exists. Why is that? Do I need to extend some environment variable (add another dir)? I am using Python 2.5 on Win

Re: [Tutor] BLAS Implementation on Python

2011-03-07 Thread Stefan Behnel
Knacktus, 07.03.2011 14:28: Am 07.03.2011 01:50, schrieb Mahesh Narayanamurthi: Hello, I am thinking of implementing a BLAS package in pure python. I am wondering if this is a good idea. My design goals are: [2] Targetted to run on Python3 Good idea. NumPy and SciPy will be (are already?)

Re: [Tutor] BLAS Implementation on Python

2011-03-07 Thread Knacktus
Am 07.03.2011 01:50, schrieb Mahesh Narayanamurthi: Hello, I am thinking of implementing a BLAS package in pure python. I am wondering if this is a good idea. I don't think so. Usually people write extensions to the CPython implementation (when talking about performance, we need to talk about

Re: [Tutor] BLAS Implementation on Python

2011-03-07 Thread Stefan Behnel
Mahesh Narayanamurthi, 07.03.2011 01:50: I am thinking of implementing a BLAS package in pure python. I am wondering if this is a good idea. My design goals are: [1] Efficient manipulation of Matrices and Vectors using pure python objects and python code. [2] Targetted to run on Python

Re: [Tutor] help with re module and parsing data

2011-03-07 Thread wesley chun
>> import re >> file = open('file.txt','r') >> file2 = open('newfile.txt','w') >> >> LineFile = ' ' >> >> for line in file: >>    LineFile += line >> >> StripRcvdCnt = re.compile('(P\w+\S\Content|Re\w+\S\Content)') >> >> FindRcvdCnt = re.findall(StripRcvdCnt, LineFile) >> >> for SrcStr in FindRcvdC

[Tutor] How to sum weighted matrices

2011-03-07 Thread shu wei
Hello all, I am new to python and numpy. My question is how to sum up N weighted matrices. For example w=[1,2] (N=2 case) m1=[1 2 3, 3 4 5] m2=[3 4 5, 4 5 6] I want to get a matrix Y=w[1]*m1+w[2]*m2 by using a loop. My original problem is like this X=[1 2 3, 3 4 5, 4 5 6]

Re: [Tutor] help with re module and parsing data

2011-03-07 Thread Kushal Kumaran
On Mon, Mar 7, 2011 at 1:24 PM, vineeth wrote: > Hello all I am doing some analysis on my trace file. I am finding the lines > Recvd-Content and Published-Content. I am able to find those lines but the > re module as predicted just gives the word that is being searched. But I > require the entire