PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, July 24, 2022

[FIXED] How can add double quotes in string using python

 July 24, 2022     api, json, python     No comments   

Issue

The problem is displaying the "values" I get from the json in double quotes.

ex: "9000-123"

Would you help me with this topic?

empty = {'reservation-num': '9000-123', 'receipt-num': '001', 'bond-date': '12.12.2000', 'receipt-time': '20:20', 'numberof-items': '1,00', 'item-num': '10.234.09', 'item-designation': 'Hühnersuppe', 'vat-rate-in-percent': '16,00', 'gross-unit-price-of-the-item': '9,50', 'total-gross-amount-of-the-receipt': '9,50', 'currency-sembol': 'DEM', 'clerk-num': '12', 'clerk-name': 'Elif'}

for emp in h3cashin_data:
    var_reservation = emp["reservation-num"]
    csvwriter.writerow(emp.values())

Solution

This might help you,

for emp in h3cashin_data:
    var_reservation = emp["reservation-num"]
    csvwriter.writerow(['"'+value+'"' for value in emp.values()])


Answered By - Manish Shetty
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing