尝试在Jupyter Notebook中的本地驱动器上打开文件时出现权限错误

时间:2020-02-06 23:39:08

标签: python macos jupyter-notebook

我不是Jupyter Notebook的新手,我正在尝试打开一个文件,该文件是作为字符串存储的字典文件。我可以在Spyder中使用此命令,但在Jupyter上不起作用,并且出现此错误

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:src="@drawable/rsz_pprlogo" android:textSize="36sp" /> </LinearLayout> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center"> <ImageButton android:id="@+id/legislativa" android:onClick="OnButtonClick" android:src="@drawable/rsz_legislativa" android: android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:adjustViewBounds="true" android:background="@android:color/transparent" android:padding="0dp" android:scaleType="fitXY" android:text="Button 1" /> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center"/> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center"> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 3" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@android:color/transparent" android:padding="0dp" android:gravity="center"/> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 4" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center"/> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center"> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 5" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center"/> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 6" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center"/> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center"> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 7" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center"/> <ImageButton android:src="@mipmap/ic_launcher" android:text="Button 8" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center"/> </LinearLayout> </LinearLayout>

f = open('/Users/USR_NAME/Desktop/file.txt', 'r').read()

我如何在MacOS中通过权限才能在Jupyter中打开文件

0 个答案:

没有答案