[Python-de] Frage wegen Stringübergabe
Fritz Cizmarov
fritz at sol.at
Don Jan 20 19:31:00 CET 2005
Hallo Andreas,
ganz einfach dein array enthält keine Strings. Versuchs mal so:
array = ["1234", "4567"]
Gruß
Fritz
On Thu, 20 Jan 2005 17:35:03 +0100
Andreas Protze <Andreas.Protze at Wolfsburg.de> wrote:
> Hallo,
>
> habe folgende Frage. Kann ich "re.search" nicht ein Stringarray
> übergeben? Führt immer zum Fehler!!
> Ich möchte einfach nur aus eine Textdatei nach einem Textmuster
> suchen..... (Zeilenweise)
>
> Warum kann dies nicht ausgeführt werden? Ist nicht das komplette
Proggi.
>
> Vielen Dank für Eure Hilfe
>
> Andreas
>
> import sys
> import re
> import string
>
> array = [1234, 4567]
>
> src=open("xxx.txt", "r")
> srclines= src.readlines()
> src.close()
>
> for line in srclines:
> if re.search(arry[i], line):
> ^^^^
> stößt auf Probleme
>
> _______________________________________________
> python-de maillist - python-de at python.net
> http://python.net/mailman/listinfo/python-de