Re: lotus nsf to mbox

2007-12-18 Thread Fabian Braennstroem
Hi to all,

thanks, I'll try your suggestions...

Regards!
Fabian

Brian Munroe schrieb am 12/15/2007 07:10 PM:
> On Dec 15, 11:04 am, Fabian Braennstroem <[EMAIL PROTECTED]>
> wrote:
> 
>> thanks for your ideas! I actually thought of something like
>> a python parser, which just converts the nsf structure to an
>> mbox; could that work!?
>>
> 
> Well, If you wish to go that route, I believe you will have to reverse
> engineer the Notes Database binary structure because I've never seen
> it published anywhere.  My suggestion, if you can use a Windows
> machine, just use the Lotus Notes COM Objects via the Python Win32
> bindings, as mentioned above.
> 
> If you really need to do it from Linux and are lucky enough to be
> running the IIOP task on your Domino server, then you could possibly
> use CORBA.
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: lotus nsf to mbox

2007-12-15 Thread Fabian Braennstroem
Hi to both,

Dan Poirier schrieb am 12/15/2007 02:00 PM:
> On Dec 15, 5:18 am, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> I am wondering, if anyone tried to convert lotus nsf mails
>> to a mbox format using python!? It would be nice, if anyone
>> has an idea, how to do it on a linux machine.
> 
> I've used jython to access notes databases through the Notes
> Java APIs.  Though I don't know if the Java APIs are available
> on Linux.

thanks for your ideas! I actually thought of something like
a python parser, which just converts the nsf structure to an
mbox; could that work!?

Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


lotus nsf to mbox

2007-12-15 Thread Fabian Braennstroem
Hi,

I am wondering, if anyone tried to convert lotus nsf mails
to a mbox format using python!? It would be nice, if anyone
has an idea, how to do it on a linux machine.

Regards!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regex problem with re and fnmatch

2007-11-21 Thread Fabian Braennstroem
Hi John,

John Machin schrieb am 11/20/2007 09:40 PM:
> On Nov 21, 8:05 am, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I would like to use re to search for lines in a files with
>> the word "README_x.org", where x is any number.
>> E.g. the structure would look like this:
>> [[file:~/pfm_v99/README_1.org]]
>>
>> I tried to use these kind of matchings:
>> #org_files='.*README\_1.org]]'
>> org_files='.*README\_*.org]]'
>> if re.match(org_files,line):
> 
> First tip is to drop the leading '.*' and use search() instead of
> match(). The second tip is to use raw strings always for your
> patterns.
> 
>> Unfortunately, it matches all entries with "README.org", but
>> not the wanted number!?
> 
> \_* matches 0 or more occurrences of _ (the \ is redundant). You need
> to specify one or more digits -- use \d+ or [0-9]+
> 
> The . in .org matches ANY character except a newline. You need to
> escape it with a \.
> 
>>>> pat = r'README_\d+\.org'
>>>> re.search(pat, 'README.org')
>>>> re.search(pat, 'README_.org')
>>>> re.search(pat, 'README_1.org')
> <_sre.SRE_Match object at 0x00B899C0>
>>>> re.search(pat, 'README_.org')
> <_sre.SRE_Match object at 0x00B899F8>
>>>> re.search(pat, 'README_Zorg')
>>>>

Thanks a lot, works really nice!

>> After some splitting and replacing I am able to check, if
>> the above file exists. If it does not, I start to search for
>> it using the 'walk' procedure:
> 
> I presume that you mean something like: """.. check if the above file
> exists in some directory. If it does not, I start to search for  it
> somewhere else ..."""
> 
>> for root, dirs, files in
>> os.walk("/home/fab/org"):
> 
>> for name in dirs:
>> dirs=os.path.join(root, name) + '/'
> 
> The above looks rather suspicious ...
> for thing in container:
> container = something_else
> 
> What are you trying to do?
> 
> 
>> for name in files:
>>  files=os.path.join(root, name)
> 
> and again 
> 
>> if fnmatch.fnmatch(str(files), "README*"):
> 
> Why str(name) ?
> 
>> print "File Found"
>> print str(files)
>> break
> 
> 
> fnmatch is not as capable as re; in particular it can't express "one
> or more digits". To search a directory tree for the first file whose
> name matches a pattern, you need something like this:
> def find_one(top, pat):
>for root, dirs, files in os.walk(top):
>   for fname in files:
>  if re.match(pat + '$', fname):
> return os.path.join(root, fname)
> 
> 
>> As soon as it finds the file,
> 
> "the" file or "a" file???
> 
> Ummm ... aren't you trying to locate a file whose EXACT name you found
> in the first exercise??
> 
> def find_it(top, required):
>for root, dirs, files in os.walk(top):
>   if required in files:
> return os.path.join(root, required)

Great :-) Thanks a lot for your help... it can be so easy :-)
Fabian


-- 
http://mail.python.org/mailman/listinfo/python-list


regex problem with re and fnmatch

2007-11-20 Thread Fabian Braennstroem
Hi,

I would like to use re to search for lines in a files with
the word "README_x.org", where x is any number.
E.g. the structure would look like this:
[[file:~/pfm_v99/README_1.org]]

I tried to use these kind of matchings:
#org_files='.*README\_1.org]]'
org_files='.*README\_*.org]]'
if re.match(org_files,line):

Unfortunately, it matches all entries with "README.org", but
not the wanted number!?

After some splitting and replacing I am able to check, if
the above file exists. If it does not, I start to search for
it using the 'walk' procedure:

for root, dirs, files in
os.walk("/home/fab/org"):
for name in dirs:
dirs=os.path.join(root, name) + '/'
for name in files:
 files=os.path.join(root, name)
if fnmatch.fnmatch(str(files), "README*"):
print "File Found"
print str(files)
break

As soon as it finds the file, it should stop the searching
process; but there is the same matching problem like above.
Does anyone have any suggestions about the regex problem?
Greetings!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: open remote terminal

2007-10-23 Thread Fabian Braennstroem
Hi Rafael,

Rafael Sachetto wrote:

> Take a look at this documentation:
> 
> http://pexpect.sourceforge.net/pxssh.html

thanks for the link, but it actually looks to me almost like my little
example... I somehow don't get it!? Any more hints?
Fabian

> 
>> >>>
>> >> pexpect would be the usual solution, I believe, if you could get it to
>> >> interact correctly with your virtual terminal.
>> >>
>> >>http://pexpect.sourceforge.net/
>>
>> I actually gave it a first very simple try:
>>
>> import pexpect
>> child=pexpect.spawn('xterm')
>> child.sendline('ls')
>>
>> Unfortunately nothing happens expect the start of xterm!? Does anyone
>> have an idea, what I am doing wrong?
>> Fabian
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>>
> 
> 
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: open remote terminal

2007-10-20 Thread Fabian Braennstroem
Fabian Braennstroem wrote:

> Hi Steve,
> 
> Steve Holden wrote:
> 
>> Fabian Braennstroem wrote:
>>> Hi,
>>> 
>>> I would like to use python to start an terminal, e.g. xterm, and login
>>> on a remote machine using rsh or ssh. This could be done using 'xterm -e
>>> ssh machine', but after the login I would like to jump to a given
>>> directory. Does anyone have an idea how to do this with python?
>>> 
>>> Regards!
>>> Fabian
>>> 
>> pexpect would be the usual solution, I believe, if you could get it to
>> interact correctly with your virtual terminal.
>> 
>>http://pexpect.sourceforge.net/

I actually gave it a first very simple try:

import pexpect
child=pexpect.spawn('xterm')
child.sendline('ls')

Unfortunately nothing happens expect the start of xterm!? Does anyone have
an idea, what I am doing wrong?
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pyparsing batch file

2007-10-20 Thread Fabian Braennstroem
Hi Paul,

Paul McGuire wrote:

> On Oct 17, 4:47 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> 
>> Unfortunately, it does not parse the whole file names with
>> the underscore and I do not know yet, how I can access the
>> line with 'define/boundary-conditions'. Every 'argument' of
>> that command should become a separate python variable!?
>> Does anyone have an idea, how I can achieve this!?
>> Regards!
>> Fabian
> 
> You are trying to match "keps1500_500.dat" with the expression
> "Word(alphanums)".  Since the filename contains characters other than
> alphas and numbers, you must add the remaining characters ("." and
> "_") to the expression.  Try changing:
> 
> write= Word(alphanums)
> 
> to:
> 
> write= Word(alphanums+"._")
> 
> 
> To help you to parse "/define/boundary-conditions in velocity-inlet 10
> 0.1 0.1 no 1", we would need to know just what these arguments are,
> and what values they can take.  I'll take a wild guess, and propose
> this:
> 
> real = Combine(integer + "." + integer)
> defineBoundaryConditions = "/define/boundary-conditions" + \
> oneOf("in out inout")("direction") + \
> Word(alphanums+"-")("conditionName") + \
> integer("magnitude") + \
> real("initialX") + \
> real("initialY") + \
> oneOf("yes no")("optional") + \
> integer("normal")
> 
> (Note I am using the new notation for setting results names,
> introduced in 1.4.7 - simply follow the expression with ("name"),
> instead of having to call .setResultsName.)
> 
> And here is a slight modification to your printout routine, using the
> dump() method of the ParseResults class:
> 
> for tokens in defineBoundaryConditions.searchString(data):
> print
> print "Boundary Conditions = "+ tokens.conditionName
> print tokens.dump()
> print
> print 50*"-"
> 
> 
> prints:
> 
> Boundary Conditions = velocity-inlet
> ['/define/boundary-conditions', 'in', 'velocity-inlet', '10', '0.1',
> '0.1', 'no', '1']
> - conditionName: velocity-inlet
> - direction: in
> - initialX: 0.1
> - initialY: 0.1
> - magnitude: 10
> - normal: 1
> - optional: no

