回答編集履歴
1
コードが一部間違っていた
answer
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
teamikl様 のコメントから
|
1
|
+
teamikl様 のコメントから (7/20追加訂正)
|
2
2
|
|
3
3
|
```python
|
4
4
|
# https: // www.headboost.jp / python - check - the - length - of - strings /
|
@@ -23,7 +23,8 @@
|
|
23
23
|
print(ar_str)
|
24
24
|
print(ar_byt)
|
25
25
|
|
26
|
-
Nokori_byte = fullbyte - ar_byt.pop(0) - ar_byt.pop(-1) - 4 # (... + \ = 4)
|
26
|
+
~~Nokori_byte = fullbyte - ar_byt.pop(0) - ar_byt.pop(-1) - 4 # (... + \ = 4)~~
|
27
|
+
Nokori_byte = fullbyte - ar_byt.[0] - ar_byt.[-1] - 4 # (... + \ = 4)
|
27
28
|
print('Nokori=' + str(Nokori_byte))
|
28
29
|
|
29
30
|
i = 0
|
@@ -34,8 +35,8 @@
|
|
34
35
|
temp = temp + sep + ar_str[i+1]
|
35
36
|
i += 1
|
36
37
|
|
37
|
-
Compact_Path = ar_str.pop(0) + temp + '...' + sep + ar_str.pop(-1)
|
38
|
+
~~Compact_Path = ar_str.pop(0) + temp + '...' + sep + ar_str.pop(-1)~~
|
38
|
-
|
39
|
+
Compact_Path = ar_str[0] + temp + '...' + sep + ar_str[n-1] ~~# 上記に同じ~~
|
39
40
|
|
40
41
|
print(str(Compact_Path))
|
41
42
|
```
|