# Ipython interaction

**URL:** <https://forum.cursor.com/t/ipython-interaction/19070>\
**Category:** Bug Reports\
**Created:** [September 26, 2024, 4:00pm UTC](https://forum.cursor.com/t/ipython-interaction/19070 "2024-09-26T16:00:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zslastman](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/zslastman/32/6430_2.png) [@zslastman](https://forum.cursor.com/u/zslastman)\
**Post date:** [September 26, 2024, 4:00pm UTC](https://forum.cursor.com/t/ipython-interaction/19070/1 "2024-09-26T16:00:13Z")

</div>

I want to be able to shit+enter and sent python code to IPython rather than just python. However, cursor doesn’t paste code into ipython correct. For instance this code:

```auto
with zipfile.ZipFile(zip_path, 'r') as zip_file:
    # Read train.csv directly from the zip file
    with zip_file.open('train.csv') as train_csv:
        train_df = pd.read_csv(train_csv)
    print("Train data loaded into DataFrame")

```

Works just fine with the default python-repl, however if I close that, and then open ipython in the embedded terminal, when I try shift+enter it to ipython, ipython gets that last print statement indented further and throws an error:

````auto
In [7]: with zipfile.ZipFile(zip_path, 'r') as zip_file:
   ...: # Read train.csv directly from the zip fil
   ...: e
   ...: with zip_file.open('train.csv') as tra
   ...: in_csv:
   ...: train_df = pd.read_csv(tra
   ...: in_csv)
   ...: print("Train data load
   ...: ed into DataFrame")
  Cell In[7], line 5
    print("Train data loaded into DataFrame")
    ^
IndentationError: unexpected indent```
````

---

<div class="post-metadata">

**Author:** ![duodenum96](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/duodenum96/32/57881_2.png) [@duodenum96](https://forum.cursor.com/u/duodenum96)\
**Post date:** [May 24, 2025, 7:52am UTC](https://forum.cursor.com/t/ipython-interaction/19070/2 "2025-05-24T07:52:43Z")

</div>

Having the same problem