Great! Thanks for the very good explanation! 

Regards!
Fabian





-- 
http://mail.python.org/mailman/listinfo/python-list


Re: open remote terminal

2007-10-20 Thread Fabian Braennstroem
Hi Steve,

Steve Holden wrote:

> Fabian Braennstroem wrote:
>> Hi,
>> 
>> I would like to use python to start an terminal, e.g. xterm, and login on
>> a remote machine using rsh or ssh. This could be done using 'xterm -e ssh
>> machine', but after the login I would like to jump to a given directory.
>> Does anyone have an idea how to do this with python?
>> 
>> Regards!
>> Fabian
>> 
> pexpect would be the usual solution, I believe, if you could get it to
> interact correctly with your virtual terminal.
> 
>http://pexpect.sourceforge.net/

Thanks for the advice!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


pyparsing batch file

2007-10-17 Thread Fabian Braennstroem
Hi,

me again :-)

I would like to parse a small batch file:

file/read-case kepstop.cas
file/read-data keps1500.dat
solve/monitors/residual/plot no
solve/monitors/residual/print yes
/define/boundary-conditions in velocity-inlet 10 0.1 0.1 no 1
it 500
wd keps1500_500.dat
yes
exit

Right now, I use this little example:

from pyparsing import *

input =
open("/home/fab/HOME/Dissertation/CFD/Fluent/Batch/fluent_batch",
'r')
data = input.read()

#
# Define Grammars
#

integer = Word(nums)
hexnums = Word(alphanums)
end = Literal("\n").suppress()
all = SkipTo(end)
#threadname = dblQuotedString
threadname_read_case = Literal("file/read-case")
threadname_read_data= Literal("file/read-data")
threadname_it = Literal("it")
write_data=Literal("wd")
cas_datei= Word(alphanums)
iteration= Word(nums)
write= Word(alphanums)
file_read_data= "file/read-data " + hexnums.setResultsName("rd")

logEntry = threadname_read_case.setResultsName("threadname")
+ cas_datei.setResultsName("cas_datei")+file_read_data
logEntry = file_read_data
logEntryNew = threadname_it.setResultsName("threadname") +
iteration.setResultsName("iteration")
logEntryWD = write_data.setResultsName("threadname") +
write.setResultsName("write")

#

for tokens in logEntryNew.searchString(data):
print
print "Iteration Command=\t "+ tokens.threadname
print "Number of Iterations=\t "+ tokens.iteration
for x in tokens.condition:
   print x
print 50*"-"

for tokens in logEntryWD.searchString(data):
print
print "Write Data Command=\t "+ tokens.threadname
print "Data File Name=\t "+ tokens.write
for x in tokens.condition:
   print x
print 50*"-"

for tokens in logEntry.searchString(data):
print
print "no idea=\t "+ tokens.threadname
print "Data File=\t "+ tokens.rd
print
for x in tokens.condition:
   print x
print 50*"-"


Unfortunately, it does not parse the whole file names with
the underscore and I do not know yet, how I can access the
line with 'define/boundary-conditions'. Every 'argument' of
that command should become a separate python variable!?
Does anyone have an idea, how I can achieve this!?
Regards!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list

open remote terminal

2007-10-17 Thread Fabian Braennstroem
Hi,

I would like to use python to start an terminal, e.g. xterm, and login on a
remote machine using rsh or ssh. This could be done using 'xterm -e ssh
machine', but after the login I would like to jump to a given directory.
Does anyone have an idea how to do this with python?

Regards!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extract text from log file using re

2007-09-15 Thread Fabian Braennstroem
Hi to all,

thanks for your help. The approach
print '\r\n'.join([x.strip() for x in
open('c:/flutest.txt') if 'e-0' in x])
works quite well :-)

Greetings!
Fabian

