Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
4956 มุมมอง
how to add character  ' to   shippers company so the result is shipper's company 

header += 'Pickup Time,Shippers Company,Shippers Name,Shippers Phone No.,Shippers Address 1,Shippers Address 2,Shippers Postal Code,Consignees Company,Consignees Name,Consignees Phone No.,Consignees Address 1,Consignees Address 2,Consignees Postal Code,Comments\n'


hope you understand what i mean.

thanks in advance

อวตาร
ละทิ้ง

Try to this way header = "Shipper's Company".

ผู้เขียน

thankns brother

คำตอบที่ดีที่สุด

To handle this situation, you could opt for 4 options:

1. use single quotation inside a double quotation string (as Farid suggested)
e.g.  "Shipper's Company".
2. use multi line string 
e.g. """ Pickup Time,Shippers Company,Shippers Name,Shippers Phone No.,Shippers Address 1,Shippers Address 2,Shippers Postal Code,Consignees Company,Consignees Name,Consignees Phone No.,Consignees Address 1,Consignees Address 2,Consignees Postal Code,Comments\n"""
3. use escape character
e.g. 'Shipper\'s Company'
4. use of raw string 
e.g. r"Shipper's company"    # mostly used in matching expression of regular expression at python

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Syntax of domains - operators แก้ไขแล้ว
2
ม.ค. 23
25486
4
มิ.ย. 21
38829
1
ธ.ค. 20
2236
1
เม.ย. 18
7328
Why Odoo is so successful แก้ไขแล้ว
3
ก.ย. 15
9219