dir = "192.168.10.245\cloud"
file = "b9/e1/eb/b9e1eb55-3524-4337-93c0-1b5c3c01c6f8.png"
怎么拼接成"\192.168.10.245\cloud\b9/e1/eb/b9e1eb55-3524-4337-93c0-1b5c3c01c6f8.png"
1
ech0x 2018-11-29 19:20:04 +08:00
c = "{}\{}".format(dir,file)
|
2
ech0x 2018-11-29 19:21:06 +08:00
漏看量一个反斜杠。
应该是 c = "\{}\{}".format(dir,file) |
3
jxie0755 2018-11-30 04:59:50 +08:00
直接用+号拼接不就行了吗........
|
4
speedbird 2018-12-01 21:11:13 +08:00
```python
dir = "192.168.10.245\cloud" file = "b9/e1/eb/b9e1eb55-3524-4337-93c0-1b5c3c01c6f8.png" string = f'\{dir}\{file}' ``` |