Fabian Braennstroem schrieb am 09/13/2007 09:09 PM:
> Hi,
> 
> I would like to delete a region on a log file which has this
> kind of structure:
> 
> 
> #--flutest
>498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
>499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
> reversed flow in 1 faces on pressure-outlet 35.
> 
> Writing
> "/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.cas"...
>  5429199 mixed cells, zone 29, binary.
> 11187656 mixed interior faces, zone 30, binary.
>20004 triangular wall faces, zone 31, binary.
> 1104 mixed velocity-inlet faces, zone 32, binary.
>   133638 triangular wall faces, zone 33, binary.
>14529 triangular wall faces, zone 34, binary.
> 1350 mixed pressure-outlet faces, zone 35, binary.
>11714 mixed wall faces, zone 36, binary.
>  1232141 nodes, binary.
>  1232141 node flags, binary.
> Done.
> 
> 
> Writing
> "/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.dat"...
> Done.
> 
>500 1.0049e-03 2.4630e-04 9.8395e-05 1.4865e-04
> 8.3913e-04 3.8545e-03 1.3315e-01 11:14:10  500
> 
>  reversed flow in 2 faces on pressure-outlet 35.
>501 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
> 
> #--
> 
> I have a small script, which removes lines starting with
> '(re)versed', '(i)teration' and '(t)urbulent'  and put the
> rest into an array:
> 
> # -- plot residuals 
>   import re
> filename="flutest"
> reversed_flow=re.compile('^\ re')
> turbulent_viscosity_ratio=re.compile('^\ tu')
> iteration=re.compile('^\ \ i')
> 
> begin_of_res=re.compile('>\ \ \ i')
> end_of_res=re.compile('^\ ad')
> 
> begin_of_writing=re.compile('^\Writing')
> end_of_writing=re.compile('^\Done')
> 
> end_number=0
> begin_number=0
> 
> 
> n = 0
> for line in open(filename).readlines():
> n = n + 1
> if begin_of_res.match(line):
> begin_number=n+1
> print "Line Number (begin): " + str(n)
> 
> if end_of_res.match(line):
> end_number=n
> print "Line Number (end): " + str(n)
> 
> if begin_of_writing.match(line):
> begin_w=n+1
> print "BeginWriting: " + str(n)
> print "HALLO"
> 
> if end_of_writing.match(line):
> end_w=n+1
> print "EndWriting: " +str(n)
> 
> if n > end_number:
> end_number=n
> print "Line Number (end): " + str(end_number)
> 
> 
> 
> 
> 
> n = 0
> array = []
> array_dummy = []
> array_mapped = []
> 
> mapped = []
> mappe = []
> 
> n = 0
> for line in open(filename).readlines():
> n = n + 1
> if (begin_number <= n) and (end_number > n):
> #if (begin_w <= n) and (end_w > n):
> if not reversed_flow.match(line) and not
> iteration.match(line) and not
> turbulent_viscosity_ratio.match(line):
> m=(line.strip().split())
> print m
> if len(m) > 0:
> #print len(m)
> laenge_liste=len(m)
> #print len(m)
> mappe.append(m)
> 
> 
> #--end plot
> residuals-
> 
> This works fine ; except for the region with the writing
> information:
> 
> #-writing information
> -
> Writing "/home/fb/fluent-0500.cas"...
>  5429199 mixed cells, zone 29, binary.
> 11187656 mixed interior faces, zone 30, binary.
>20004 triangular wall faces, zone 31, binary.
> 1104 mixed velocity-inlet faces, zone 32, binary.
>   133638 triangular wall faces, zone 33, binary.
>14529 triangular wall faces, zone 34, binary.
> 1350 mixed pressure-outlet faces, zone 35, binary.
>11714 mixed wall faces, zone 36, binary.
>  1232141 nodes, binary.
>  1232141 node flags, binary.
> Done.
> # ---end writing information ---
> 
> Does anyone know, how I can this 'writing' stuff too? The
> matchingIt occurs a lot :-(
> 
> Regards!
> Fabian
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extract text from log file using re

2007-09-13 Thread Fabian Braennstroem
me again... I should describe it better:
the result should be an array with just:

498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04
3.8560e-03 4.8384e-02 11:40:01  499
499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04  8.3956e-04
3.8560e-03 4.8384e-02 11:40:01  499
500 1.0049e-03 2.4630e-04 9.8395e-05 1.4865e-04 8.3913e-04
3.8545e-03 1.3315e-01 11:14:10  500
501 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04
3.8560e-03 4.8384e-02 11:40:01  499

as field values.

Fabian Braennstroem schrieb am 09/13/2007 09:09 PM:
> Hi,
> 
> I would like to delete a region on a log file which has this
> kind of structure:
> 
> 
> #--flutest
>498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
>499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
> reversed flow in 1 faces on pressure-outlet 35.
> 
> Writing
> "/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.cas"...
>  5429199 mixed cells, zone 29, binary.
> 11187656 mixed interior faces, zone 30, binary.
>20004 triangular wall faces, zone 31, binary.
> 1104 mixed velocity-inlet faces, zone 32, binary.
>   133638 triangular wall faces, zone 33, binary.
>14529 triangular wall faces, zone 34, binary.
> 1350 mixed pressure-outlet faces, zone 35, binary.
>11714 mixed wall faces, zone 36, binary.
>  1232141 nodes, binary.
>  1232141 node flags, binary.
> Done.
> 
> 
> Writing
> "/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.dat"...
> Done.
> 
>500 1.0049e-03 2.4630e-04 9.8395e-05 1.4865e-04
> 8.3913e-04 3.8545e-03 1.3315e-01 11:14:10  500
> 
>  reversed flow in 2 faces on pressure-outlet 35.
>501 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
> 8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
> 
> #--
> 
> I have a small script, which removes lines starting with
> '(re)versed', '(i)teration' and '(t)urbulent'  and put the
> rest into an array:
> 
> # -- plot residuals 
>   import re
> filename="flutest"
> reversed_flow=re.compile('^\ re')
> turbulent_viscosity_ratio=re.compile('^\ tu')
> iteration=re.compile('^\ \ i')
> 
> begin_of_res=re.compile('>\ \ \ i')
> end_of_res=re.compile('^\ ad')
> 
> begin_of_writing=re.compile('^\Writing')
> end_of_writing=re.compile('^\Done')
> 
> end_number=0
> begin_number=0
> 
> 
> n = 0
> for line in open(filename).readlines():
> n = n + 1
> if begin_of_res.match(line):
> begin_number=n+1
> print "Line Number (begin): " + str(n)
> 
> if end_of_res.match(line):
> end_number=n
> print "Line Number (end): " + str(n)
> 
> if begin_of_writing.match(line):
> begin_w=n+1
> print "BeginWriting: " + str(n)
> print "HALLO"
> 
> if end_of_writing.match(line):
> end_w=n+1
> print "EndWriting: " +str(n)
> 
> if n > end_number:
> end_number=n
> print "Line Number (end): " + str(end_number)
> 
> 
> 
> 
> 
> n = 0
> array = []
> array_dummy = []
> array_mapped = []
> 
> mapped = []
> mappe = []
> 
> n = 0
> for line in open(filename).readlines():
> n = n + 1
> if (begin_number <= n) and (end_number > n):
> #if (begin_w <= n) and (end_w > n):
> if not reversed_flow.match(line) and not
> iteration.match(line) and not
> turbulent_viscosity_ratio.match(line):
> m=(line.strip().split())
> print m
> if len(m) > 0:
> #print len(m)
> laenge_liste=len(m)
> #print len(m)
> mappe.append(m)
> 
> 
> #--end plot
> residuals-
> 
> This works fine ; except for the region with the writing
> information:
> 
> #-writing information
> -
> Writing "/home/fb/fluent-0500.cas"...
>  5429199 mixed cells, zone 29, binary.
> 11187656 mixed interior faces, zone 30, binary.
>20004 triangular wall faces, zone 31, binary.
> 1104 mixed velocity-inlet faces, zone 32, binary.
>   133638 triangular wall faces, zone 33, binary.
>14529 triangular wall faces, zone 34, binary.
> 1350 mixed pressure-outlet faces, zone 35, binary.
>11714 mixed wall faces, zone 36, binary.
>  1232141 nodes, binary.
>  1232141 node flags, binary.
> Done.
> # ---end writing information ---
> 
> Does anyone know, how I can this 'writing' stuff too? The
> matchingIt occurs a lot :-(
> 
> Regards!
> Fabian
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


extract text from log file using re

2007-09-13 Thread Fabian Braennstroem
Hi,

I would like to delete a region on a log file which has this
kind of structure:


#--flutest
   498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
   499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499
reversed flow in 1 faces on pressure-outlet 35.

Writing
"/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.cas"...
 5429199 mixed cells, zone 29, binary.
11187656 mixed interior faces, zone 30, binary.
   20004 triangular wall faces, zone 31, binary.
1104 mixed velocity-inlet faces, zone 32, binary.
  133638 triangular wall faces, zone 33, binary.
   14529 triangular wall faces, zone 34, binary.
1350 mixed pressure-outlet faces, zone 35, binary.
   11714 mixed wall faces, zone 36, binary.
 1232141 nodes, binary.
 1232141 node flags, binary.
Done.


Writing
"/home/gcae504/SCR1/Solververgleich/Klimakruemmer_AK/CAD/Daimler/fluent-0500.dat"...
Done.

   500 1.0049e-03 2.4630e-04 9.8395e-05 1.4865e-04
8.3913e-04 3.8545e-03 1.3315e-01 11:14:10  500

 reversed flow in 2 faces on pressure-outlet 35.
   501 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04
8.3956e-04 3.8560e-03 4.8384e-02 11:40:01  499

#--

I have a small script, which removes lines starting with
'(re)versed', '(i)teration' and '(t)urbulent'  and put the
rest into an array:

# -- plot residuals 
  import re
filename="flutest"
reversed_flow=re.compile('^\ re')
turbulent_viscosity_ratio=re.compile('^\ tu')
iteration=re.compile('^\ \ i')

begin_of_res=re.compile('>\ \ \ i')
end_of_res=re.compile('^\ ad')

begin_of_writing=re.compile('^\Writing')
end_of_writing=re.compile('^\Done')

end_number=0
begin_number=0


n = 0
for line in open(filename).readlines():
n = n + 1
if begin_of_res.match(line):
begin_number=n+1
print "Line Number (begin): " + str(n)

if end_of_res.match(line):
end_number=n
print "Line Number (end): " + str(n)

if begin_of_writing.match(line):
begin_w=n+1
print "BeginWriting: " + str(n)
print "HALLO"

if end_of_writing.match(line):
end_w=n+1
print "EndWriting: " +str(n)

if n > end_number:
end_number=n
print "Line Number (end): " + str(end_number)





n = 0
array = []
array_dummy = []
array_mapped = []

mapped = []
mappe = []

n = 0
for line in open(filename).readlines():
n = n + 1
if (begin_number <= n) and (end_number > n):
#if (begin_w <= n) and (end_w > n):
if not reversed_flow.match(line) and not
iteration.match(line) and not
turbulent_viscosity_ratio.match(line):
m=(line.strip().split())
print m
if len(m) > 0:
#print len(m)
laenge_liste=len(m)
#print len(m)
mappe.append(m)


#--end plot
residuals-

This works fine ; except for the region with the writing
information:

#-writing information
-
Writing "/home/fb/fluent-0500.cas"...
 5429199 mixed cells, zone 29, binary.
11187656 mixed interior faces, zone 30, binary.
   20004 triangular wall faces, zone 31, binary.
1104 mixed velocity-inlet faces, zone 32, binary.
  133638 triangular wall faces, zone 33, binary.
   14529 triangular wall faces, zone 34, binary.
1350 mixed pressure-outlet faces, zone 35, binary.
   11714 mixed wall faces, zone 36, binary.
 1232141 nodes, binary.
 1232141 node flags, binary.
Done.
# ---end writing information ---

Does anyone know, how I can this 'writing' stuff too? The
matchingIt occurs a lot :-(

Regards!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


vte examples and installation

2007-05-28 Thread Fabian Braennstroem
Hi,

I am looking for simple vte examples mainly for pygtk.
Can anyone point me in the right direction or is there a better
terminal emulation for pygtk? It would be nice, if there exist a
good howto for installing vte up for the use of python; esp. for an
old redhat/scientific linux machine... I am a little bit confused!?

Greetings!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: track cpu usage of linux application

2007-05-15 Thread Fabian Braennstroem
Hi,
thanks to both! I will take a look at the proc files!

* James T. Dennis <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi,
>
>>I would like to track the cpu usage of a couple of
>>programs using python. Maybe it works somehow with
>>piping 'top' to python read the cpu load for a greped
>>application and clocking the the first and last
>>appearence. Is that a good approach or does anyone have
>>a more elegant way to do that?
>
>> Greetings!
>> Fabian
>
>  If you're on a Linux system you might be far better accessing
>  the /proc/$PID/stat files directly. The values you'd find therein
>  are documented:
>
>   http://www.die.net/doc/linux/man/man5/proc.5.html
>
>  (among other places).
>
>  Of course you could write you code to look for file and fall back
>  to use the 'ps' command if it fails.  In addition you can supply
>  arguments to the 'ps' command to limit it to reporting just on the
>  process(es) in which you are interested ... and to eliminate the
>  header line and irrelevant columns of output.

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


track cpu usage of linux application

2007-05-14 Thread Fabian Braennstroem
Hi,

I would like to track the cpu usage of a couple of
programs using python. Maybe it works somehow with
piping 'top' to python read the cpu load for a greped
application and clocking the the first and last
appearence. Is that a good approach or does anyone have
a more elegant way to do that?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pattern search

2007-03-29 Thread Fabian Braennstroem
Hi Paul,

Paul McGuire schrieb am 03/27/2007 07:19 PM:
> On Mar 27, 3:13 pm, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi to all,
>>
>> Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
>>
>>> Fabian Braennstroem wrote:
>>>> Now, I would like to improve it by searching for different 'real'
>>>> patterns just like using 'ls' in bash. E.g. the entry
>>>> 'car*.pdf' should select all pdf files with a beginning 'car'.
>>>> Does anyone have an idea, how to do it?
>>> Use module glob.
>> Thanks for your help! glob works pretty good, except that I just
>> deleted all my lastet pdf files :-(
>>
>> Greetings!
>> Fabian
> 
> Then I shudder to think what might have happened if you had used
> re's! :)

A different feature it had was to copy the whole home-partition
(about 19G) into one of its own directories ... the strange thing:
it just needed seconds to do that and I did not have the permission
to all files and directories! It was pretty strange! Hopefully it
was no security bug in python...

Greetings!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pattern search

2007-03-28 Thread Fabian Braennstroem
Hi,

Gabriel Genellina schrieb am 03/27/2007 10:09 PM:
> En Tue, 27 Mar 2007 18:42:15 -0300, Diez B. Roggisch <[EMAIL PROTECTED]>  
> escribió:
> 
>> Paul McGuire schrieb:
>>> On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>>>> Fabian Braennstroem wrote:
>>>>> while iter:
>>>>> value = model.get_value(iter, 1)
>>>>> if value.endswith("."+ pattern): [...]
>>>>>
>>>>> Now, I would like to improve it by searching for different 'real'
>>>>> patterns just like using 'ls' in bash. E.g. the entry
>>>>> 'car*.pdf' should select all pdf files with a beginning 'car'.
>>>>> Does anyone have an idea, how to do it?
> 
>>>> Use regular expressions. They are part of the module "re". And if you  
>>>> use them, ditch your code above, and make it just search for a pattern  
>>>> all the time. Because the above is just the case of
>>>> *.ext
> 
>>> The glob module is a more direct tool based on the OP's example.  The
>>> example he gives works directly with glob.  To use re, you'd have to
>>> convert to something like "car.*\.pdf", yes?
> 
>> I'm aware of the glob-module. But it only works on files. I was under
>> the impression that he already has a list of files he wants to filter
>> instead of getting it fresh from the filesystem.
> 
> In that case the best way would be to use the fnmatch module - it already  
> knows how to translate from car*.pdf into the right regexp. (The glob  
> module is like a combo os.listdir+fnmatch.filter)

I have a already a list, but I 'glob' looked so easy ... maybe it is
 faster to use fnmatch. When I have time I try it out...

Thanks!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: pattern search

2007-03-27 Thread Fabian Braennstroem
Hi to all,

Wojciech Mu?a schrieb am 03/27/2007 03:34 PM:
> Fabian Braennstroem wrote:
>> Now, I would like to improve it by searching for different 'real'
>> patterns just like using 'ls' in bash. E.g. the entry
>> 'car*.pdf' should select all pdf files with a beginning 'car'.
>> Does anyone have an idea, how to do it?
> 
> Use module glob.

Thanks for your help! glob works pretty good, except that I just
deleted all my lastet pdf files :-(

Greetings!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


pattern search

2007-03-27 Thread Fabian Braennstroem
Hi,

I wrote a small gtk file manager, which works pretty well. Until
now, I am able to select different file (treeview entries) just by
extension (done with 'endswith'). See the little part below:

self.pathlist1=[ ]
self.patternlist=[ ]
while iter:
#print iter
value = model.get_value(iter, 1)
#if value is what I'm looking for:
if value.endswith("."+ pattern):
selection.select_iter(iter)
selection.select_path(n)
self.pathlist1.append(n)
self.patternlist.append(value)
iter = model.iter_next(iter)
#print value
n=n+1

Now, I would like to improve it by searching for different 'real'
patterns just like using 'ls' in bash. E.g. the entry
'car*.pdf' should select all pdf files with a beginning 'car'.
Does anyone have an idea, how to do it?

Greetings!
Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: python 2.5 install from source problem

2006-12-02 Thread Fabian Braennstroem
Hi Martin,

* Martin v. Löwis <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem schrieb:
>> I just tried to install python 2.5 from source on my
>> ScienticLinux (Redhat Clone) machine. It seems to work
>> without any problem, at least I am able to run some of my
>> old scripts. I installed it with './configure
>> --prefix=/opt/python make make altinstall', but now for a
>> 'vtk' installation which needs the python libraries I am not
>> able to find a file like 'libpython2.5.so.*', which I think
>> should be produced (at least at my office's machine (redhat)
>> it is there). I just can find a 'libpython2.5.a' file ...
>> 
>> Do I do something wrong?
>
> I'd say it is a bug in vtk that it requires libpython2.5.so.*.
> However, to work-around, you can configure Python with
> --enable-shared. Make sure to set LD_LIBRARY_PATH or LD_RUN_PATH
> appropriately.

Thanks a lot!


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


python 2.5 install from source problem

2006-12-01 Thread Fabian Braennstroem
Hi,

I just tried to install python 2.5 from source on my
ScienticLinux (Redhat Clone) machine. It seems to work
without any problem, at least I am able to run some of my
old scripts. I installed it with './configure
--prefix=/opt/python make make altinstall', but now for a
'vtk' installation which needs the python libraries I am not
able to find a file like 'libpython2.5.so.*', which I think
should be produced (at least at my office's machine (redhat)
it is there). I just can find a 'libpython2.5.a' file ...

Do I do something wrong?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: small python cgi webserver

2006-11-04 Thread Fabian Braennstroem
Hi Norbert,

* Norbert Kaufmann <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
> [...]
>> 
>> Maybe, I understood something wrong, but I thought that the
>> above 'webserver' script would replace apache in my case; at
>> least I hoped!?
>> 
>
> It does. The 'ServerRoot' and 'DocumentRoot' directories are the
> directories you are starting your webserver in.
> Create a 'cgi' directory inside this and consider that you have to name
> it in the serverscript in relation to the serverroot!
>
> 
> cgi_directories=["/home/fab/Desktop/cgi-bin"]
> 
>
> This means you have to start your server inside directory '/'.

I tried this, but it does not help ... a wait, the leading
'/' is the problem. Thanks!
>
> If you start your server in your home dir '/home/fab' then you have to
> name your cgi_directories ['/Desktop/cgi-bin'].
>
> In your response (cgi-script) you have to divide the header from the
> content '\r\n\r\n'.

I am not sure, what that means!?  ... but it works :-)

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: small python cgi webserver

2006-11-04 Thread Fabian Braennstroem
Hi,

* ArdPy <[EMAIL PROTECTED]> wrote:
>
> Fabian Braennstroem wrote:
>> Hi,
>>
>> I am looking for a small python script, which starts a small
>> web server with python cgi support on a linux machine.
>>
>> I tried:
>>
>>
>>   #!/usr/bin/env python
>>   import sys
>>   from CGIHTTPServer import CGIHTTPRequestHandler
>>   import BaseHTTPServer
>>
>>   class MyRequestHandler(CGIHTTPRequestHandler):
>>   # In diesem Verzeichnis sollten die CGI-Programme stehen:
>>   cgi_directories=["/home/fab/Desktop/cgi-bin"]
>>
>>
>>   def run():
>>   # 8000=Port-Nummer
>>   #   --> http://localhost:8000/
>>   # Fuer http://localhost/
>>   #   Port-Nummer auf 80 setzen
>>   httpd=BaseHTTPServer.HTTPServer(('', 8000), MyRequestHandler)
>>   httpd.serve_forever()
>>
>>   if __name__=="__main__":
>>   print "Starting Server"
>>   run()
>>
>> but when I want to test a small python cgi test file:
>>
>>
>>   #!/usr/bin/python
>>   # -*- coding: UTF-8 -*-
>>
>>   # Debugging für CGI-Skripte 'einschalten'
>>   import cgitb; cgitb.enable()
>>
>>   print "Content-Type: text/html;charset=utf-8\n"
>>   print "Hello World!"
>>
>> I just get the text and not the html output. The file's mode
>> is 755.
>>
>> Is there anything wrong with the webserver script or do I do
>> something completely wrong? Maybe, you have a different
>> webserver script?
>>
>> Greetings!
>>  Fabian
>
> Probably the server is not executing your CGI script. If it is the
> Apache web server that you are using then just ensure the following
> settings in your /etc/httpd/conf/httpd.conf file is exactly like
> following:
>
> 
> AllowOverride None
> Options ExecCGI
> Order allow,deny
> Allow from all
> 

Maybe, I understood something wrong, but I thought that the
above 'webserver' script would replace apache in my case; at
least I hoped!?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


small python cgi webserver

2006-11-04 Thread Fabian Braennstroem
Hi,

I am looking for a small python script, which starts a small
web server with python cgi support on a linux machine.

I tried:


  #!/usr/bin/env python
  import sys
  from CGIHTTPServer import CGIHTTPRequestHandler
  import BaseHTTPServer
  
  class MyRequestHandler(CGIHTTPRequestHandler):
  # In diesem Verzeichnis sollten die CGI-Programme stehen:
  cgi_directories=["/home/fab/Desktop/cgi-bin"]
  
  
  def run():
  # 8000=Port-Nummer
  #   --> http://localhost:8000/
  # Fuer http://localhost/ 
  #   Port-Nummer auf 80 setzen
  httpd=BaseHTTPServer.HTTPServer(('', 8000), MyRequestHandler)
  httpd.serve_forever()
  
  if __name__=="__main__":
  print "Starting Server"
  run()

but when I want to test a small python cgi test file:


  #!/usr/bin/python
  # -*- coding: UTF-8 -*-

  # Debugging fÃŒr CGI-Skripte 'einschalten'
  import cgitb; cgitb.enable()

  print "Content-Type: text/html;charset=utf-8\n"
  print "Hello World!"

I just get the text and not the html output. The file's mode
is 755.

Is there anything wrong with the webserver script or do I do
something completely wrong? Maybe, you have a different
webserver script?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: change keybindings for pygtk treeview

2006-10-28 Thread Fabian Braennstroem
Hi,

* Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am just testing pygtk/glade out and wonder, if I am able
> to change the keybindings. E.g. the treeview searches by
> default for the entries beginning with the typed keystroke;
> moving to the next row works as usual with the Down key. Now
> I would like to change the key bindings to e.g. 'j' to move
> to the next row (just like in vim) and to use a 'Ctrl' key
> combination to search for a certain word beginning with the
> typed key stroke.

I just found out, that I am able to turn it of with
'treeview.set_enable_search(False)'. Works nice.

An option would be, to toggle the searching function with
some keystroke, e.g. 'Ctrl-s'. And set a key binding for the
movement to 'j' and 'k' when the search mode is disabled. I
think I could do it somehow with the 'accelgroup' function,
but did not find enough information to get a clue out of it.

Does anybody have an idea?

In a small curses based file manager (lfm) there is an
assignment of keybindings via a keytable

keytable = {
# movement
ord('p'): 'cursor_up',
ord('k'): 'cursor_up',
ord('K'): 'cursor_up2',
ord('P'): 'cursor_up',
curses.KEY_UP: 'cursor_up',
ord('n'): 'cursor_down',
ord('j'): 'cursor_down',
ord('J'): 'cursor_down2',
ord('N'): 'cursor_down',
...

Would that work in any way for a pygtk program too?


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


change keybindings for pygtk treeview

2006-10-27 Thread Fabian Braennstroem
Hi,

I am just testing pygtk/glade out and wonder, if I am able
to change the keybindings. E.g. the treeview searches by
default for the entries beginning with the typed keystroke;
moving to the next row works as usual with the Down key. Now
I would like to change the key bindings to e.g. 'j' to move
to the next row (just like in vim) and to use a 'Ctrl' key
combination to search for a certain word beginning with the
typed key stroke.
Is it anyhow possible with pygtk? Would be nice, if somebody
can point my to a small example.

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Adding Worksheets to an Excel Workbook

2006-10-13 Thread Fabian Braennstroem
Hi Wesley,

* wesley chun <[EMAIL PROTECTED]> wrote:
>> just a small OT question coming from a linux openoffice
>> system...
>>
>> Does there exist something similar for powerpoint? Would be
>> nice, if anybody can direct me to more examples...
>
>
> fabian,
>
> see below for a PP example.  you mentioned you were coming from a
> linux OOo system... are you trying to do COM stuff with OOo?  i'm not
> familiar with it, but since they do support
> some level of VB-like scripting, i don't believe it's out of the question.
>
> one thing that i did forget to mention in my earlier message is that i
> use static dispatch for these apps.  if you did not go and run the
> makepy utility, you would have to use dynamic dispatch, start your
> apps with win32com.client.Dispatch(), or, using the same import
> statement as below, win32.Dispatch().


>
> anyway, here is pretty much the same script as i sent earlier but for
> PowerPoint instead of Excel (the book has small examples for each of
> Excel, Word, PowerPoint, and Outlook):
>
> # based on ppoint.pyw in Core Python Programming, 2nd ed
>
> from time import sleep
> import win32com.client as win32
>
> def ppoint():
> ppoint = win32.gencache.EnsureDispatch('PowerPoint.Application')
> pres = ppoint.Presentations.Add()
> ppoint.Visible = True
>
> s1 = pres.Slides.Add(1, win32.constants.ppLayoutText)
> sleep(1)
> s1a = s1.Shapes[0].TextFrame.TextRange
> s1a.Text = 'Python-to-PowerPoint Demo'
> sleep(1)
> s1b = s1.Shapes[1].TextFrame.TextRange
> for i in range(3, 8):
> s1b.InsertAfter("Line %d\r\n" % i)
> sleep(1)
> s1b.InsertAfter("\r\nTh-th-th-that's all folks!")
>
> sleep(5)
> pres.Close()
> ppoint.Quit()
>
> if __name__=='__main__':
> ppoint()

Thanks! I am not able to try it out yet, but as soon as I
get access to my windows machine, I'll give it a try.


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 3D Vector Type Line-Drawing Program

2006-10-13 Thread Fabian Braennstroem
Hi,

I am not sure, if that is, what your looking for, but
with 'salome' you able to produce 3D drawings with an GUI or
using a python script. Take a look at:

http://www.salome-platform.org/home/presentation/geom/

* Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Ron Adam wrote:
>> Scott David Daniels wrote:
>>> Ron Adam wrote:
 ... Is there a way to have the display show a wire frame image instead of 
 shaded shapes?
>>> You can draw the edges as lines.
>> 
>> Is there a setting for this?, or are you suggesting reading the 
>> coordinates and creating curve objects for the edges?
> Nope, you'd have to make a poly line which was the wire frame, but it
> would then rotate and such with the rest of the model.  Essentially
> you would, for each primitive, have a wire-frame and a volumetric
> version, and keep one of the two visible (with the other invisible)
> at all times.
>
 Is there an easy way to convert a display to something that can be 
 printed?
>>>
>>> You can generate POV-ray source.  This is not a system for creating
>>> beautiful pictures, but rather a great 3-D sketch pad.
>
> Now POV-ray _will_ create beautiful pictures, but the texturing,
> shading, and lighting control that POV-ray gives you exceeds that
> of VPython.  You could use VPython to get you model built and view-
> point placed, and the tweak the POV-ray code to get pretty output.
>
> --Scott David Daniels
> [EMAIL PROTECTED]
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Adding Worksheets to an Excel Workbook

2006-10-11 Thread Fabian Braennstroem
Hi,

just a small OT question coming from a linux openoffice
system...

* wesley chun <[EMAIL PROTECTED]> wrote:
>> From: [EMAIL PROTECTED]
>> Date: Tues, Oct 10 2006 2:08 pm
>>
>> I'm a Python newbie, and I'm just getting to the wonders of COM
>> programming.
>
>
> welcome to Python!!  i too, have (recently) been interested in COM
> programming, so much so that i added some material on Microsoft Office
> (Win32 COM Client) Programming to the 2nd ed of my book, "Core Python
> Programming" (see link below).  it's only introductory material, but i
> think you may find it useful as i have, and shows you how to create
> simple applications for Excel, Word, PowerPoint, and Outlook.
>
> in addition to greg's code snippet, here's a snippet based on one from
> the book (the code is under a CC license) -- it doesn't add a new
> sheet, but does let you grab the "active" one (the one that is tabbed
> and facing the user):
>
> # based on excel.pyw in Core Python Programming, 2nd ed
>
> from time import sleep
> import win32com.client as win32
>
> def excel():
> xl = win32.gencache.EnsureDispatch('Excel.Application')
> ss = xl.Workbooks.Add() # add a new spreadsheet/workbook
> sh = ss.ActiveSheet  # grab the active sheet of the workbook
> xl.Visible = True# make Excel show up on the desktop
> sleep(1)
>
> sh.Cells(1,1).Value = 'Python-to-Excel Demo'
> sleep(1)
> for i in range(3, 8):
> sh.Cells(i,1).Value = 'Line %d' % i
> sleep(1)
> sh.Cells(i+2,1).Value = "Th-th-th-that's all folks!"
>
> sleep(5)
> ss.Close(False) # close the workbook and don't save
> xl.Application.Quit() # quit Excel
>
> if __name__=='__main__':
> excel()
>
> hope this helps!

Does there exist something similar for powerpoint? Would be
nice, if anybody can direct me to more examples...

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


change directory when closing curses program

2006-10-09 Thread Fabian Braennstroem
Hi,

I am using lfm, a curses based file manager, and want to
change into the last directory of my lfm-session after
closing it. To be more clear:

1) run lfm from console in the home directory ~
2) move to ~/something
3) close lfm
4) be in ~/something on the console

Is that possible in any way? lfm uses a bash-function for this
purpose , which does not work in tcsh ... :-(

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Scientific computing and data visualization.

2006-10-08 Thread Fabian Braennstroem
Hi Bernhard,

* [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> > I can definitively second that. ROOT is a bit hard to learn but very,
>> > very powerful and PyRoot is really a pleasure to work with.
>>
>> It sounds interesting. Right now, I use matplotlib for
>> 2D plotting and vtk for 3D. Do you have any experience and
>> can give some recommendations?
>
> Hi Fabian!
>
> I recommend using matplotlib for data visualization, because the usage
> of the plotting commands is much(!!!) more convenient. In ROOT you have
> to create objects before you can draw your diagrams. The constructor
> often requires arguments about the number of space points, axis length,
> name etc. On the other hand, the figure itself has a GUI to manipulate
> the plot, which sometimes is nicer than doing everything in the script.
> In particular the 3D visualization seems to be more comprehensive (lots
> of drawing options, rotation of the plot with the mouse, changing of
> visualization lego, surf, contour plots etc.).
>
> ROOT has more than plotting. For example it has a whole bunch of
> containers to store very large amounts of data (within complex
> datastructures), fitting routines, minimizers etc. But you get that
> with scipy and numpy.
>
> I'm using 80% of the time matplotlib because it's much quicker for
> quick glances at your data. If I need sophisitcated 3D plots, I use
> ROOT, but I would love to switch to matplotlib for this, as well.
>
> My guess is that using python and matplotlib with scipy speeds up my
> work by at least 30% in comparison to using purely ROOT (and code in
> C++). And even 10-15% in comparison to the usage of ROOT with pyRoot.

Thanks for your advice!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Scientific computing and data visualization.

2006-10-07 Thread Fabian Braennstroem
Hi,

* Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>> A commonly used data analysis framework is root (http://root.cern.ch).
>> It offers a object oriented C++ framework with all kind of things one
>> needs for plotting and data visualization. It comes along with PyRoot,
>> an interface making the root objects available to Python.
>> Take a look at the root manual for examples, it also contains a section
>> describing the use of PyRoot.
>
> I can definitively second that. ROOT is a bit hard to learn but very,
> very powerful and PyRoot is really a pleasure to work with.

It sounds interesting. Right now, I use matplotlib for
2D plotting and vtk for 3D. Do you have any experience and
can give some recommendations?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: extract certain values from file with re

2006-10-07 Thread Fabian Braennstroem
Hi to all,

thanks a lot! I am pretty sure your ideas help :-)



Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


extract certain values from file with re

2006-10-06 Thread Fabian Braennstroem
Hi,

I would like to remove certain lines from a log files. I had
some sed/awk scripts for this, but now, I want to use python
with its re module for this task. 

Actually, I have two different log files. The first file looks
like:

   ...
   'some text'
   ...
   
   ITER I- GLOBAL ABSOLUTE RESIDUAL -I  
I FIELD VALUES AT MONITORING LOCATION  --I
NOUMOM VMOM WMOM MASS T EN DISS ENTH   
UVWP   TE   EDT
 1  9.70E-02 8.61E-02 9.85E-02 1.00E+00 1.61E+01 7.65E+04 0.00E+00  
1.04E-01-8.61E-04 3.49E-02 1.38E-03 7.51E-05 1.63E-05 2.00E+01
 2  3.71E-02 3.07E-02 3.57E-02 1.00E+00 3.58E-01 6.55E-01 0.00E+00  
1.08E-01-1.96E-03 4.98E-02 7.11E-04 1.70E-04 4.52E-05 2.00E+01
 3  2.64E-02 1.99E-02 2.40E-02 1.00E+00 1.85E-01 3.75E-01 0.00E+00  
1.17E-01-3.27E-03 6.07E-02 4.02E-04 4.15E-04 1.38E-04 2.00E+01
 4  2.18E-02 1.52E-02 1.92E-02 1.00E+00 1.21E-01 2.53E-01 0.00E+00  
1.23E-01-4.85E-03 6.77E-02 1.96E-05 9.01E-04 3.88E-04 2.00E+01
 5  1.91E-02 1.27E-02 1.70E-02 1.00E+00 8.99E-02 1.82E-01 0.00E+00  
1.42E-01-6.61E-03 7.65E-02 1.78E-04 1.70E-03 9.36E-04 2.00E+01
   ...
   ...
   ...
   
  2997  3.77E-04 2.89E-04 3.05E-04 2.71E-02 5.66E-04 6.28E-04 0.00E+00 
-3.02E-01 3.56E-02-7.97E-02-7.11E-02 4.08E-02 1.86E-01 2.00E+01
  2998  3.77E-04 2.89E-04 3.05E-04 2.71E-02 5.65E-04 6.26E-04 0.00E+00 
-3.02E-01 3.63E-02-8.01E-02-7.10E-02 4.02E-02 1.83E-01 2.00E+01
  2999  3.76E-04 2.89E-04 3.05E-04 2.70E-02 5.64E-04 6.26E-04 0.00E+00 
-3.02E-01 3.69E-02-8.04E-02-7.10E-02 3.96E-02 1.81E-01 2.00E+01
  3000  3.78E-04 2.91E-04 3.07E-04 2.74E-02 5.64E-04 6.26E-04 0.00E+00 
-3.01E-01 3.75E-02-8.07E-02-7.09E-02 3.91E-02 1.78E-01 2.00E+01
&&  --  
   
   
   'some text'
   

I actually want to extract the lines with the numbers, write
them to a file and finally use gnuplot for plotting them. A
nicer and more python way would be to extract those numbers,
write them into an array according to their column and plot
those using the gnuplot or matplotlib module :-)

Unfortunately, I am pretty new to the re module and tried
the following so far:


  import re
  pat = re.compile('\ \ \ NO.*?&&', re.DOTALL)
  print re.sub(pat, '', open('log_star_orig').read()) 
  

but this works just the other way around, which means that
the original log file is printed without the number part. So
the next step would be to delete the part from the first
line to '\ \ \ \ NO' and the part from '&&' to the end,
but I do not know how to address the first and last line!?

Would be nice, if you can give me a hint and especially
interesting would it be, when you have an idea, how I can
put those columns in arrays, so I can plot them right away!


A more difficult log file looks like:

 ==
 OUTER LOOP ITERATION =1 CPU SECONDS = 2.40E+01
 --
 |   Equation   | Rate | RMS Res | Max Res |  Linear Solution |
 +--+--+-+-+--+
 | U-Mom| 0.00 | 1.0E-02 | 5.0E-01 |   4.9E-03  OK|
 | V-Mom| 0.00 | 2.4E-14 | 5.6E-13 |   3.8E+09  ok|
 | W-Mom| 0.00 | 2.5E-14 | 8.2E-13 |   8.3E+09  ok|
 | P-Mass   | 0.00 | 1.1E-02 | 3.4E-01 |  8.9  2.7E-02  OK|
 +--+--+-+-+--+
 | K-TurbKE | 0.00 | 1.8E+00 | 1.8E+00 |  5.8  2.2E-08  OK|
 | E-Diss.K | 0.00 | 1.9E+00 | 2.0E+00 | 12.4  2.2E-08  OK|
 +--+--+-+-+--+

 ==
 OUTER LOOP ITERATION =2 CPU SECONDS = 8.57E+01
 --
 |   Equation   | Rate | RMS Res | Max Res |  Linear Solution |
 +--+--+-+-+--+
 | U-Mom| 1.44 | 1.5E-02 | 5.3E-01 |   9.6E-03  OK|
 | V-Mom|99.99 | 1.1E-03 | 6.2E-02 |   5.7E-02  OK|
 | W-Mom|99.99 | 1.9E-03 | 6.0E-02 |   5.9E-02  OK|
 | P-Mass   | 0.27 | 3.0E-03 | 2.0E-01 |  8.9  7.9E-02  OK|
 +--+--+-+-+--+
 | K-TurbKE | 0.03 | 5.4E-02 | 4.4E-01 |  5.8  2.9E-08  OK|
 | E-Diss.K | 0.05 | 8.9E-02 | 9.3E-01 | 12.4  2.6E-08  OK|
 +--+--+-+-+--+



...
...
...


 ==
 OUTER LOOP ITERATION =  416 CPU SECONDS = 2.28E+04
 

Re: python gtk based file manager

2006-09-25 Thread Fabian Braennstroem
Hi,

* faulkner <[EMAIL PROTECTED]> wrote:
> http://www.google.com/search?q=emelfm2
> awesome file manager written in C using gtk.
> i've been meaning to write something like emelfm in pygtk, but emelfm
> already exists...

Thanks! I found it too, but I am looking for a python
version ... python seems to me a lot easier than C, esp. for
adjusting and adding some functions for my daily use. I
found wxPyAtol, which could be a good base, but
unfortunately there is no wx installed at my office machine
:-(

>
> Fabian Braennstroem wrote:
>> Hi,
>>
>> I am looking for a file manager based on pygtk. It seems
>> that there does not exist any!? Maybe, someone has a hint or
>> already some starting code lines for such a 'thing'!?
>> 
>> Greetings!
>>  Fabian
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


python gtk based file manager

2006-09-25 Thread Fabian Braennstroem
Hi,

I am looking for a file manager based on pygtk. It seems
that there does not exist any!? Maybe, someone has a hint or
already some starting code lines for such a 'thing'!?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: latex openoffice converter

2006-09-16 Thread Fabian Braennstroem
Hi to both,

thanks! I'll try them ...

* Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to use python to convert 'simple' latex
> documents into openoffice format. Maybe, anybody has done
> something similar before and can give me a starting point!?
> Would be nice to hear some hints!
>
> Greetings!
>  Fabian
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


latex openoffice converter

2006-09-14 Thread Fabian Braennstroem
Hi,

I would like to use python to convert 'simple' latex
documents into openoffice format. Maybe, anybody has done
something similar before and can give me a starting point!?
Would be nice to hear some hints!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: radio buttons in curses

2006-08-24 Thread Fabian Braennstroem
Hi Fredrik,

* Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
>
>> Does nobody have an idea or is it to stupid?
>
> have you looked at:
>
> http://excess.org/urwid/

Thanks! I found this too and it seems to be helpful...


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: radio buttons in curses

2006-08-24 Thread Fabian Braennstroem
Hi Steve,

* Steve Holden <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
>> Sorry, me again...
>> Does nobody have an idea or is it to stupid?
>> 
>> * Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> 
>>>Hi,
>>>
>>>I want to add some radio and check buttons to my curses
>>>script. As I understand it, there are no buttons in the
>>>'basic' curses module. Now, I found the curses-extra module,
>>>but I not able to download and install it.
>>>
>>>Does anybody have an idea, where I can download the module
>>>or, even better, how I can create radio and check buttons
>>>with the 'ordinary' curses module? Would be nice...
>>>
>>>Greetings!
>>> Fabian
>>>
>>>-- 
>>>http://mail.python.org/mailman/listinfo/python-list
>>>
>> 
>> 
>> Greetings!
>>  Fabian
>> 
> Sounding a bit like a "no", looks like. Did you Google much?

Yes, it looks like this ... actually, I did google and found
out that it does not work, so that I am looking for
curses-extra. Maybe, somebody has a copy and could send me
one? Would be nice!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: radio buttons in curses

2006-08-22 Thread Fabian Braennstroem
Sorry, me again...
Does nobody have an idea or is it to stupid?

* Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to add some radio and check buttons to my curses
> script. As I understand it, there are no buttons in the
> 'basic' curses module. Now, I found the curses-extra module,
> but I not able to download and install it.
>
> Does anybody have an idea, where I can download the module
> or, even better, how I can create radio and check buttons
> with the 'ordinary' curses module? Would be nice...
>
> Greetings!
>  Fabian
>
> -- 
> http://mail.python.org/mailman/listinfo/python-list
>

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


radio buttons in curses

2006-08-20 Thread Fabian Braennstroem
Hi,

I want to add some radio and check buttons to my curses
script. As I understand it, there are no buttons in the
'basic' curses module. Now, I found the curses-extra module,
but I not able to download and install it.

Does anybody have an idea, where I can download the module
or, even better, how I can create radio and check buttons
with the 'ordinary' curses module? Would be nice...

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: access abook addressbook with curses

2006-08-13 Thread Fabian Braennstroem
Hi Ben,
* Ben C <[EMAIL PROTECTED]> wrote:
> On 2006-08-08, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi Ben,
>>
>> * Ben C <[EMAIL PROTECTED]> wrote:
>>> On 2006-08-06, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>>>> Hi Ben,
>>>>
>>>> * Ben C <[EMAIL PROTECTED]> wrote:
>>>>> On 2006-08-05, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I want to get access to my abook address file with python.
>>>>>> Does anyone have some python lines to achive this using
>>>>>> curses? If not, maybe anybody has small python program doing
>>>>>> it with a gui!?
>>>>>
>>>>> You can just parse the abook addressbook with the ConfigParser, try
>>>>> this:
>>>>>
>>>>> import os
>>>>> from ConfigParser import *
>>>>>
>>>>> abook = ConfigParser()
>>>>> abook.read(os.environ["HOME"] + "/.abook/addressbook")
>>>>>
>>>>> for s in abook.sections():
>>>>> print abook.items(s)
>>>>
>>>> Thanks! I found a different example too:
>>>>
>>>> import ConfigParser
>>>> import string
>>>>
>>>> config = ConfigParser.ConfigParser()
>>>>
>>>> config.read("/home/fab/.abook/addressbook")
>>>>
>>>> # print summary
>>>> print
>>>> for number in [2,200]:
>>>> print string.upper(config.get(str(number), "email"))
>>>> print string.upper(config.get(str(number), "name"))
>>>> print string.upper(config.get(str(number), "city"))
>>>> print string.upper(config.get(str(number), "address"))
>>>>
>>>> but the problem seems to be that abook does not write every
>>>> field, so I get an exception when there is a field missing:
>>>>
>>>> Traceback (most recent call last):
>>>>   File "configparser-example-1.py", line 13, in ?
>>>> print string.upper(config.get(str(number), "city"))
>>>>   File "/usr/lib/python2.4/ConfigParser.py", line 520, in get
>>>> raise NoOptionError(option, section)
>>>> ConfigParser.NoOptionError: No option 'city' in section: '2'
>>>>
>>>> Section 2 looks like:
>>>>
>>>> [2]
>>>> name=Andrs Gzi
>>>> [EMAIL PROTECTED]
>>>> nick=oz
>>>>
>>>> Is there a workaround?
>>>
>>> You can construct the parser with a dictionary of defaults:
>>>
>>> config = ConfigParser.ConfigParser({"city" : "unknown",
>>> "zip" : "unknown"})
>>>
>>> that kind of thing.
>>>
>>> Or catch the exceptions. Or use config.options("2") to see what options
>>> exist in section 2 before you try to read them.
>>
>> Thanks! I will try it out!
>
> Looking at the bigger picture here, though, I may be giving you the
> wrong advice. Mutt just invokes abook to get the addresses I think,
> that's why you put
>
> set query_command="abook --mutt-query '%s'"
>
> So you could do the same (if what you're trying to do is write a mutt
> clone in Python):
>
> import subprocess
>
> name = "Andrs"
> subprocess.Popen("abook --mutt-query " + name,
> stdout=subprocess.PIPE, shell=True).communicate()[0]
>
> The difference is that this "leverages" abook to do the search, not just
> to store the data, which is a logical approach.
>
> On the other hand, this way, you require that abook is installed on the
> machine, which is no good if the object of the exercise is a portable
> Python-only solution.

The biggest problem is a missing and not allowed
abook installation. But thanks for your tips!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: access abook addressbook with curses

2006-08-07 Thread Fabian Braennstroem
Hi Ben,

* Ben C <[EMAIL PROTECTED]> wrote:
> On 2006-08-06, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi Ben,
>>
>> * Ben C <[EMAIL PROTECTED]> wrote:
>>> On 2006-08-05, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>>>> Hi,
>>>>
>>>> I want to get access to my abook address file with python.
>>>> Does anyone have some python lines to achive this using
>>>> curses? If not, maybe anybody has small python program doing
>>>> it with a gui!?
>>>
>>> You can just parse the abook addressbook with the ConfigParser, try
>>> this:
>>>
>>> import os
>>> from ConfigParser import *
>>>
>>> abook = ConfigParser()
>>> abook.read(os.environ["HOME"] + "/.abook/addressbook")
>>>
>>> for s in abook.sections():
>>> print abook.items(s)
>>
>> Thanks! I found a different example too:
>>
>> import ConfigParser
>> import string
>>
>> config = ConfigParser.ConfigParser()
>>
>> config.read("/home/fab/.abook/addressbook")
>>
>> # print summary
>> print
>> for number in [2,200]:
>> print string.upper(config.get(str(number), "email"))
>> print string.upper(config.get(str(number), "name"))
>> print string.upper(config.get(str(number), "city"))
>> print string.upper(config.get(str(number), "address"))
>>
>> but the problem seems to be that abook does not write every
>> field, so I get an exception when there is a field missing:
>>
>> Traceback (most recent call last):
>>   File "configparser-example-1.py", line 13, in ?
>> print string.upper(config.get(str(number), "city"))
>>   File "/usr/lib/python2.4/ConfigParser.py", line 520, in get
>> raise NoOptionError(option, section)
>> ConfigParser.NoOptionError: No option 'city' in section: '2'
>>
>> Section 2 looks like:
>>
>> [2]
>> name=Andrs Gzi
>> [EMAIL PROTECTED]
>> nick=oz
>>
>> Is there a workaround?
>
> You can construct the parser with a dictionary of defaults:
>
> config = ConfigParser.ConfigParser({"city" : "unknown",
> "zip" : "unknown"})
>
> that kind of thing.
>
> Or catch the exceptions. Or use config.options("2") to see what options
> exist in section 2 before you try to read them.

Thanks! I will try it out!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: email client like mutt

2006-08-07 Thread Fabian Braennstroem
Hi to both,

* cga2000 <[EMAIL PROTECTED]> wrote:
> On Mon, Aug 07, 2006 at 08:34:16PM EDT, Aahz wrote:
>> In article <[EMAIL PROTECTED]>,
>> cga2000  <[EMAIL PROTECTED]> wrote:
>> >On Sun, Aug 06, 2006 at 04:15:08PM EDT, Aahz wrote:
>> >> In article <[EMAIL PROTECTED]>,
>> >> Fabian Braennstroem  <[EMAIL PROTECTED]> wrote:
>> >>>
>> >>>I am looking for a python email client for the terminal... something like
>> >>>mutt; maybe, so powerfull ;-)
>> >> 
>> >> What's wrong with mutt?
>> >
>> >Like he says it's not written in python.
>> 
>> Yes, I see that, but that doesn't answer my question.  Not every
>> application in the world needs to be written in Python.  (Note that I'm
>> a mutt user myself.)
>
> Well.. I'm also curious why he wants it to be written in python, so I
> thought we could join forces.
>
> Incidentally I've been looking for a general-purpose application written
> in python/ncurses for some time and haven't found anything.
>
> Looks like no new terminal application was written in the last ten years
> or so. I guess that would rule out python..?

I like mutt a lot, but at work I have to use lotus notes and
I thought that I could use an existing python mail client to
read and write mail 'around ' the lotus environment... that
probably does not work anyways!?
The second idea, which is more a working together with mutt,  was to send files 
from 'lfm' (last file
manager), which is completely written in python. I want to
open mutt from lfm and automatically attach the marked files
to the email... 

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: access abook addressbook with curses

2006-08-06 Thread Fabian Braennstroem
Hi Ben,

* Ben C <[EMAIL PROTECTED]> wrote:
> On 2006-08-05, Fabian Braennstroem <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I want to get access to my abook address file with python.
>> Does anyone have some python lines to achive this using
>> curses? If not, maybe anybody has small python program doing
>> it with a gui!?
>
> You can just parse the abook addressbook with the ConfigParser, try
> this:
>
> import os
> from ConfigParser import *
>
> abook = ConfigParser()
> abook.read(os.environ["HOME"] + "/.abook/addressbook")
>
> for s in abook.sections():
> print abook.items(s)

Thanks! I found a different example too:

import ConfigParser
import string

config = ConfigParser.ConfigParser()

config.read("/home/fab/.abook/addressbook")

# print summary
print
for number in [2,200]:
print string.upper(config.get(str(number), "email"))
print string.upper(config.get(str(number), "name"))
print string.upper(config.get(str(number), "city"))
print string.upper(config.get(str(number), "address"))

but the problem seems to be that abook does not write every
field, so I get an exception when there is a field missing:

Traceback (most recent call last):
  File "configparser-example-1.py", line 13, in ?
print string.upper(config.get(str(number), "city"))
  File "/usr/lib/python2.4/ConfigParser.py", line 520, in get
raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'city' in section: '2'

Section 2 looks like:

[2]
name=Andrs Gzi
[EMAIL PROTECTED]
nick=oz

Is there a workaround?


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


access abook addressbook with curses

2006-08-05 Thread Fabian Braennstroem
Hi,

I want to get access to my abook address file with python.
Does anyone have some python lines to achive this using
curses? If not, maybe anybody has small python program doing
it with a gui!?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


email client like mutt

2006-08-05 Thread Fabian Braennstroem
Hi,

I am looking for a python email client for the terminal... something like
mutt; maybe, so powerfull ;-)

Would be nice, if anybody has an idea!


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: install python on cdrom

2006-08-03 Thread Fabian Braennstroem
Hi Martin,

* Martin v. Löwis <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem schrieb:
>> I look for an easy way to use the newest scipy, pyvtk, matplotlib,
>> f2py, numpy, paraview/vtk,... on a entreprise redhat machine
>> without administration rights.
>> My first thought was to install the whole new python system
>> on a cdrom/dvd and mounting it, when I need it. Would that
>> be the easiest way? I would be glad to read some
>> hints about the way doing it... 
>
> If you have a home directory with sufficient disk space, the
> easiest way would be to install Python into your home directory,
> assuming administrative policy allows such usage of the
> home directory.

Thanks, but unfortunately the administrative policy does not
allow such installation, but could it work, when I do such a
installation in my home directory, copy everything to a
cdrom/dvd and mount it in proper place?


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


install python on cdrom

2006-07-29 Thread Fabian Braennstroem
Hi,

I look for an easy way to use the newest scipy, pyvtk, matplotlib,
f2py, numpy, paraview/vtk,... on a entreprise redhat machine
without administration rights.
My first thought was to install the whole new python system
on a cdrom/dvd and mounting it, when I need it. Would that
be the easiest way? I would be glad to read some
hints about the way doing it... 

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: problem with array and for loop

2006-05-10 Thread Fabian Braennstroem
Hi Robert,

* Robert Kern <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
>> Hi,
>> 
>> I have a 'simple' problem with a multidimension array in a
>> for loop. It looks like this:
>> 
>> wert= zeros([127,2])
>> wert1= zeros(127)
>> m=1
>> l=1
>> 
>> for pos in [pos1,pos2,pos3]: 
>> for i in range(1,125):
>> wert[l,m]= 
>> probe1.GetOutput().GetPointData().GetScalars().GetTuple1(i);
>> #wert1[i]= 
>> probe1.GetOutput().GetPointData().GetScalars().GetTuple1(i);
>> m=m+1;
>> l=l+1;
>> 
>> It works for the 1D 'wert1'. Does anyone have an idea? 
>
> Oy vey.
>
> So the first time through, you are setting the second column of wert. Then l
> (btw, never, ever use lower-case "l" as a single-letter variable name; it 
> looks
> like "1") gets incremented to 2, which would try to put data into the third
> column of wert. However, wert only has two columns.

Thanks! I misunderstood the declaration of a multid-dim
array; it works now.
>
> Are you aware that numpy array indices start with 0, not 1?
>
> You will probably want to ask numpy questions on the numpy-discussion mailing 
> list:
>
>   http://www.scipy.org/Mailing_Lists

I thought a simple for loop-array-declaration question would
fit in this group ... it actually help for this simple
problem. Thanks!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


problem with array and for loop

2006-05-10 Thread Fabian Braennstroem
Hi,

I have a 'simple' problem with a multidimension array in a
for loop. It looks like this:

wert= zeros([127,2])
wert1= zeros(127)
m=1
l=1

for pos in [pos1,pos2,pos3]: 
for i in range(1,125):
wert[l,m]= probe1.GetOutput().GetPointData().GetScalars().GetTuple1(i);
#wert1[i]= probe1.GetOutput().GetPointData().GetScalars().GetTuple1(i);
m=m+1;
l=l+1;

It works for the 1D 'wert1'. Does anyone have an idea? 


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: best way to install python modules on linux

2006-04-14 Thread Fabian Braennstroem
Hi Harry,

* Harry George <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem <[EMAIL PROTECTED]> writes:
>
>> Hi,
>> 
>> I am pretty new to python and will use it mainly in
>> combination with scientific packages. I am running ubuntu
>> breezy right now and see that some packages are out of date.
>> Do you have any suggestion, how I can get/keep the latest
>> python modules (e.g. scipy, numpy,...) on my ubuntu system?
>> I.e. does there exist any script/program, which downloads
>> and installs automatically the latest stable releases of selected
>> modules? It would be nice, if the program can remove the
>> installed modules, too!?
>> 
>> Or would it be easier to stick to apt/deb and create own
>> packages ...
>> 
>> 
>> Greetings!
>>  Fabian
>> 
>
> I find it helpful to leave the as-delivered Python (e.g.,
> /usr/bin/python) as-is.  It is being used to run your basic Linux
> system.  Screwing around with it can have nasty side effects.  Instead
> I build a new one at /usr/local, give it a unique name, and
> upgrade/hack that one to my heart's content.  E.g., if the base system
> is using Python 2.2, you can be running Python 2.4 as
> /usr/local/bin/py24, and add all the numerical packages you wish at
> use/local/lib/python2.4/site-packages.  Also, make sure root doesn't
> have /usr/local/bin on its PATH (which is a good rule anyway).

Maybe, I should consider this, too. Thanks!

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: best way to install python modules on linux

2006-04-10 Thread Fabian Braennstroem
Hi,

* Robert Kern <[EMAIL PROTECTED]> wrote:
> Fabian Braennstroem wrote:
>> Hi to all,
>> 
>> thanks for your ideas! I just figured out a different way
>> using archlinux 'pacman' (package management tool like apt).
>> As a former archlinux user I am more used to adjust those
>> PKDBUILDs (kind of ebuilds under archlinux) than adjusting
>> debian packages. The downside is that apt does not know
>> anything about those installed packages (just like with
>> easyinstall and checkinstall). I am not sure, if is the best
>> way, but the installation of numpy and scipy almost worked ;-)
>> 
>> Starting numpy gives me:
>>   import numpy
>>   import linalg -> failed: /usr/lib/3dnow/libf77blas.so.2: undefined symbol: 
>> e_wsfe
>> 
>> Which looks pretty odd for me!?
>
> It looks like you are missing linking to the g2c library. If you could post 
> your
> build log to [EMAIL PROTECTED], we'll be glad to help you out.

