It took me a minute to locate the "Configuration per file..." [under "Run"] to change the set-up of my core file (from where I call a series of subroutines in other files - I use this format to make sure similar functions are grouped together in tabs on the Editor. I prefer this approach vs using cells). Now my core file (and the universal preferences [under "Tools/Preferences/Run"] are set to "Run in console's namespace instead of an empty one". Now variables brought back with a return() function are "defined" for all files. Thanks for the help.
On Thursday, November 7, 2019 at 6:08:07 PM UTC-5, bcolsen wrote: > > By default in Spyder4 Scripts run scripts in a new empty namespace and > append the results to the console namespace. This was done to prevent > difficult to detect bugs among new Spyder users. There is an option on the > run configuration per file dialog to run a file in the current namespace. > This option can also be set universally in the general preferences. > > I think that using code cells is a great way to use this type of work flow > where you want to run a longer subroutine and run code against it later. > This plays nicely with the code error checking as well. > > https://docs.spyder-ide.org/editor.html#defining-code-cells > > On Thursday, November 7, 2019 at 3:28:46 PM UTC-7, Rational-IM wrote: >> >> >> This is a fantastic upgrade - the new dark format is a great addition. I >> love the plots windows too. >> >> Is this a proper place to provide some initial feedback? If not, please >> let me know where should I post my questions/observations. >> >> I will post later some observations regarding Window layouts (I work with >> multiple 4K monitors and I believe the location of undocked windows is not >> holding, forcing me to rearrange a series of windows after each reboot - >> but I will work with it for a few days and report back). >> >> One issue I encountered, however, is regarding the treatment of variables >> that were defined when running a subroutine and brought back with a >> return() function. For instance, look at the error I just got when running >> my code (that didn't show this behavior with version 3): >> >> Traceback (most recent call last): >> >> File "C:\WORK FILES\Portfolio Analysis\Odysseus_Python\ >> Odysseus_control_v1.1.py", line 73, in <module> >> long_cm_0 = np.ones((days, securities)) # must set variables with >> ones at this >> >> NameError: name 'days' is not defined >> >> However, observe from the variables explorer that the variable "days" is >> defined: >> >> [image: Annotation 2019-11-07 111034.jpg] >> >> I will check the new available settings to make sure I'm not missing >> something obvious. However, I would appreciate any help on this topic as it >> will force me to re-run subroutines if the variables brought back are not >> recognized when calling other subroutines. >> >> Congratulations on the new release. >> >> On Sunday, November 3, 2019 at 12:53:57 AM UTC-4, Carlos Córdoba wrote: >>> >>> Hi all, >>> >>> On the behalf of the Spyder Project Contributors >>> <https://github.com/spyder-ide/spyder/graphs/contributors>, I’m pleased >>> to announce the first release candidate of our next major version: Spyder >>> *4.0*. >>> >>> We’ve been working on this version for more than three years now and as >>> far as we know it’s working very well. There are still several bugs to >>> squash but we encourage all people who like the bleeding edge to give it a >>> try. This beta version is released two weeks and a half after Spyder 4.0 >>> beta7 and it includes almost 230 commits. >>> >>> Spyder 4.0 comes with several interesting and exciting new features. The >>> most important ones are: >>> >>> - >>> >>> Main Window >>> - Dark theme for the entire application. >>> - A new Plots pane to browse all inline figures generated by the >>> IPython console. >>> - Rename the following panes: >>> - Static code analysis to Code Analysis >>> - File explorer to Files >>> - Find in files to Find >>> - History log to History >>> - Project explorer to Project >>> - Create a separate window when undocking all panes. >>> - Show current conda environment (if any) in the status bar. >>> - >>> >>> Editor >>> - Code folding. >>> - Indentation guides. >>> - A class/method/function lookup panel. This can be shown in the >>> menu Source > Show selector for classes and functions. >>> - Autosave functionality to recover unsaved files after a crash. >>> - Optional integration with the Kite <https://kite.com/> >>> completion engine. >>> - Code completion and linting are provided by the Python Language >>> Server. >>> - >>> >>> IPython Console >>> - Run files in an empty namespace. >>> - Open dedicated consoles for Pylab, Sympy and Cython. >>> - Run cells through a new function called runcell. >>> - Run cells by name. >>> - >>> >>> Debugger >>> - Code completion. >>> - Execute multi-line statements. >>> - Syntax highlighting. >>> - Permanent history. >>> - runfile and runcell can be called when the debugger is active. >>> - Debug cells with Alt+Shift+Return. >>> - >>> >>> Variable Explorer >>> - New viewer to inspect any Python object in a tree-like >>> representation. >>> - Filter variables by name or type. >>> - MultiIndex support in the Dataframe viewer. >>> - Support for all Pandas indexes. >>> - Support for sets. >>> - Support for Numpy object arrays. >>> - >>> >>> Files >>> - Associate external applications to open specific file extensions. >>> - Context menu action to open files externally. >>> - Multi-select functionality with Ctrl/Shift + mouse click. >>> - Copy/paste files and their absolute or relative paths. >>> - Use special icons for different file types. >>> - >>> >>> Outline >>> - Show cells grouped in sections. >>> - Add default name to all cells. >>> >>> For a more complete list of changes, please see our changelog >>> <https://github.com/spyder-ide/spyder/wiki/Beta-version-changelog> >>> >>> You can easily install this beta if you use Anaconda by running: >>> >>> conda update qt pyqt >>> conda install -c spyder-ide spyder=4.0.0rc1 >>> >>> Or you can use pip with this command: >>> >>> pip install --pre -U spyder >>> >>> Enjoy! >>> Carlos >>> >>> >> -- You received this message because you are subscribed to the Google Groups "spyder" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/8e232a76-a4a0-4f4f-a710-f622a4643868%40googlegroups.com.
