[Python] How do I correctly use !type in this case to view the file contents? [closed]

Discussão em 'Python' iniciado por Stack, Julho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm currently working through Wes McKinney's Python for Data Analysis book. I ran into a problem on one of his examples on chapter 6.

    His entry into Jupyter:

    !cat examples/cs1.csv
    a,b,c,d,message
    1,2,3,4,hello
    5,6,7,8,world
    9,10,11,12,foo


    There is a short box afterwards that says if you're using Windows, to use the type command in place of cat. I entered the following:

    !type examples/ex1.csv
    a,b,c,d,message
    1,2,3,4,hello
    5,6,7,8,world
    9,10,11,12,foo


    But got an error:

    NameError: name 'a' is not defined


    How do I use the type command in place of cat for this instance? Running Python 3.6.5 on Windows 10.

    Continue reading...

Compartilhe esta Página