We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8cd9c0a commit fd5bda4Copy full SHA for fd5bda4
Coco/Trace.py
@@ -47,16 +47,8 @@ def formatString( s:str, w:int ):
47
the string is left-adjusted if w < 0 and right-adjusted otherwise'''
48
assert isinstance( s, str )
49
assert isinstance( w, int )
50
-
51
- size = len(s)
52
- b = ''
53
- if w >= 0:
54
- b += ' ' * (w - size)
55
- return b + s
56
- else:
57
- for i in range( w, -size ):
58
- b += ' '
59
- return s + b
+ b = ' ' * (abs(w) - len(s))
+ return b + s if w >= 0 else s + b
60
61
@staticmethod
62
def Write( s:str, w:int=None ):
0 commit comments