草庐IT

input_text

全部标签

python - 运行 Sublime Text 3 插件时保存编辑

为了理解我想要实现的目标:在另一个View中打印延迟文本...我正在尝试使这个sublimetext3插件正常运行我想使用在我的run方法的参数中传递的编辑来调用我的类的多个方法:#samplecode,nothingrealclassMyCommandClass(sublime_plugin.TextCommand):myEdit=Nonedefrun(self,edit):self.myEdit=edit#stuffself.myMethod()defmyMethod(self):#useself.myEdit...稍后我尝试在另一种方法上使用它,但是当我执行插件时出现此错误:Va

python Selenium : Finds h1 element but returns empty text string

我正在尝试获取此page标题中的文本:iSharesFTSEMIBUCITSETFEUR(Dist)标签看起来像这样:iSharesFTSEMIBUCITSETFEUR(Dist)我正在使用这个xPath:xp_name=".//*[@class[contains(normalize-space(.),'product-title')]]"在SeleniumWebDriverforPython中通过.text检索:new_name=driver.find_element_by_xpath(xp_name).text驱动程序找到了xpath,但是当我打印new_name时,macOS终端

python - 更改 matplotlib.pyplot text() 对象属性

我有一个matplotlib.pyplot图表,它循环更新以创建动画,使用我从anotheranswer获得的这种代码:importmatplotlib.pyplotaspltfig,ax=plt.subplots()x=[1,2,3,4]#x-coordinatesy=[5,6,7,8]#y-coordinatesfortinrange(10):ift==0:points,=ax.plot(x,y,marker='o',linestyle='None')else:new_x=...#xupdatednew_y=...#yupdatedpoints.set_data(new_x,new

python - 语法错误 "no viable alternative at input ' self '”

我有一个包含以下代码的gui.py文件:fromjavax.swingimportJFrame,JPanel,Box,JComboBox,JSpinner,JButton,JLabel,SpinnerNumberModel,WindowConstantsfromjava.awtimportBoxLayout,GridLayoutclassSettingsWindow:defstart(self):selected=self.combobox.selectedIndexifselected>=0:self.map=self.map_list[selected]self.games=sel

python - Sublime text 3.1.1 中的 Pylinter 仍然没有使用 Python2.7

这是我的pyinter设置:{//Whenversboseis'true',variousmessageswillbewrittentotheconsole.//values:trueorfalse"verbose":false,//ThefullpathtothePythonexecutableyouwantto//runPylintwithorsimplyuse'python'."python_bin":"/usr/bin/python2.7",//ThefollowingpathswillbeaddedPylint'sPythonpath"python_path":[],//Op

python - 获取 IOError : [Errno Input overflowed] -9981 when setting PyAudio Stream input and output to True

我正在尝试在我的Mac(OS10.7.2)上运行以下代码(来自PyAudio文档的示例):importpyaudioimportsyschunk=1024FORMAT=pyaudio.paInt16CHANNELS=1RATE=44100RECORD_SECONDS=5p=pyaudio.PyAudio()stream=p.open(format=FORMAT,channels=CHANNELS,rate=RATE,input=True,output=True,frames_per_buffer=chunk)print"*recording"foriinrange(0,44100/ch

python - 是否有用于调试 python 的 sublime text 2 插件?

sublimetext2有调试python的插件吗?SublimeText是一个很棒的python编辑器,但是一旦项目变得太大,我不得不使用其他IDE(例如eclipse)进行调试。你们Pythonists有解决这个问题的方法吗? 最佳答案 尝试https://github.com/wuub/SublimeREPL,它使用pdb来调试python,并且易于通过包Controller安装 关于python-是否有用于调试python的sublimetext2插件?,我们在StackOver

Python tkinter : Make any output appear in a text box on GUI not in the shell

我正在使用python和tkinter制作一个GUI,只是想知道是否有办法让任何输出文本出现在GUI的窗口中而不是解释器/shell上?提前致谢 最佳答案 如果按照BryanOakley的评论中的建议,您想要“在您的GUI中打印‘foo’,但让它神奇地出现在文本小部件中”,请参阅上一个问题的答案Python:ConvertingCLItoGUI.这个答案解决了如何在文本框中生成输出这一更简单的问题。要生成滚动文本窗口,请创建并放置或打包一个文本小部件(我们称它为mtb),然后使用像mtb.insert(Tkinter.END,ms)

python - 是什么导致 Cassandra CQL 出现 "no viable alternative at input ' None'"错误

我正在尝试使用新key将修改后的文档插入回CassandraDB。我很难弄清楚错误消息指向的问题是什么。在寻找其他有类似问题的人时,答案似乎与键有关,在我的例子中,None只是少数键的值。我该如何解决这个问题?keys=','.join(current.keys())params=[':'+xforxincurrent.keys()]values=','.join(params)query="INSERTINTOwiki.pages(%s)Values(%s)"%(keys,values)query=query.encode('utf-8')cursor.execute(query,c

python - sys.stdin.readline() 和 input() : which one is faster when reading lines of input, 为什么?

当我需要从STDIN获取输入行时,我正在尝试决定使用哪一个,所以我想知道在不同情况下我需要如何选择它们。我发现以前的帖子(https://codereview.stackexchange.com/questions/23981/how-to-optimize-this-simple-python-program)说:HowcanIoptimizethiscodeintermsoftimeandmemoryused?NotethatI'musingdifferentfunctiontoreadtheinput,assys.stdin.readline()isthefastestonewh