About 733,000 results
Open links in new tab
  1. What exactly does the .join () method do? - Stack Overflow

    2 There is a good explanation of why it is costly to use + for concatenating a large number of strings here Plus operator is perfectly fine solution to concatenate two Python strings. But if you keep adding …

  2. python - How to concatenate (join) items in a list to a single string ...

    Sep 17, 2012 · For handling a few strings in separate variables, see How do I append one string to another in Python?. For the opposite process - creating a list from a string - see How do I split a …

  3. python - What is the use of join () in threading? - Stack Overflow

    Jul 20, 2023 · In python 3.x join () is used to join a thread with the main thread i.e. when join () is used for a particular thread the main thread will stop executing until the execution of joined thread is …

  4. Python .join or string concatenation - Stack Overflow

    The reason for using str.join() is that adding strings together means creating a new string (and potentially destroying the old ones) for each addition. Python can sometimes optimize this away, but …

  5. Using .join() in Python - Stack Overflow

    Dec 7, 2012 · Here you are using two joins - the inner join joins every element up until the second to last element with a comma. That string is then joined to the last element (a[-1]) using the outer join, which …

  6. Python 3 string.join() equivalent? - Stack Overflow

    Dec 29, 2011 · In most cases you want to use your pythonic '.'.join() approach, but there are legitimate, pythonic uses for str.join() (formerly string.join()) too. For example, you sometimes want the joining …

  7. python - How can I use str.join () instead of "+=" to join a list of ...

    Feb 6, 2023 · How can I use str.join () instead of "+=" to join a list of strings with separator? Asked 10 years, 1 month ago Modified 2 years, 10 months ago Viewed 51k times

  8. python - How can I create a full path to a file from parts (e.g. path ...

    os.path.join(dir_name, base_filename + suffix) That approach also happens to be compatible with the suffix conventions in pathlib, which was introduced in python 3.4 a few years after this question was …

  9. python - Why use os.path.join over string concatenation ... - Stack ...

    Oct 26, 2017 · Consider os.path.join('a', '/b'), which actually returns /b. So if you're mixing these methods, or converting from string concatenation to os.path.join, make sure path components don't …

  10. python - How can I convert each item in the list to string, for the ...

    I need to join a list of items. Many of the items in the list are integer values returned from a function; i.e., myList.append(munfunc()) How should I convert the returned result to a string in