I'm trying to extend Python interpreter by a few C functions I wrote. From reading docs, to expose those function the user has to import the module encompassing the functions.
Is it possible to load pre-load or pre-import via C API the module so that the user doesn't have to type import <mymodule>? Or even better, from <mymodule> import...
In Java- "Static Members of the default package cannot be imported"- Can some one explain this statement? It would be better if its with an example. I am not sure if it has a really simple answer but then I tried to understand but couldn't figure it out.
...
I am using script to import data from dmp file. The script is
imp sys/password file=<file location> full=yes
but it does not work. It asked for file buffer size and either we put file buffer size or it will be terminated.
Please tell me what could be the problem.
...
In my working python directory I create:
packagename/__init__.py
packagename/modulename.py
test.py
In modulename.py I create some empty class:
class Someclass(object):
pass
in test.py:
import packagename
packagename.modulename.Someclass()
Why I can't call packagename.modulename.someclass() in test.py ?
AttributeError: 'modul...
Wrote a small script - just trying to get used to the os, sys, and some other common modules/libraries available to python at install. The gist: The script is designed to search the python directory for all available modules (whether they are installed or not), then it is suppose to check what modules are currently loaded, then it offe...
Hi,
I just installed PyGame 1.9.1 (onto an existing python 2.6.4). Python and it standard libraries work, however, there is a problem with python even being able to find the pygame modules (correctly).
Traceback (most recent call last):
File "C:\foo\bar\firstGame.py", line 2, in <module>
import pygame
File "C:\python264\lib\sit...
Please help me to create a Export like Export and Import Opttion in in SQL Server 2005
...
Has anyone tackled importing default ExpressionEngine comments to Disqus? I found this on github but I'm not sure how to use it, or if it will work. http://gist.github.com/202802
...
In my MSSQL server I have a SQL view called AllFavourite. In order to load the data into my DTO class I have the following in my hbm.xml file...
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Domain.Model.Entities" assembly="Domain.Model">
<import class="AllFavourite"/>...
Following this question which asks (and answers) how to read .mat files that were created in Matlab using Scipy, I want to know how to access the fields in the imported structs.
I have a file in Matlab from which I can import a struct:
>> load bla % imports a struct called G
>> G
G =
Inp: [40x40x2016 uint8]
Tgt: [8...
Or do I have to specifically enumerate every class that I import?
I'm just learning Clojure now, and it seems useful to be able to do something like this in the REPL:
(import '(java.io *))
Not that this is valid syntax, but it would be nice to have something that does the equivalent. It would save some typing, especially when tink...
I've got a problem trying to get python to accept an import 'globally'
In a module it needs to import another module depending on another variable but it doesn't seem to import it into all of the module functions if i have it in the start function; for example:
def start():
selected = "web"
exec("from gui import " + selected + ...
Given the following example layout:
test/
test.py
formats/
__init__.py
format_a.py
format_b.py
What I try to archive is, that whenever I import formats, the __init__.py looks for all available modules in the formats subdir, loads them and makes them available (right now simply through a variable, supported_formats). If...
I'm working with xcode and I have classes associated with other projects that I want to be included in new projects. I realize that the #import will do the job technically (although what should i do if it's out of the project root folder). But what do I do if I want to include the class "properly" --basically so i can double click and ed...
from here I got an idea about how using variables from other modules. this all works fine with
import foo as bar
But I don't want to import my modules as "bar" I want to use it without any prefix like
from foo import *
Using this it´s impossible to modify variables from other modules. reading will work! any idea? suggestions?
...
Hello everyone,
We have a modeling tool which uses OCC, and a 3d editor using OSG. What i want to do is, export the model from the first tool and import into the second tool. I have been searching the web for days, but i can't find a solution.
Three things can solve my problem:
1 - An exporter for OCC to export into OSG supported form...
I need to execute a Python script from an already started Python session, as if it were launched from the command line. It should be similar to doing source in bash or sh.
...
I'm writing a piece of reusable code to import where I need it, but it needs some info about what is importing it. I have a workaround that does what I want, but it's a bit ugly. Is there a better way?
Here is a simplified version of what I'm doing.
What I want: Import a method and use it, but look at f in mod2. It needs some info from...
Hi,
Is there a standard or recommended method of exporting the data from an Oracle DB into a SQL Server or mySQL database? Was thinking exporting the Oracle data into XML then importing the XML into SQL Server...or this recommmened?
Thanks,
...
Hello,
When writing python modules, is there a way to prevent it being imported twice by the client codes? Just like the c/c++ header files do:
#ifndef XXX
#define XXX
...
#endif
Thanks very much!
...