From research on Stack Overflow and other sites I'm 99% sure that the problem I'm having is due to incorrect importing. Below is a QLabel sub class that I'm using to respond to some mouse events:
import Qt
import sys
class ASMovableLabel(Qt.QLabel):
def mouseReleaseEvent(self, event):
button = event.button()
if b...
Here is the directory structure:
app/
__init__.py
sub1/
__init__.py
mod1.py
sub2/
__init__.py
sub2.so
test_sub2.py
The folder app is on my PYTHONPATH
All of the _init_.py files are empty.
The shared library sub2.so is a C++ extension module that I compiled using cmake and boost-pyth...
Possible Duplicate:
Import package.* vs import package.SpecificType
Can I do:
import java.awt.*
instead of:
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
if both ways are correct which one is better?
...
I'm trying to use a third-party lib (docutils) on Google App Engine and have a problem with this code (in docutils):
try:
import pwd
do stuff
except ImportError:
do other stuff
I want the import to fail, as it will on the actual GAE server, but the problem is that it doesn't fail on my development box (ubuntu). How to make...
I would like to load a .py file at runtime. This .py file is basically a config file of the following format:
var1=value
var2=value
predicate_function=func line :
Once this file is loaded, I would like to be able to access var1, var2 and predicate_function. For each line, I'll pass it to the predicate func, if it returns...
I am still getting my head around the import statement. If I have 2 folders in the same level:
src
test
How to make the py files in test import the modules in src?
Is there a better solution (like put a folder inside another?)
...
I am trying to follow Eclipse instructions to create a Hello World SWT application. I have the following instruction:
Import the SWT project from the main
menu via File > Import..., and select
Existing Projects into Workspace.
Specify the archive file you
downloaded and click Finish. This will
create the org.eclipse.swt pro...
Hi,
When building a CLR Storedprocedure Project using MSBuild on our build server (Team City) we're getting the following error:
error MSB4019: The imported project
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\SqlServer.targets"
was not found. Confirm that the path
in the declaration is
correct, and that the file exists o...
I am working on a plugin system where plugin modules are loaded like this:
def load_plugins():
plugins=glob.glob("plugins/*.py")
instances=[]
for p in plugins:
try:
name=p.split("/")[-1]
name=name.split(".py")[0]
log.debug("Possible plugin: %s", name)
f, file, desc=imp.find_module(name...
I am writning a Hello World SWT application in Eclipse (I follow instructions given by Eclipse). At some point I have to "Right click in the Java editor and select Source > Organize Imports".
I did it in Eclipse installed on Ubuntu. This operation has generated import statements in the beginning of my code. But it was not sufficient to ...
A potential client has a slow ecommerce site using Joomla/Virtuecart which takes 6-10 seconds for any page to load. I've seen faster solutions and would like to transfer the 4,000+ products with little hassle to a speedier, more full-featured open-source solution.
Is there a good way to transfer thousands of products between ecommerce ...
I'm working on a project where all the code in the source tree is separated into module directories, e.g.:
modules/check/lib/check.py
modules/edit/lib/edit.py
During installation, the Python files are put in the same directory program_name under Python's site-packages. All the modules therefore use the syntax import program_name.edit....
I have two PCs, one is Ubuntu 8.10 and the other Ubuntu 9.10. On the Ubuntu 8.10, i have a few databases in phpmyadmin which i would like to copy across to the Ubuntu 9.10 phpmyadmin(which has no databases).
I'm not sure if i'm on the right path but here's what i think i should do:
Export the databases onto Ubuntu 8.10. And copy those...
I'm trying to read an excel file from C# using COM, and can get it opened and loaded just fine. However, I don't want to use all of the data on the sheet (it expands monthly), just a certain subset that starts below the top of the sheet (row 3 for headers, row 4 for data) and goes to the end. I can currently get a range representing th...
Hi!
I'm trying to read data from csv file, but instead of e.g. 001000 I get 1000 in my data.
I've tried to set as.is=!stringsAsFactors, but got error: object stringsAsFactors not found.
Anybody can help?
...
I can't find the line in the Adobe samples for a maze game where the actual .as code is included into the project. This is fundamental, since my own implementation is just using include "file name";, which isn't working. I also can't use import, since I then can't access the elements placed on the stage. Help, please? The files are avail...
I'm using Python 2.5.2 (because mwclient still only works for 2.x). I've copied the mwclient folder into the /usr/lib/python2.5/site-packages/mwclient folder, and when I run a program that imports mwclient I get this:
Traceback (most recent call last):
File "get_wiki.py", line 2, in <module>
import mwclient
File "/usr/lib/pyth...
Using the SQL Server Import and Export wizard in Management Studio 2005 I've encountered a big problem. After selecting a set of tables whose data I want to copy (specifying Delete Rows in Existing Tab and Identity Insert in the mappings) I execute the wizard and my rows from one database are nicely copied into my identical but previousl...
I saw one other question on how to do a mass import of products, categories, and all that, but all I want to be able to do is import my categories from one store to another.
When you export products I see that there is still a category ID attribute that it gives the products, but I don't see any options for exporting product categories....
Hello there,
I currently use an Ant script to download several Java projects (projects divided as modules) from a svn repository and generate a single war file.
But now there is a need to use those scripts to download these projects directly to an eclipse workspace.
Even after the build.xml is executed successfully, these projects are...