Search code examples
pythonspecial-charactersargvdollar-sign

Python parse $ in sys.argv


how can use sys.argv to get a string with special characters $ (dollar). I just need the input as string.

Example:
    for arg in sys.argv:
      print arg 

if the input is like asd$1234 the result is asd


Solution

  • Nothing to do with Python

    Linux changes $1234 into environment variable, you should use asd\$1234 or 'asd$1234'