I can't.
>>> import file.py
is all very well if the interpreter knows where file.py is.
I want to do this :
>>> import /directory1/directory2/file.py
Is this not possible ?
--
View this message in context:
http://www.nabble.com/Getting-started-with-Python-tp17273337p17273337.html
Sent
I can do this :
>>> sys.path.append ( 'C:\dump1' )
but not :
>>> x = 'C:\dir1'
>>> sys.path.append(x)
or :
but not :
>>> x = ['C:\dir1']
>>> sys.path.append(x)
Can I append variables to the path, rather than explicit strings ?
--
View this message in context:
http://www.nabble.com/sys.p
The following works :
file1 = open (file0, "r")
re.findall ( 'some_text', file1.readline() )
But this doesn't :
re.findall ( 'some_text', file1.readlines() )
How do I use grep for a whole text file, not just a single string ?
--
View this message in context:
http://www.nabble.com/Equival
rc.count('\n', 0, start) + 1
offset = start - src.rfind('\n', 0, start)
word = m.group(1)
print "2.htm(%s,%s): %s" % (lineno, offset, word)
Is there not a simpler way than this ?
ppaarrkk wrote:
>
> The following works :
>
&g