You need to join your string like this:
markers = [(97,64),(45,84)] result = ''.join("&markers=%s" % ','.join(map(str, x)) for x in markers) return result
UPDATE
I didn’t initially have the ','.join(map(str, x))
section in there to turn each tuple into strings. This handles varying length tuples, but if you will always have exactly 2 numbers, you might see gatto’s comment below.
The explanation of what’s going on is that we make a list with one item for each tuple from markers, turning the tuples into comma separated strings which we format into the &markers=
string. This list of strings is then joined together separated by an empty string.
Related Posts:
- ImportError: ‘No module named plotly.plotly’ in LinuxMint17.3
- PyCharm shows “PEP8: expected 2 blank lines, found 1”
- “pip install json” fails on Ubuntu
- Microsoft Visual C++ 9.0 is required
- TypeError: zip argument #1 must support iteration
- ImportError: No module named google.cloud
- Jupyter | The kernel appears to have died. It will restart automatically |
- TypeError: ‘int’ object is not subscriptable
- What is the result of % in Python?
- Reading an Excel file in python using pandas
- Error: ‘int’ object is not subscriptable – Python
- How do I compare two strings in python?
- working of \n in python [duplicate]
- Pip freeze vs. pip list
- Cannot find module cv2 when using OpenCV
- Python ‘If not’ syntax [duplicate]
- RuntimeWarning: invalid value encountered in divide
- WinError 2 The system cannot find the file specified (Python)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- TypeError: cannot perform reduce with flexible type
- Could not find a version that satisfies the requirement tensorflow
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- Local variable referenced before assignment?
- ln (Natural Log) in Python
- ImportError: numpy.core.multiarray failed to import
- Python Traceback (most recent call last)
- python pip – install from local dir
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- How to pip or easy_install tkinter on Windows
- ImportError: numpy.core.multiarray failed to import
- How to remove \xa0 from string in Python?
- What is the meaning of [:] in python [duplicate]
- Why are Python’s ‘private’ methods not actually private?
- Remove list from list in Python
- Unzip all zipped files in a folder to that same folder using Python 2.7.5
- python socket.error: [Errno 98] Address already in use
- How to import files in python using sys.path.append?
- How do I install the yaml package for Python?
- Change figure size and figure format in matplotlib
- how does \r (carriage return) work in Python
- What is Python buffer type for?
- Add list to set?
- Python Error : File “
“ - Create 3D array using Python
- Python add item to the tuple
- Checking whether pip is installed?
- Converting binary to decimal integer output
- Decoding UTF-8 strings in Python
- How can I read pdf in python?
- No module named setuptools
- How to have an array of arrays in Python
- How to fix: “UnicodeDecodeError: ‘ascii’ codec can’t decode byte”
- Python – ‘ascii’ codec can’t decode byte
- Python Error – int object has no attribute
- Difference between scikit-learn and sklearn
- TypeError: softmax() got an unexpected keyword argument ‘axis’
- Loading a file with more than one line of JSON into Pandas
- How to detect key presses?
- What is the difference between json.load() and json.loads() functions
- How to XOR two strings in Python
- TypeError: ‘_io.TextIOWrapper’ object is not subscriptable
- Copy a list of list by value and not reference
- Why I get ‘list’ object has no attribute ‘items’?
- Why is parenthesis in print voluntary in Python 2.7?
- How to read the last line of a file in Python?
- matplotlib: RuntimeError: Python is not installed as a framework
- Python 101: Can’t open file: No such file or directory
- Split a python list into other “sublists” i.e smaller lists
- TypeError: argument of type ‘NoneType’ is not iterable
- scrapy run spider from script
- python error: TypeError: an integer is required
- If list index exists, do X
- IndexError: index 10 is out of bounds for axis 0 with size 10
- How to detect key presses?
- Installation of pygame with Anaconda
- Python can’t find module NLTK
- urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error
- ‘virtualenv’ is not recognized as an internal or external command, operable program or batch file
- ImportError: cannot import name NUMPY_MKL
- UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0x80 in position 3131: invalid start byte
- Python: Pandas pd.read_excel giving ImportError: Install xlrd >= 0.9.0 for Excel support
- How can I copy a Python string?
- Convert string to variable name in python
- What is the meaning of “int(a[::-1])” in Python?
- dump() missing 1 required positional argument: ‘fp’ in python json
- How to completely uninstall python 2.7.13 on Ubuntu 16.04
- Spell Checker for Python
- How to open html file?
- “Python version 2.7 required, which was not found in the registry” error when attempting to install netCDF4 on Windows 8
- Installing scipy for python 2.7
- Does python have header files like C/C++?
- How can I install a .egg Python package on Windows (attempt using easy_install not working)
- In python, how can I print lines that do NOT contain a certain string, rather than print lines which DO contain a certain string:
- input() error – NameError: name ‘…’ is not defined
- Python 2.7 mixing iteration and read methods would lose data
- Homebrew brew doctor warning about /Library/Frameworks/Python.framework, even with brew’s Python installed
- What does an ‘r’ represent before a string in python?
- Cannot remove entries from nonexistent file
- Python: OSError: [Errno 2] No such file or directory: ”