Sep-19-2018, 05:12 AM
(This post was last modified: Sep-19-2018, 05:12 AM by anubhav2020.)
(Sep-17-2018, 03:19 PM)volcano63 Wrote:(Sep-17-2018, 01:28 PM)anubhav2020 Wrote: I tried the 'r' for raw string and did not make any difference. So I changed my code as follows.
[/python]
Looks like handling of backslash in strings has changed lately - I was not aware of that. It only breaks when backslash with the following character creates a defined escape sequence, e.g.(for extended list - see table in Wiki)
\n
- line feed
\t
- tabulation
\a
- beep
\b
- backspace
Nevertheless, while that was not your problem, backslashes in string may cause an unintended behaviour, so - be careful with those. Pay attention howr
prefix or double backslash change the string behaviour
Output:In [111]: print('C:\location\noutput.dat', 'C:\location\\noutput.dat') C:\location output.dat C:\location\noutput.dat In [112]: print('C:\location\toutput.dat', 'C:\location\\toutput.dat') C:\location output.dat C:\location\toutput.dat In [113]: print('C:\location\aoutput.dat', r'C:\location\aoutput.dat') C:\locationoutput.dat C:\location\aoutput.dat In [114]: print('C:\location\boutput.dat', r'C:\location\boutput.dat') C:\locatiooutput.dat C:\location\boutput.dat In [115]: print('C:\location\x25output.dat', r'C:\location\x25output.dat') C:\location%output.dat C:\location\x25output.dat
After multiple attempts, it finally worked.
But the issue with large files running out of memory still persists. Any suggestions as to what cn be changed in the code!!