473,386 Members | 1,673 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,386 software developers and data experts.

import/from import question

Is there a way to detect if module was imported by 'from <mod> import <sth>'
or by 'import <mod>'?

Artur

--
Before the Goat of Mendes... we all must take our turn | Artur M. Piwko
Into the magic circle... where still the fire burns | mailto:s/_/./
We're spinning round and round... until one takes a fall | -- Mercyful Fate
The fallen one will not return, the fallen one must burn | "Witches' Dance"
Jul 18 '05 #1
2 1467
"Artur M. Piwko" wrote:

Is there a way to detect if module was imported by 'from <mod> import <sth>'
or by 'import <mod>'?


Why do you want to do that? It's likely to be a bad idea...
Jul 18 '05 #2
"Artur M. Piwko" wrote:

Is there a way to detect if module was imported by 'from <mod> import <sth>'
or by 'import <mod>'?


Why do you want to do that? It's likely to be a bad idea...
Jul 18 '05 #3

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

Similar topics

1
by: Kevin MacKenzie | last post by:
I'm a complete newbie to using Python. I have a small question about importing modules. Is there any difference between the two following statements, and what (if any) are they? >>> from...
0
by: Stian Søiland | last post by:
all examples performed with: Python 2.3+ (#2, Aug 10 2003, 11:09:33) on linux2 (2, 3, 0, 'final', 1) This is a recursive import:
9
by: Paul Rubin | last post by:
That's what the Python style guides advise. They don't seem to like def frob(x): import re if re.search('sdfxyz', x): ... instead preferring that you pollute your module's global namespace...
1
by: Raaijmakers, Vincent \(GE Infrastructure\) | last post by:
Question: my src path looks like this: src\root\sub1 src\root\sub2 My main code is in root, lets say main.py and there is also a lib.py. In sub1 there if foo1.py and sub2 foo2.py Sorry for...
3
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
2
by: jet | last post by:
Hi, Maybe this is an easy task, but I'm having a really hard time figuring out how to do this. I'm a complete newbie to SQL Server. I have a database dump file from MySQL that's in .sql...
1
by: Dan | last post by:
Could someone please help me with auto importing a series of data files into an Access table. I tried to follow code given below in a previous messagebut i'm getting error messages. Here's my...
3
by: Seymour | last post by:
I created a module with the DictAdder subclass as follows: class DictAdder(Adder): def add(self, x, y): new={} for k in x.keys(): new=x for k in y.keys(): new=y return new At the...
49
by: Martin Unsal | last post by:
I'm using Python for what is becoming a sizeable project and I'm already running into problems organizing code and importing packages. I feel like the Python package system, in particular the...
9
by: a | last post by:
Dear friends I want import data from CSV file to mdb file How can I do that in vb.net?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.