Skip to content
Snippets Groups Projects
  1. Jan 31, 2025
  2. Jan 24, 2025
  3. Jan 23, 2025
  4. Aug 11, 2024
    • jn's avatar
      Use raw strings to avoid invalid escape sequences · 5a956990
      jn authored
      Recent versions of Python (tested with 3.12) print the following syntax
      warnings. To avoid them, use the r'' raw string syntax in strings that (may)
      contain a backslash that is not supposed to be an escape sequence.
      
      $ ./busdisplay.py
      busdisplay.py:74: SyntaxWarning: invalid escape sequence '\-'
        sp+' _|--/~\------/~\-+  |__________________| |__________________| |__________________|'+sp,
      busdisplay.py:75: SyntaxWarning: invalid escape sequence '\_'
        sp+'//// \_/      \_/       (O)        (O)       (O)        (O)     (O)        (O)sp   '+sp
      busdisplay.py:87: SyntaxWarning: invalid escape sequence '\s'
        sp = re.split('\s+|(?=\()|(?<=\))', text)
      busdisplay.py:296: SyntaxWarning: invalid escape sequence '\_'
        self.block.set_rows([(None, 'K1', 'Zyge', '¯\_(ü)_/¯')])
      5a956990
  5. Jul 06, 2024
  6. May 31, 2024
  7. May 24, 2024
  8. Dec 20, 2023
  9. Dec 18, 2023
  10. Jul 02, 2023
  11. Mar 26, 2023
  12. Nov 26, 2022
  13. Nov 12, 2022
  14. Aug 27, 2022
Loading