spyder

spyder didnt run update file

人盡茶涼 提交于 2019-12-24 06:30:04
问题 I am correctly working with python 2.7 and spyder. I run my code multiple times to check and debug, but every change I do, I have to run spyder 3 times until I can see that change in the outcome. For example: Short code: print "hi" And then run it, python will print "hi". Then I change it to print "hello" and I run it, python still prints "hi" for around the next 2-3 times until it finally prints "hello". Of course this problem happens with longer and much complex code, and it has become a

Package load error in anaconda and Spyder

依然范特西╮ 提交于 2019-12-24 01:54:54
问题 I have three python 2.7 files edit in Spyder 3.1.4 in Anaconda 4.3.1 (1). TestClass.py :Just define a class import numpy as np class TestClass: def getArray(self): return np.zeros((3,4)); (2). a1.py from TestClass import *; tt=TestClass(); (3). a2.py #just a empty python file When I "runfile" "a1.py" in Spyder, a TestClass instance tt was created, and I run following code in Spyder's IPython console: tt.getArray() Out[9]: array([[ 0., 0., 0., 0.], [ 0., 0., 0., 0.], [ 0., 0., 0., 0.]]) It

kq_init warning when starting Spyder through the terminal on macOS

让人想犯罪 __ 提交于 2019-12-23 22:56:46
问题 I'm running Spyder on my Mac with High Sierra. I have 2 virtual environments defined using Anaconda. The virtual environments are py27 for python 2.7.13 and py36 for python 3.65. When I go to py36 and run Spyder, everything seems to work fine. When I go to py27, immediately after I start spyder from the command line I get 9 warnings written to the terminal. The warning is: [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0 After these messages, Spyder opens using the

ipython startup config for spyder IDE

牧云@^-^@ 提交于 2019-12-23 16:27:40
问题 Trying to add a few imports to my IPython profile so that when I open a kernel in the Spyder IDE they're always loaded. Spyder has a Qt interface (I think??), so I (a) checked to make sure I was in the right directory for the profile using the ipython locate command in the terminal (OSX), and (b) placing the following code in my ipython_qtconsole_config.py file: c.IPythonQtConsoleApp.exec_lines = ["import pandas as pd", "pd.set_option('io.hdf.default_format', 'table')", "pd.set_option('mode

python script works in spyder console but not in spyder ipython or cmd in windows

假装没事ソ 提交于 2019-12-23 16:16:17
问题 I am trying to run this python script from How to connect to TT X_TRADER API in order to create an automated trading system using python? import pythoncom from time import sleep from win32com.client import Dispatch, DispatchWithEvents, getevents from win32com.client.gencache import EnsureDispatch, EnsureModule GATE = None NOTIFY = None class InstrNotify(getevents('XTAPI.TTInstrNotify')): def __init__(self): pass def Subscribe(self, pInstr): self.AttachInstrument(pInstr) pInstr.Open(0) def

Python 2.7.9 Mac OS 10.10.3 Message “setCanCycle: is deprecated. Please use setCollectionBehavior instead”

会有一股神秘感。 提交于 2019-12-23 12:03:28
问题 This is my first message and i hope can you help me to solve my problem. When I launch a python script I have this message : 2015-06-10 23:15:44.146 python[1044:19431] setCanCycle: is deprecated.Please use setCollectionBehavior instead 2015-06-10 23:15:44.155 python[1044:19431] setCanCycle: is deprecated.Please use setCollectionBehavior instead Below my script : from Tkinter import * root = Tk() root.geometry("450x600+10+10") root.title("Booleanv1.0") Cadre_1 = Frame(root, width=400, height

if __name__ == '__main__' not working ipython

江枫思渺然 提交于 2019-12-23 09:27:32
问题 I'm having trouble getting the if __name == '__main__' trick to work in an IPython, Spyder environment. I've tried every approach given in this thread: if __name__ == '__main__' in IPython Here are my super simplified modules Module1.py Class UnitTest(): print 'Mod1 UnitTest!' if __name__ == '__main__': UnitTest() Module2.py import Module1 Class UnitTest(): print 'Mod2 UnitTest!' if __name__ == '__main__': UnitTest() So I run Module2.py and I always am seeing both Mod2 UnitTest and Mod1

Cannot render_to_file in pygal more than once in Spyder

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 03:42:17
问题 Short version When in Spyder, if I run a script more than once that saves a map with pygal's render_to_file , I get a TypeError . It works fine the first time. Detailed version I'm trying to save a map using pygal (2.4.0) in Python 3.6 as follows: from pygal.maps.world import World worldmap = World() worldmap.add('Random Places', ['mx', 'bz', 'ru', 'th', 'et']) worldmap.render_to_file('random_places.svg') It works fine when I run from the terminal as many times as I want (I'm on Ubuntu). It

spyder unicode decode error in startup

不羁的心 提交于 2019-12-23 03:29:20
问题 I was using spyder-ide while parsing a tumblr page with the permission of the author, and at some point everything just crashed. Even my linux system had freezed. Well, to cut to the chase now I can not start spyder, it gives me the following error after I had written spyder to my terminal: Traceback (most recent call last): File "/home/dk/anaconda3/bin/spyder", line 2, in <module> from spyderlib import start_app File "/home/dk/anaconda3/lib/python3.5/site-packages/spyderlib/start_app.py",

opening Python scripts with spyder

帅比萌擦擦* 提交于 2019-12-22 22:55:47
问题 I am using anaconda and spyder as well as MacOS X Yosemite. How can I make spyder the default program to open python scripts? When I just click on a script it is opened with TextEdit. When I click on open with I cannot choose spyder. It is bothering to open spyder and then browse to the correct script. 回答1: Right click on your script -> Get Info -> then 'open with' in the combobox choose 'other' then locate the binary you want. Once you have chosen your binary click on 'change all' 来源: https: