Python Forum
IPython console vs Spyder script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IPython console vs Spyder script
#1
Hello, I wrote a code to control a device (I have created a device class and defined attributes to execute different operation with the device). At some point (for unknown reason) I got an error, and I can not handle it via my Spyder script. I have added a try, exception block to reset the device in case of error, but I always receive an error saying that the device does not have those attributes. For example, let's say I declare the instance MyDevice of the device class, by writing MyDevice = device(). Among different commands, I have defined a reset command. In my exception block I write MyDevice.reset(), but this give me the error: "MyDevice does not have the attribute reset. When I then run the same command (MyDevide.reset()) on the IPython console, this is executed correctly. Any idea about what could be the difference between running those command in the script or via console? I am interested even in a general sense, as maybe this could help me to find out what is the cause of the error. Thanks a lot for your help!
Reply


Messages In This Thread
IPython console vs Spyder script - by losc - Apr-30-2020, 02:20 AM
RE: IPython console vs Spyder script - by losc - Apr-30-2020, 03:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Combine console script + GUI (tkinter) dejot 2 545 Feb-27-2024, 04:38 PM
Last Post: deanhystad
  Spyder console zoom in not working? Dionysis 2 556 Feb-06-2024, 03:31 PM
Last Post: paul18fr
  IPython errors for numpy array min/max methods muelaner 1 669 Nov-04-2023, 09:22 PM
Last Post: snippsat
  Can a program execute code in iPython shell and get result? deanhystad 3 1,837 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  Make console show after script was built with Pyinstaller --NOCONSOLE? H84Gabor 0 1,269 May-05-2022, 12:32 PM
Last Post: H84Gabor
  Encountering `importlib_metadata.PackageNotFoundError` trying to run console script gretchenfrage 0 5,727 Jul-08-2021, 09:26 PM
Last Post: gretchenfrage
  Spyder Quirk? global variable does not increment when function called in console rrace001 1 2,303 Sep-18-2020, 02:50 PM
Last Post: deanhystad
  Problem running script within console koepjo 3 10,009 Mar-26-2020, 07:11 AM
Last Post: koepjo
  How can I create a multiline input in ipython? DataMower 3 4,476 Oct-28-2019, 08:50 PM
Last Post: DataMower
  ipython autocomplete broke indentation! Exsul 6 4,731 Aug-20-2019, 01:29 AM
Last Post: Exsul

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020