Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:39:10+00:00 2026-06-16T18:39:10+00:00

I transport data from command line to python. And I want to convert from

  • 0

I transport data from command line to python. And I want to convert from string (command line) to tuple (python). But I have problem with \ charactor.

In command line, I using:

C:\>python music.py -a variable="?=="

In python:

#convert variable to array 
variable_array = variable.split("==")
#convert to tuple
variable_tuple = tuple(variable_array)

I get variable_tuple = (“?”,””)

The result what I need is variable_tuple = (“\?”,””)

When using

C:\>python music.py -a variable="\?=="

The result is variable_tuple = (“\\?”,””)

How can I transport data from command line to get tuple (“\?”,””) in python? I need backslash for “?”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:39:11+00:00Added an answer on June 16, 2026 at 6:39 pm

    '\\?' is a string with one backslash character and a question mark.
    Using list is a convenient trick for spliting a string into characters. For example:

    In [34]: list('\\?')
    Out[34]: ['\\', '?']
    

    shows '\\?' is composed of 2 characters, not 3. And if you print it:

    In [35]: print('\\')
    \
    

    you see it prints as just one backslash character. The double backslash, '\\', is an escape sequence.


    Note also that when you print a tuple, you get the repr of its contents:

    In [36]: print(tuple('\\?'))
    ('\\', '?')
    

    '\?' is the exact same string as '\\?' in Python. They are simply different ways of representing the same string:

    In [38]: list('\?')
    Out[38]: ['\\', '?']
    
    In [39]: list('\\?')
    Out[39]: ['\\', '?']    
    
    In [42]: '\?' is '\\?'
    Out[44]: True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to transmit data from a Queue using Twisted. I currently use a
Hi I tried to Read Any Data From A Web-Service Using Android But Every
Error: Unable to read data from the transport connection: A blocking operation was interrupted
I have data like: <td>USERID</td> <td>NAME</td> <td>RATING</td> I want to transform it into: <userid></userid>
I am using Web Service for retrieving values from the database.I have Written Fallowing
This is the code I am using to get the xml data from Apple's
I am using Named Pipes to transfer data from a client (C++) to a
I access cassandra from the ruby gem. I want to retrive data from cassandra
We have a WPF application which gets data from an Analysis Services Cube. The
I want to build a basic wpf/mvvm application which gets the data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.