Re: newb: Join two string variables

2006-12-06 Thread true911
johnny wrote: > How do I join two string variables? > I want to do: download_dir + filename. > download_dir=r'c:/download/' > filename =r'log.txt' > > I want to get something like this: > c:/download/log.txt pathfn = download_dir+filename -- http://mail.python.org/mailman/listinfo/python-list

Re: newb: Join two string variables

2006-12-05 Thread John Machin
johnny wrote: > In my code, I have the following: > > p = posixpath.basename(e).strip > filename = download_dir+p > > I am getting the following error: > > filename = download_dir+p > TypeError: cannot concatenate 'str' and 'builtin_function_or_method' > objects > > You need to *call* the strip

Re: newb: Join two string variables

2006-12-05 Thread Robert Bauck Hamar
johnny wrote: Please don't top post. Arrange your answer so that your comments follow what you comment. > In my code, I have the following: > > p = posixpath.basename(e).strip make this: p = posixpath.basename(e).strip() > filename = download_dir+p > > I am getting the following error: > >

Re: newb: Join two string variables

2006-12-05 Thread johnny
In my code, I have the following: p = posixpath.basename(e).strip filename = download_dir+p I am getting the following error: filename = download_dir+p TypeError: cannot concatenate 'str' and 'builtin_function_or_method' objects Cameron Walsh wrote: > johnny wrote: > > How do I join two strin

Re: newb: Join two string variables

2006-12-05 Thread Cameron Walsh
johnny wrote: > How do I join two string variables? > I want to do: download_dir + filename. > download_dir=r'c:/download/' > filename =r'log.txt' > > I want to get something like this: > c:/download/log.txt > Hi Johnny, This is actually two questions: 1.) How do I concatenate strings 2.)

Re: newb: Join two string variables

2006-12-05 Thread Fuzzyman
johnny wrote: > How do I join two string variables? > I want to do: download_dir + filename. That should do it. :-) You can concatenate strings using the plus operator. For large number of strings it is very inefficient. (Particularly in versions of Python pre 2.4 or in IronPython.) For these