CopyPastor

Detecting plagiarism made easy.

Score: 0.9945411647259644; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2023-10-17
by Alex

Original Post

Original - Posted on 2023-10-17
by Alex



            
Present in both answers; Present only in the new answer; Present only in the old answer;

I wanted to convert simply from '/' to '' in the python code. I have one shared folder 'test_folder' from windows PC (IP: 192.168.1.1). I had used os, pathlib and ntpath libraries. But, all gave result with double ''. I just wanted path to be converted to windows-like path with single ''. Below solution using re module solved the problem.
import re unix_path = '//192.168.1.1/test_folder/' win_path = re.sub(r'/', r'\\', unix_path) print(win_path)
This may not be the exact solution. But, it can solve the problem.


I wanted to convert simply from '/' to '' in the python code. I have one shared folder 'test_folder' from windows PC (IP: 192.168.1.1). I had used os, pathlib and ntpath libraries. But, all gave result with double ''. I just wanted path to be converted to windows-like path with single ''. Below solution using re module solved the problem.
import re unix_path = '//192.168.1.1/test_folder/' win_path = re.sub(r'/', r'\\', unix_path) print(win_path)


        
Present in both answers; Present only in the new answer; Present only in the old answer;