import

Why I can call 'print' from 'eval'

For code: #!/usr/bin/python src = """ print '!!!' import os """ obj = compile(src, '', 'exec') eval(obj, {'__builtins__': False}) I get output: !!! Traceback (most recent call last): File "./test.py", line 9, in <module> eval(obj, {'__builtins__': False}) File "", line 3, in <module> ImportError: __import__ not found Bot...

how to create the frame data structure with columns from csv data in R?

Hi, Below are the first five rows of the imported data in R: data[1:5,] user event_date day_of_week 1 00002781A2ADA816CDB0D138146BD63323CCDAB2 2010-09-04 Saturday 2 00002D2354C7080C0868CB0E18C46157CA9F0FD4 2010-09-04 Saturday 3 00002D2354C7080C0868CB0E18C46157CA9F0FD4 2010-09-07 Tuesday 4 00002D2354C7080C0868CB0E18C46157...

python circular imports once again (aka what's wrong with this design)

Let's consider python (3.x) scripts: main.py: from test.team import team from test.user import user if __name__ == '__main__': u = user() t = team() u.setTeam(t) t.setLeader(u) test/user.py: from test.team import team class user: def setTeam(self, t): if issubclass(t, team.__class__): self.t...

How can I conditionally import a package in Perl?

I have a Perl script which uses a not-so-common module, and I want it to be usable without that module being installed, although with limited functionality. Is it possible? I thought of something like this: my $has_foobar; if (has_module "foobar") { << use it >> $has_foobar = true; } else { print STDERR "Warning: foobar not...

good tool to quickly import some csv data into sql server

Every once in a while I find myself typing a one-off script to import some CSV data into a database, doing some column logic (e.g. turn column3 into uppercase) and/or field mapping (column2 in the csv goes to column 3 in de database, etc). Is there a nice tool which can do this easier? The least amount of features I'd need is: choos...

Prevent eclipse from auto import packages when copying source code between projects

Is it possible to prevent eclipse from automatically improrting any modules when I copy source code from one project to another. I just want to copy the source code and then rename all the specic classes, I don't actually want to use the classes from the other project. ...

Updating 10,000 cck fields daily in drupal

One of our sites has around 10,000 nodes. In each node, there is a simple cck text/integer field. This integer changes daily, so they need to be updated every day. The integer ranges from 1 to 20000000. The cck field is across all content types, so it has its own table in the database. We don't use revisions. I chose to have it rea...

Python imports-Need someone to check this please

Ok yes it is a very silly question, but just that I am getting a little confused. I have a file structure which looks like this:- -Mainapplication -models.py -Helpingmodules -Folder1 -module1.py Now I have to import models into module1. So in module1.py I just did:- from Mainapplication import models Now this does work ...

Import Java-Applet Project in Eclipse

@ home i built a java applet in eclipse now i want to port it on my working computer... eclipse version is the same as @ home and jdk also. i get following error: Description Resource Path Location Type The project was not built due to "Could not delete '/ProgramApplet/bin/de'.". Fix the problem, then try refreshing this projec...

Yet another python import issue of mine

Looks like I am having a real tough day with python imports.I am using Flask and am trying to organise my app structure.I am using it on GAE and thus have to put python packages in my app itself. It looks something like this below:- -MyFolder -flask -werkzeug -Myapp - __init__.py -templates -static -views.py -bli...

How to modify a git repository's history to show contents were imported from another repository?

I have two projects, A and B. They were poorly divided, because A had to run one part before B and another part after B. So I decided to merge them. B's contents were copied into A's working directory, committed, and work continued from there. Of course, B's history was not preserved in the copy-paste. I want to fix this before it's for...

MS Access 2003/2007 - Import Specification for data import from csv file used in VBA.....validate field names?

I have an import which I made with the wizard, at least far enough just to save the specification. It imports CSV files, with headers, quote text qualifiers, and comma delimited. I then use the import specification in some vba that fires from a button click event. Here are some things I am wondering: So if the fields in the data are ou...

Importing huge music files into database

Hi, We have very huge music files in mp3 formats (very huge more than 1,000,000) and would like to import all these songs into the DB of an application we are developing. Is there any easy method to import such huge files at once. Kindly let me know ...

Python import module results in NameError

I'm having a module import issue. using python 2.6 on ubuntu 10.10 I have a class that subclasses the daemon at http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ . I created a python package with a module containing code that imports some models from a django project. The code works when used from a class, no...

MYSQL import: port a big list of names into mysql table column. An easy way?

I have a txt file with tons of complex names I want to insert into my sql table named cred_insurances. The table is currently blank. Each line should be one record and the name should be in the column called ProviderName. My text file is like this: Alabama Medicaid Alaska Medicaid Arizona Medicaid (AHCCCS) Arkansas Medicaid California M...

can't 'import time' in python, get 'AttributeError: struct_time' How to solve?

Running python on Snow Leopard, and I can't import the 'time' module. Works in ipython. Don't have any .pythonrc files being loaded. Scripts that 'import time' using the same interpreter run fine. Have no idea how to troubleshoot this. Anyone have an idea? [wiggles@bananas ~]$ python2.6 Python 2.6.6 (r266:84292, Sep 1 2010, 14:27:13) ...

import initial table data to .mwb model file

hi, how can i import initial table data to .mwb file? i know that there is 'inserts' tab for each table, but i would like to import like 200 records and i don`t want to do this by hand :) ...

Groovy htmlunit

I'm having issues importing htmlunit (htmlunit.sf.net) into a groovy script. I'm currently just using the example script that was on the web and it gives me unable to resolve class com.gargoylesoftware.htmlunit.WebClient The script is: import com.gargoylesoftware.htmlunit.WebClient client = new WebClient() html = client.getPage('htt...

Python: 'import node.py' raises "No module named py"-error

I have a file main.py like this: import node.py [my code...] and a node.py like this: [more of my code] When executing main.py, I get this error: File "/home/loldrup/repo/trunk/src/src/main.py", line 2, in <module> import node.py ImportError: No module named py ...

Best practices for import and export (synchronization) of data with MSCRM 4.0

Hi, what are the recommended ways to synchronize data between an external system and MSCRM 4.0? By synchronization I mean periodically importing/exporting data (contacts, activities and some other entities) to/from MSCRM. The interface to the external system is CSV or ODBC. I read about several methods. Currently I am favouring using ...