|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
adding "\n" to python list items
I know what I have to do, I want to split a results list from a database query into single lines for formatting reasons. I am however unsure of the syntax of how to do this, if anyone could help it would be very helpful
|
|
#2
|
|||
|
|||
|
I'm not sure what you want, but I guess you want to add a newline between every result. Then just use string.join like this:
Code:
joined_string = string.join(list, 'n')
__________________
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. - Jamie Zawinski, in comp.lang.emacs |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > adding "\n" to python list items |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|