import

Import single database from --all-databases dump

Is it possible to import a single database from an --all-databases mysqldump? I guess I can modify the file manually but wondering if there are any command line options to do this. I am moving servers and have a lot of databases, most of which I don't currently need or want at the moment but would like to have the option to restore a si...

Python sub-package references

I am about at wits end with what should be an extremely simple issue. Here is the format of a simple example that I wrote to try to fix my problem. I have a folder top with __all__ = ["p1","p2"] in __init__.py . I then have sub-folders p1 and p2 with __init__.py in both of them with __all__ again defined with the names of two simple modu...

what is philosophy of using import in Python?

Do I need always import all I need in the beginning of the script? Use import immediately before using things from this? What to do if import thing uses several times? What is good style of using import in Python? ...

List of popular importable calendar formats?

Say I wanted to write a program that would export calendar data so that it could be imported into another calendar application. What would be some popular formats for that, and where could I find information on the formats of those files? ...

css @import external style sheet

If it possible to use @import in a .css file to load a style sheet from another site? Specifically, I have a main style sheet for my site which loads in other (local) style sheets using @import. I'd also like to load in a jquery ui theme hosted by google, e.g. @import "http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightn...

Why doesn't import prevent NameError in a python script run with execfile()?

I looked at a number of existing questions about NameError exceptions when scripts are run with exec statements or execfile() in Python, but haven't found a good explanation yet of the following behavior. I want to make a simple game that creates script objects at runtime with execfile(). Below are 4 modules that demonstrate the proble...

Python error: ImportError: cannot import name Akismet

I've seen many similar errors, but I can't see a solution that applies to my particular problem. I'm trying to use the Akismet module which is on my PYTHONPATH, then if I start up the interactive interpreter, when I run "from akismet import Akismet" (as the docstring says), I get the following error: from akismet import Akismet Traceb...

MySQL Update during CSV import question

Okay, so I have this CSV file of products and all the products have an ID number. I am going to import this CSV into an existing (empty) database table where the columns in the database are named the exact same name as the first-row columns in the CSV file. There is one extra column in the DB called URI. I need to build this during (o...

At what point does importing become the correct solution?

This weekend I was working on a project and I needed to use a binomial distribution to test the probability of an event (the probability that x of y characters would be alphanumeric given random bytes). My first solution was to write the test myself since it is rather simple. def factorial(n): if n == 0: return 1 else: ...

Python: Import Data from Open Office calc with lxml

How can I import data for example for the field A1? When I use etree.parse() I get an error, because I dont have a xml file. ...

Python: Misunderstanding about how imports work

Here is my loader class, ItemLoader.py: from google.appengine.ext import db from google.appengine.tools import bulkloader import models class ItemLoader(bulkloader.Loader): def __init__(self): bulkloader.Loader.__init__(self, 'Item', [('CSIN', int), # not too DRY... ('name',...

In Python, what exactly does "import *" import?

Does it import __init__.py found in the containing folder? e.g., is it necessary to declare from project.model import __init__ or is from project.model import * sufficient? ...

Importing data from Access to SQL Server (with minor table changes)

I'm currently working on migrating an application from MS-Access to MS SQL Server. In the process, there are a few minor changes that I am making to the table layouts (I am splitting a few things up into more two tables), however, I would still like to keep all the data that is present in the database. What would be the best way to imp...

xslt import/include 2 files with the same template

Hello guys, I've got an interesting question on XSLT import/include. I have 2 XSLT files with the same rule. Receipt XSLT: (is run by itself) <xsl:template match="Booking" mode="extraStyle"> <link rel="stylesheet" href="../css/receipt.css" type="text/css" media="screen"/> </xsl:template> EmailCommon XSLT: (serves as template libra...

SQL Server Express 2005: How to import fixed width data using BCP

I’m trying to import fixed width data from text file into SQL Server Express using BCP. I have read some Microsoft’s web pages about this matter, but I haven’t got far with them. Can please give some examples or point to some good tutorials about this subject? ...

Magento order import export

Is there a way to import/export orders by CSV in Magento? I thought I could do this with profiles but if i try to create a new profile it makes me choose only between customers and products. I looked for an extension but i haven't found anything (anyway i'm looking for something free). Have you got some suggestions? ...

Bulk insert from datatable in to Oracle using Oracle.DataAccess & VB.net

I am reading a csv file in to a datatable in vb.net and making a few checks and appending an extra column. I then want to perform a bulk insert using microsofts Oracle.DataAccess (no choice in this) to an Oracle database. what would be the best way to perform this as there is no bulkImport like in SQLserver. thanks ...

In python, why is "import *" bad?

It is recommended to not to use import * in python. Can anyone please share the reason for that, so that I can avoid it doing next time. Thanks and Regards ...

C4772 even when the type library is registered and present

I have a set of Visual C++ 9 COM component projects dependent on each other. ComponentA publishes its typelib into ComponentA.tlb. ComponentB imports ComponentA.tlb into ComponentB.idl and publishes ComponentB.tlb. Methods signatures in ComponentB.idl contain parameters of types defined in ComponentA.tlb. Both ComponentA and ComponentB ...

How to import a partitioned table into a table with a different number of partitions? (Oracle 10g)

I have an existing database with tables which each have 4 partitions (there are tables using both RANGE and HASH partitioning). I need to import it into another database with a pre-created schema where the same tables will have 8 partitions. How do I do this? Does this "just work" if I do a table-level import? ...