473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

importing over network

Is there a possibility to do import over the network?
I would like to put all my modules on a server and import them over the
network (internet or LAN).

B.
Jul 18 '05 #1
4 1333
Boštjan Jerko <bo***********@mf.uni-lj.si> writes:
Is there a possibility to do import over the network? I would like
to put all my modules on a server and import them over the network
(internet or LAN).


Well, it's probably possible, but I'm not sure about easy or wise.
Something like NFS or samba is surely easier...

Cheers,
mwh

--
In that case I suggest that to get the correct image you look at
the screen from inside the monitor whilst standing on your head.
-- James Bonfield, http://www.ioccc.org/2000/rince.hint
Jul 18 '05 #2
I never worked with them, but there seems to be a mechanism named "import
hook" - google for it. That might be what you are looking for.

--
Regards,

Diez B. Roggisch
Jul 18 '05 #3
The second later, I found this:
http://aspn.activestate.com/ASPN/Coo.../Recipe/305277

--
Regards,

Diez B. Roggisch
Jul 18 '05 #4
On Fri, 2004-10-15 at 13:40 +0200, Bo¹tjan Jerko wrote:
Is there a possibility to do import over the network?
I would like to put all my modules on a server and import them over the
network (internet or LAN).


You could use something like this (assuming the remote module is named
'foo.py' and has a function named 'foo'):

import sys, urllib, imp

remoteModules = {
'foo': 'http://www.IBetterKnowThisURLIsSecure.com/foo.py',
}

for name, url in remoteModules.items():
code = urllib.urlopen(url).read()
module = imp.new_module(name)
exec code in module.__dict__
globals()[name] = module

foo.foo()

This is pretty limited (doesn't support packages for one thing, and I'm
sure there's probably more restrictions). I'd personally take a look at
the ihooks module and see if you can use that instead.

You might also use some library that can pull down entire web sites
(such as HarvestMan) to pull the modules or packages locally and then
just use __import__ to import them. This would also give you some
caching abilities.

Regards,
Cliff

--
Cliff Wells <cl************@comcast.net>

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Morgan | last post by:
------=_NextPart_000_0009_01C3535E.C763E5F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm doing a project for a local hospital, they want to...
1
by: Jeff Blumsom | last post by:
I recently changed for Access97 to Acces2000 and converted a significant application to 2000. I have been used to designing forms in a 'dummy' database and then importing them - with their code...
2
by: TheElectron707 | last post by:
Hi! I have a scenario in which i am importing a VERY LARGE database over the network. (Linking is not my solution). Now it takes many hours to import the complete database. I want that once the...
1
by: sparks | last post by:
I have never done this and wanted to ask people who have what is the best way. One person said import it to excel, then import it into access table. but since this will be done a lot, I am...
2
by: Sara | last post by:
Hi - I've been reading the posts for a solution to my query, and realize that I should ask an "approch" question as well. We receive our production data from a third party, so my uers import...
1
by: IkyL234 | last post by:
I have identical databases setup - one in the network drive and the other resides in a laptop. Once the laptop database has had some records inserted, the data (table called tbl_main) is...
4
by: Roy | last post by:
Could someone point me in the right direction here? The current method of importing new data into our db goes something like this: 1.) txt files received via email 2.) employees clean data and...
0
by: sudharsh | last post by:
Hi all, I have been learning to write Python extension modules, and am quite at a loss over a small glitch thats taking place. When I import my module I get the following exception Traceback...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.