pydev

how to declare variable's type in pydev?

浪子不回头ぞ 提交于 2019-12-21 19:12:09
问题 Suppose there's a set of class Map1,Map2,Map3,... all extended from BaseMap, and I use some reflection mechanism to get the child Map's instance. I want to dynamically get an instance of one of these classes and store it in a variable m , and have pydev recognize the type as BaseMap so I can use word completion on it. I found one solution is to add the code if False: m = BaseMap(0,0,0) after assigning m and before using it. The line inside the if condition would never be executed, but it

PyCharm debugger fails with AttributeError

烈酒焚心 提交于 2019-12-21 17:46:09
问题 I cannot debug a Flask application in PyCharm. The application should run on port 5000: app.run(host="10.1.0.17", port=5000, debug=True) . The console output is: C:\Python\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 145.597.11\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 10498 --file "D:/TGM/SMS/SMS/Back .v2/wsgi.py" pydev debugger: process 4108 is connecting Could not connect to 127.0.0.1: 10499 Traceback (most recent call last): File "C:\Program Files

Suppress warnings in PyDev

耗尽温柔 提交于 2019-12-21 09:25:16
问题 I use the following at the beginning of all modules in my Python project: import setup_loggers setup_loggers is a module that does exactly that. The import statement makes sure that no matter which module is loaded first, the loggers are setup and ready. However, as I don't use setup_loggers module later in the file, I receive a PyDev warning (a small yellow marker). I get this warning for all my modules, thus it blocks me from seeing other warnings in the PyDev Package Explorer. Is there a

Unable to gather python interpreter info for pydev

╄→гoц情女王★ 提交于 2019-12-21 09:21:20
问题 OS: Windows 7 x64 Python: 2.7.3 Pydev: 2.7.1.2012100913 Eclipse: Version: Juno Service Release 1 Build id: 20121004-1855 I am unable to configure a python interpreter in Pydev. If I try using the auto-configuration or the manual configuration I get the same type of error output: Unable to gather the needed info from the system. This usually means that your interpreter is not in the system PATH. No output was in the standard output when trying to create the interpreter info. The error output

Pydev shows unresolved import, but script runs?

余生长醉 提交于 2019-12-21 07:07:06
问题 I am using PyDev. I am trying to organise my project classes into packages. e.g. In a folder I have a module at /libraries/fund_price_library.py In another file in my project, I try to import using: from libraries.fund_price_library import FundPriceLibrary as fpl PyDev underlines "FundPriceLibrary as fpl" in red, marking it with this error: unresolved import fpl However, my script works perfectly fine, so I believe that I am doing the import correctly. I have lots of similar errors all over

Howto ignore specific undefined variables in Pydev Eclipse

泪湿孤枕 提交于 2019-12-21 04:44:05
问题 I'm writing a crossplatform python script on windows using Eclipse with the Pydev plugin. The script makes use of the os.symlink() and os.readlink() methods if the current platform isn't NT. Since the os.symlink() and os.readlink() methods aren't available on the Windows platform Pydev flags them as undefined variables--like so: Question: Is there a way to ignore specific undefined variable name errors without modifying my source file? edit : I found a way to ignore undefined variable errors

How do I configure Eclipse to launch a browser when Run or Debug is selected using Pydev plugin

你离开我真会死。 提交于 2019-12-20 19:30:04
问题 I'm learning Python and Django using the Eclipse Pydev plugin. I want the internal or external browser to launch or refresh with the URL http:/127.0.0.1 when I press Run or Debug. I've seen it done with the PHP plugins but not Pydev. 回答1: Here are the steps to set up an external launch configuration to launch IE: Select Run -> External Tools -> External Tools Configurations... In the left hand pane, select Program then the new icon (left-most icon above the pane). In the right hand pane,

Eclipse Pydev: 'Error: Python stdlib not found'

孤人 提交于 2019-12-20 11:11:31
问题 I am trying to add an interpreter (created using virtualenv) to PyDev but I get the following error: It seems that the Python /Lib folder (which contains the standard library) was not found /selected during the instal process. This folder (which contains files such as threading.py and traceback.py) is required for PyDev to function properly (and it must contain the actual source files, not only .pyc files) ... Note that if this is a virtualenv install, the /Lib folder from the base install

Is there a way to hook Django's unittest into PyUnit in eclipse?

旧城冷巷雨未停 提交于 2019-12-20 10:49:12
问题 I've been working on a Django project for the past few weeks now, and it's been fairly smooth sailing. I use Django's unittest library to test everything, and the result show up in the console. However, after doing some research, it looks like pydev provides facilities for PyUnit . I use Eclipse, and I thought I would just just be able to pipe the unit tests into PyUnit, but I haven't had any luck in either that or finding documentation to do so. How do I have my unit tests run in the PyUnit

this constructor takes no arguments

放肆的年华 提交于 2019-12-20 07:21:46
问题 I'd like to make a simple calculator in Tkinter. I've got few lines of code and want to check if it works. But then I recevie such error: "Calc(T.Tk()).run() this constructor takes no arguments". Here is my code: # -*- coding: utf-8 -*- import Tkinter as T from Tkinter import W, E class Calc(): def _init_(self,main): self.main = main self.main.title('Calculator') self.main.config(bg = 'black') self.e = T.Entry(self.main, justify = 'center') self.e.grid(row = 0, columnspan = 5, sticky = W + E)