Hi,
I'm running Python 2.5.4 on Windows and I keep getting an error when trying to import the ElementTree or cElementTree modules. The code is very simple (I'm following a tutorial):
import xml.etree.ElementTree as xml
root = xml.Element('root')
child = xml.Element('child')
root.append(child)
child.attrib['name'] = "Charlie"
file = ope...
Hi,
I have a pickle dump which has an array of foo.Bar() objects. I am trying to unpickle it, but the Bar() class definition is in the same file that's trying to unpickle, and not in the foo module. So, pickle complains that it couldn't find module foo.
I tried to inject foo module doing something similar to:
import imp, sys
class...
I can't seem to get the nose testing framework to recognize modules beneath my test script in the file structure. I've set up the simplest example that demonstrates the problem. I'll explain it below.
Here's the the package file structure:
./__init__.py
./foo.py
./tests
./__init__.py
./test_foo.py
foo.py contains:
def dumb_tr...
I have two files:
logic.scala and main.scala
logic.scala contains one class
and main.scala have one class with method main (to run it). And i wannt to import class from logic.scala and use this class to create object(s) and work with them.
How to import and compile it in proper way?
...
I have a module "Dictionary", declared in a file "Dictionary.hs".
in the same directory i have a file "Def.hs" which imports Dictionary
here's the error i get
... /edsl/Def.hs:4:7:
Could not find module `Dictionary':
locations searched:
Dictionary.hs
Dictionary.lhs
... /edsl/Dictionary.hs is there. it's perm...
Using the structure from the Python docs:
sound/
__init__.py
effects/
__init__.py
echo.py
surround.py
reverse.py
Say I want to import sound.effects and get a list of available effects. I could do this by declaring a module-level variable in sound.effects and then appending to it when each ....
How to import it in Flex?
import caurina.transitions.Tweener;
It says: 1120: Access of undefined property Tweener.
When I do something like: Tweener.addTween(...
Thanks,
...
While importing a python script from another script I want the script code that is classically protected by
if __name__ == "__main__":
....
....
to be run, how can I get that code run?
What I am trying to do is from a python script, dynamically change a module then import an existing script which should see the changes m...
Hi,
I am working on an Adobe Air project(using JavaScript and HTML). Users can install application and can enter customer details. The central server(PHP + MySQL) contains all the customer data and air applications sends customer data to that server and request for new data from the server.
This process is working fine. But now I want o...
Let's say I have 3 files:
a.py
from d import d
class a:
def type(self):
return "a"
def test(self):
try:
x = b()
except:
print "EXCEPT IN A"
from b import b
x = b()
return x.type()
b.py
import sys
class b:
def __init__(self):
if "a" ...
I am wondering what the pros and cons of importing a python module and/or function inside of the a function. Does it re-import every time the function is run? Does it import once at the beginning whether or not the function is run?
Anyways I would appreciate Pros and Cons of importing inside of a function, more specifically on efficien...
We have 2 servers, which one of them is customer's. Our customer is providing us an URLs of XML/JSON exports of his clients informations from his CMS and our task is to write some import scripts for importing data to webapp, which we're developing.
I've always been doing that like this:
INSERT INTO customers (name,address) VALUES ('Joh...
Lets say I have path to a module in a string module_to_be_imported = 'a.b.module'
How can I import it ?
...
In AS3, why do we put our import statements in the package statement, and not inside the Class declaration?
This is a typical (but rather pointless) AS3 class:
package my.foo.package
{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class F...
I am dealing with some python code automatically generated for me. I want to avoid manually editing these python files & hence this question/issue:
foo.py:
def foo():
print "foo"
boo.py:
def boo():
foo.foo() # <-- global name 'foo' not defined
print "boo"
bar.py:
import foo
import boo
def bar():
boo.boo()
print "bar"...
We have a simple data model reflecting the following...
User contains many @OneToMany addresses
User contains many @OneToMany phones
User contains many @OneToMany emails
User belongs to a @Organization via @ManyToOne
We would like the customers to capture all user information in a excel / csv sheet and provide it to our upload tool. ...
Take a look at this code :
public class Program
{
[import]IMain Main {get; set;}
...
private Compose() {...}
}
internal interface IMain
{
...
}
[Export(typeof(IMain)]
public class Main : IMain
{
[import]
Interace1 Object1 {get;set;}
[import]
Interace2 Object2 {get;set;}
}
...
I want to lazy load Object2 after the compositio...
I want to import really clean .txt files into Mysql with PHP. I've read that this is easy if you know the delimiter. but I don't.
In my case, the .txt files look like tables - ie: they're still structured like tables, not like a standard, jumbled CSV file.
Does this mean I don't have a delimited file? If so, any advice on how I mi...
I'm trying to create an automated "spider diagram" like the ones created by VUE:
http://vue.tufts.edu/
VUE is open source, but the issue is that you create the maps in the program. I want to have a program that will pull the data from an excel sheet and display the map automatically when run.
I know how to open and parse the data in f...
I have an SSIS import package that is bringing data into a SQL 2005 database. One of the columns has the date in the following format (dd-mmm-yy) and always gets inserted into the database as NULL. I've tried the destination column as smalldatetime, NVARCHAR, VARCHAR, and always comes in as NULL. I know if edit the column on the sheet...