In eclipse, there is this handy shorthand CTRL+SHIFT+o which will auto include the import (include) statements which are needed based on the Class or module being used.
Have you found any such plugin for vim or emacs?
...
I understand that repr()'s purpose is to return a string, that can be used to be evaluated as a python command and return the same object. Unfortunately, pytz does not seem to be very friendly with this function, although it should be quite easy, since pytz instances are created with a single call:
import datetime, pytz
now = datetime...
Hello, guys, I am programming a GUI for an application, a cd container to insert cd, and currently I am not very clear and I think I need some help to clarify my understanding about object oriented design.
so, first, I use observer pattern to build abstract Model and View classes and also the concrete models(cd container) and concrete ...
I have the following code, using Django ORM
routes =Routes.objects.filter(scheduleid=schedule.id).only('externalid')
t_list = [(route.externalid, route.vehicle.name) for route in routes])
and it is very slow, because the vehicle objects are huge (dozens of fields, and I cannot change that, it is coming from a legacy database)....
I installed the plugin for python and it detects the python code, but how do I run it from Netbeans? Please let me know
Thank you
...
I want to put an instance of scapy.layers.dhcp.BOOTP on a multiprocessing.Queue. Every time I call put() the following exception occures:
Traceback (most recent call last):
File "/usr/lib/python2.6/multiprocessing/queues.py", line 242, in _feed
send(obj)
PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.f...
different languages have different GUI toolkits but It looks very difficult to achieve attractive user interfaces as good as we can using HTML and css with less effort.
I dont my application in javascript as I doubt if it has all the required libraries and i want to do it in python.
How do I use rendering engines like gecko,webkit etc ...
I don't understand
in 2.X it worked :
import zlib
zlib.compress('Hello, world')
now i have a :
zlib.compress("Hello world!")
TypeError: must be bytes or buffer, not str
How can i compress my string ?
Regards
Bussiere
...
I found this xgoogle python modules http://github.com/pkrumins/xgoogle, very interesting. How exactly should i include or install these files in linux??
if i want to do something like this using xgoogle python module?
>>from xgoogle.search import GoogleSearch
I know that we can use from, import to use modules, but to include an exte...
Hi!
I'm trying to setup a Python application that should automatically start when Linux boots. It should also start (unless not already running) if the computer resumes from standby mode - which is mainly the problem.
Does anybody know where to integrate these requirements?
Thanks,
Marius
...
I'm developing a plugin UI for an existing application using PyQt4. The window is created using uic.loadUi() on the press of a button in the main window. The problem is that if I press the button again (while the window is showing) the window is re-created and unsaved changes are lost. I don't want to make the window modal. Which options...
When using optparse i want to get the whole string after an option, but I only get part of it up to the first space.
e.g.:
python myprog.py --executable python someOtherProg.py
What I get in 'executable' is just 'python'.
Is it possible to parse such lines using optparse or do you have to use argparse to do it?
€: I have already t...
This is probably very basic, but it's giving me a headache, and I'm not sure what method to even approach it with, making the googling tough.
If I have a class in a module that I'm importing with various prints throughout, how can I read the prints as they come so that I may output them to a PyQT text label?
class Worker(QtCore.QThread...
Does anyone know of a JavaScript interpreter that has bindings to PHP or Python?
...
I'm writing an app that pulls chunks of svg together and serves them as part of a page mixed with css and javascript. I'm using Python and Google App Engine. What I'm doing works fine on my local development server but fails to render once it's deployed.
So here's some test python to build a response:
self.response.headers.add_header(...
I've unpacked BeautifulSoup into c:\python2.6\lib\site-packages, which is in sys.path, but when I enter import BeautifulSoup I get an import error saying no such module exists. Obviously I'm doing something stupid... what is it?
...
I'm making a relatively simple program which will also be running on a few friends computers and they need to share some information. They will need to exchange ips in case they are changed via dhcp and maybe a few other things in the future, but right now that's it (this will likely be used to update the program if I ever change it too ...
This is a simple server. When you open the browser type into the address of the server, and it will response a status code and the content of the requested html. But when I add this sentence "connectionSocket.send('HTTP/1.1 200 OK')", nothing returned. When I removed it, the html returned. And another problem is when I send the request b...
I have a question about global variable in Python.
The code is following. If I do not use global M in function test,
It would issue error.
But Why it does not show error for string s. I do not declare it as global.
global M
M = []
s = "abc"
def test():
### global M
print M
M.append(s)
print M
UnboundLocalError: local v...
Hi,
I have a python extension that is built and installed through distutils (using mingw on windows). However on import of this module the interpreter crashes. Is there anyway to debug and figure out why it crashes?
I did look around online and couldn't find anything specific, or any examples.
EDIT
Sorry i am trying to compile for py...