Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4825 Visualizzazioni
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

Avatar
Abbandona

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

Autore

thankns brother

Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
gen 23
25202
4
giu 21
38608
1
dic 20
2027
1
apr 18
7149
3
set 15
9042