Lets say I get a results that yields
stats = ['1', '2', '3', '4', '5', '6', '7', '8']
is there a way I can i can get it to print out as:
stats = [ '1', '2', '3', '4'
'5', '6', '7', '8']
Thanks
pc
2 1058 bvdet 2,851
Expert Mod 2GB
Lets say I get a results that yields
stats = ['1', '2', '3', '4', '5', '6', '7', '8']
is there a way I can i can get it to print out as:
stats = [''1', '2', '3', '4'
'5', '6', '7', '8']
Thanks
pc
- print "stats = %s,\n%s%s" % (repr(stats[0:4]).rstrip(']'), ' '*9, repr(stats[4:8]).lstrip('['))
>>> stats = ['1', '2', '3', '4',
'5', '6', '7', '8']
>>>
There's probably an easier way.
Lets say I get a results that yields
stats = ['1', '2', '3', '4', '5', '6', '7', '8']
is there a way I can i can get it to print out as:
stats = [ '1', '2', '3', '4'
'5', '6', '7', '8']
Thanks
pc
-
>>> s = "stats = ['1', '2', '3', '4', '5', '6', '7', '8']"
-
>>> print s.replace("'4',", "'4',\n")
-
stats = ['1', '2', '3', '4',
-
'5', '6', '7', '8']
-
>>>
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: rodrigo guerra |
last post by:
where i can change the code formating that visual studio does in the
code.... like
if i type:
if ( ) { ....
}
visual studio changes to:
|
by: djc |
last post by:
Is there a property or method of the textbox web server control that I can
use to format the text in it a certian way. For example I am displaying a
date value from a database in a text box. It...
|
by: Tina |
last post by:
I have a datagrid where I specified {0:###,###,###} at design time. However
sometimes I am putting percentages in the grid instead of money and I want
to change the formating to {##%}. I've...
|
by: Smiley |
last post by:
Hi,
I know how to do confitional formating in Excel by clicking the wizard. Is
this possible in MS Access ? If so, please directly where to look. I found
example but nothing as to how to do it....
|
by: tolkienarda |
last post by:
hi all
I am working on a content management service and i need some help keeping formating.
what i am doing is recreating my site in an admin side and all of the articles on the site will...
|
by: Shawn Northrop |
last post by:
I just read an article on kirupa.com about incorporating mySQL and PHP with flash. I am dynamically loading conent into a flash movie and am not sure how to format. In my php code i have:
$y = "";...
|
by: Fonix |
last post by:
I'm trying to make table border with pyExcelerator.
As i can see there is only cell formating!? If i'm wrong pls tell me what is method to make more then one cell to have same format, other then...
|
by: sitko |
last post by:
Hi,
I'm in the process of converting a VB.net program into a C program so it can run on a unix like machine.
I've been moving along at a nice pace, but this conversion has stumped me.
I need...
|
by: nico |
last post by:
Hi,
I need to do a lot of string formating, and I have strings and/or
unicode strings and when I do the following:
"%s %s" % (u'Salut', 'H\xe4llo'), I get an exception :
UnicodeDecodeError:...
|
by: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= |
last post by:
Greetings,
I am writing an application that prepares a quotation for a customer. The
calculations are done in a SQL Server stored procedure. I use a datareader
to fetch the record, but cannot...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |