Copying excel data into a python list in IPython using clipboard?

前端 未结 3 2128
广开言路
广开言路 2021-02-14 04:06

Is there a way to perform the following workflow:

  1. Select cells in an Excel spreadsheet
  2. Copy them using Ctrl+C
  3. Get the content the selected cells
3条回答
  •  無奈伤痛
    2021-02-14 04:38

    If you are on Windows, you can use PyReadline, which has a smart paste feature:

    • Copy and paste using the clipboard
    • Smart paste for convenient use with ipython. Converting tab separated data to python list or numpy array.

    See also the documentation for clipboard functions:

    ipython_paste

    Paste windows clipboard. If enable_ipython_paste_list_of_lists is True then try to convert tabseparated data to repr of list of lists or repr of array. If enable_ipython_paste_for_paths==True then change \\ to / and spaces to \space.

提交回复
热议问题