特殊字符解码和打印问题

时间:2018-11-28 12:35:17

标签: python-3.x unicode utf-8

我想解析文本文件。
文件中的行如下所示:

    import React from 'react';
    import $ from 'jquery';
    import { Button } from 'reactstrap';


    class Parallex extends React.Component {
        constructor() {
            super();
            this.para = this.para.bind(this);
            this.isInViewport = this.isInViewport(this);
        }
        componentDidMount() {
            this.para();
            this.isInViewport();
        }

        para() {
            $(document).ready(function(){

            var scrolled = $(window).scrollTop()
            $('.parallax').each(function(index) {
                var imageSrc = $(this).data('image-src')
                var imageHeight = $(this).data('height')
                $(this).css('background-image','url(' + imageSrc + ')')
                $(this).css('height', imageHeight)

                // Adjust the background position.
                var initY = $(this).offset().top
                var height = $(this).height()
                var diff = scrolled - initY
                var ratio = Math.round((diff / height) * 100)
                $(this).css('background-position','center ' + parseInt(-(ratio * 1.5)) + 'px')
            })

            // Attach scroll event to window. Calculate the scroll ratio of each element
            // and change the image position with that ratio.
            $(window).scroll(function() {
              var scrolled = $(window).scrollTop()
              $('.parallax').each(function(index, element) {
                var initY = $(this).offset().top
                var height = $(this).height()
               // var endY  = initY + $(this).height()

                // Check if the element is in the viewport.
                var visible = this.isInViewport(this)
                if(visible) {
                  var diff = scrolled - initY
                  var ratio = Math.round((diff / height) * 100)
                  $(this).css('background-position','center ' + parseInt(-(ratio * 1.5)) + 'px')
                }
              })
            })
          })
        }
          // Check if the element is in the viewport.
           isInViewport(node) {
            var rect = node.getBoundingClientRect();
            return (
              (rect.height > 0 || rect.width > 0) &&
              rect.bottom >= 0 &&
              rect.right >= 0 &&
              rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&
              rect.left <= (window.innerWidth || document.documentElement.clientWidth)
            )
          } 

        render() {
            return (
                <div class="parallax" id="parallax-2" data-image-src="https://source.unsplash.com/random/1920x1081" data-height="400px">
                    <div class="caption">
                        <span class="border">LESS HEIGHT</span>
                        <Button>Know more</Button>
                    </div>
                </div>
            )
        }
    }
export default Parallex;

之后:

#all.kdadmin.filter.showAllEntries;-alle anzeigen-;-show all-;-pokaż wszystko-;-mostrar todo-; –ყველას გამოჩენა–

我有错误:

step_0 = my_string.split(';')
print(step_0)

所有成立的答案都是旧的,我真的不明白。
有人可以给我写一些平静的代码,如何在控制台中使这行无效或写入其他文件?

0 个答案:

没有答案