Thanks for the suggestion. I just tried the source package
from debian experimental, which seems to work.


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: best way to install python modules on linux

2006-04-08 Thread Fabian Braennstroem
Hi to all,

thanks for your ideas! I just figured out a different way
using archlinux 'pacman' (package management tool like apt).
As a former archlinux user I am more used to adjust those
PKDBUILDs (kind of ebuilds under archlinux) than adjusting
debian packages. The downside is that apt does not know
anything about those installed packages (just like with
easyinstall and checkinstall). I am not sure, if is the best
way, but the installation of numpy and scipy almost worked ;-)

Starting numpy gives me:
  import numpy
  import linalg -> failed: /usr/lib/3dnow/libf77blas.so.2: undefined symbol: 
e_wsfe

Which looks pretty odd for me!?

Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list


best way to install python modules on linux

2006-04-07 Thread Fabian Braennstroem
Hi,

I am pretty new to python and will use it mainly in
combination with scientific packages. I am running ubuntu
breezy right now and see that some packages are out of date.
Do you have any suggestion, how I can get/keep the latest
python modules (e.g. scipy, numpy,...) on my ubuntu system?
I.e. does there exist any script/program, which downloads
and installs automatically the latest stable releases of selected
modules? It would be nice, if the program can remove the
installed modules, too!?

Or would it be easier to stick to apt/deb and create own
packages ...


Greetings!
 Fabian

-- 
http://mail.python.org/mailman/listinfo/python-list