Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

deleted 152 characters in body
Source Link
jedwards
  • 30.4k
  • 3
  • 69
  • 94

From our conversation in comments

# -*- coding: utf-8 -*-
ExampleText = '"MINIMUM TRACK FASTENING SHALL BE 0.145" DIAMETER POWDER ACTUATED FASTENERS (P.A.F.S) SPACED ON 8" CENTERS FOR BEARING WALLS, AND AT 12" O.C. FOR NON-LOAD BEARING WALLS (U.N.O.), WITH 1 1/2" MINIMUM PENETRATION INTO CONCRETE. AT X-BRACED SHEAR WALLS, TRACK SHALL BE ATTACHED PER DETAILS. At Infinity Shear Panels (ISP�SISP’S) attach to slab w/ 0.145" x 1 1/2�2" powder actuated fasteners spaced on 4�4" centers (HILTI DS 37 P10 or equal) -OR- (6) 3/8" DIA. 2205 expansion anchors w/ 2 1/2" min. embedment - OR-Simpson "Titen" screws @ 6" o.c."'
print(ExampleText)

The coding header line is required since you have non-ascii characters in there. Note that I'm not sure utf-8 is the correct choice, the characters aren't rendering correctly but that looks like a side effect of copy/pasting from SO.

You could also wrap the literal with ''' or """:

x = '''some string'''
x = """some string"""

Note that a better solution might be to get the string directly from the data instead of copying/pasting into yoruyour code using a package like csv.

From our conversation in comments

# -*- coding: utf-8 -*-
ExampleText = '"MINIMUM TRACK FASTENING SHALL BE 0.145" DIAMETER POWDER ACTUATED FASTENERS (P.A.F.S) SPACED ON 8" CENTERS FOR BEARING WALLS, AND AT 12" O.C. FOR NON-LOAD BEARING WALLS (U.N.O.), WITH 1 1/2" MINIMUM PENETRATION INTO CONCRETE. AT X-BRACED SHEAR WALLS, TRACK SHALL BE ATTACHED PER DETAILS. At Infinity Shear Panels (ISP�S) attach to slab w/ 0.145" x 1 1/2� powder actuated fasteners spaced on 4� centers (HILTI DS 37 P10 or equal) -OR- (6) 3/8" DIA. 2205 expansion anchors w/ 2 1/2" min. embedment - OR-Simpson "Titen" screws @ 6" o.c."'
print(ExampleText)

The coding header line is required since you have non-ascii characters in there. Note that I'm not sure utf-8 is the correct choice, the characters aren't rendering correctly but that looks like a side effect of copy/pasting from SO.

You could also wrap the literal with ''' or """:

x = '''some string'''
x = """some string"""

Note that a better solution might be to get the string directly from the data instead of copying/pasting into yoru code using a package like csv.

From our conversation in comments

# -*- coding: utf-8 -*-
ExampleText = '"MINIMUM TRACK FASTENING SHALL BE 0.145" DIAMETER POWDER ACTUATED FASTENERS (P.A.F.S) SPACED ON 8" CENTERS FOR BEARING WALLS, AND AT 12" O.C. FOR NON-LOAD BEARING WALLS (U.N.O.), WITH 1 1/2" MINIMUM PENETRATION INTO CONCRETE. AT X-BRACED SHEAR WALLS, TRACK SHALL BE ATTACHED PER DETAILS. At Infinity Shear Panels (ISP’S) attach to slab w/ 0.145" x 1 1/2" powder actuated fasteners spaced on 4" centers (HILTI DS 37 P10 or equal) -OR- (6) 3/8" DIA. 2205 expansion anchors w/ 2 1/2" min. embedment - OR-Simpson "Titen" screws @ 6" o.c."'
print(ExampleText)

The coding header line is required since you have non-ascii characters in there.

You could also wrap the literal with ''' or """:

x = '''some string'''
x = """some string"""

Note that a better solution might be to get the string directly from the data instead of copying/pasting into your code using a package like csv.

Source Link
jedwards
  • 30.4k
  • 3
  • 69
  • 94

From our conversation in comments

# -*- coding: utf-8 -*-
ExampleText = '"MINIMUM TRACK FASTENING SHALL BE 0.145" DIAMETER POWDER ACTUATED FASTENERS (P.A.F.S) SPACED ON 8" CENTERS FOR BEARING WALLS, AND AT 12" O.C. FOR NON-LOAD BEARING WALLS (U.N.O.), WITH 1 1/2" MINIMUM PENETRATION INTO CONCRETE. AT X-BRACED SHEAR WALLS, TRACK SHALL BE ATTACHED PER DETAILS. At Infinity Shear Panels (ISP�S) attach to slab w/ 0.145" x 1 1/2� powder actuated fasteners spaced on 4� centers (HILTI DS 37 P10 or equal) -OR- (6) 3/8" DIA. 2205 expansion anchors w/ 2 1/2" min. embedment - OR-Simpson "Titen" screws @ 6" o.c."'
print(ExampleText)

The coding header line is required since you have non-ascii characters in there. Note that I'm not sure utf-8 is the correct choice, the characters aren't rendering correctly but that looks like a side effect of copy/pasting from SO.

You could also wrap the literal with ''' or """:

x = '''some string'''
x = """some string"""

Note that a better solution might be to get the string directly from the data instead of copying/pasting into yoru code using a package like csv.

lang-py

AltStyle によって変換されたページ (->オリジナル) /