On 16Feb2024 20:32, MRAB wrote:
On 2024-02-16 20:07, Gabor Urban via Python-list wrote:
I need something about modules to be clarified.
Suppose I have written a module eg: ModuleA which imports an other
module, let us say the datetime.
If I import ModuleA in a script, will be datetime importe
On 2024-02-16 20:07, Gabor Urban via Python-list wrote:
Hi guys,
I need something about modules to be clarified.
Suppose I have written a module eg: ModuleA which imports an other
module, let us say the datetime.
If I import ModuleA in a script, will be datetime imported automatically?
Yes.
Hi guys,
I need something about modules to be clarified.
Suppose I have written a module eg: ModuleA which imports an other
module, let us say the datetime.
If I import ModuleA in a script, will be datetime imported automatically?
Thanks in advance,
--
Urbán Gábor
Linux is like a wigwam: no G
"Ian Kelly" wrote in message
news:calwzidm3khnagtt0ohveo5bhqk1tfejbuuuinw9tnuxrpnr...@mail.gmail.com...
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside
"Frank Millman" writes:
>...
> My project comprises a number of modules, split into packages. Modules
> frequently need to access the contents of other modules, in the same
> or in a different package. I am getting better at it, but I still
> occasionally bump my head against circular imports, and
On Thu, Sep 10, 2015 at 8:47 AM, Peter Otten <__pete...@web.de> wrote:
> Ian Kelly wrote:
>> That surprises me also, but I suspect it's because they're
>> subdirectories of the current working directory rather than packages
>> found on the sys.path.
>
> So even the experts cannot keep up with all t
Ian Kelly wrote:
> On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
>> That makes me wonder if, in my project, I can import all modules inside
>> 'start.py', and then just use 'import package_name' inside each module?
>
> You can, but for readability and reuse I think it's better to be
> ex
On Thu, Sep 10, 2015 at 1:12 AM, Frank Millman wrote:
> That makes me wonder if, in my project, I can import all modules inside
> 'start.py', and then just use 'import package_name' inside each module?
You can, but for readability and reuse I think it's better to be
explicit in each module and im
Hi all
My project comprises a number of modules, split into packages. Modules
frequently need to access the contents of other modules, in the same or in a
different package. I am getting better at it, but I still occasionally bump
my head against circular imports, and have to fiddle around unt
On 23/11/2013 12:23, Ed Schofield wrote:
Hi all,
I am the author of the ``future`` package for Python 2/3 compatibility
(http://python-future.org). A bug report has recently been posted about its use
of import hooks that I don't yet have an answer for, and I am looking for some
guidance on ho
Hi all,
I am the author of the ``future`` package for Python 2/3 compatibility
(http://python-future.org). A bug report has recently been posted about its use
of import hooks that I don't yet have an answer for, and I am looking for some
guidance on how to customize the import mechanism in a s
Hi,
I'm a brand new Python 2.7 user, attempting to use it to convert a raster
file to an ASCII file. I used ArcGis9.3 to create the raster file. My code
begins with the line
>>import arcgisscripting
However, Python gives an error message "ImportError: DLL load failed: The
specified module could
On Jun 11, 1:45 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Is it cursed upon? Didn't know that.
I didn't either. Until I asked some people how to do it, and was
admonished for even suggesting the concept.
> However, __import__ only gives you the topmost module - in your case myapp.
ah,
Jonathan Vanasco schrieb:
I'm a little unclear about import / __import__
I'm exploring dynamically importing modules for a project, and ran
into this behavior
works as expected:
app = __import__( myapp )
appModel = __import__( myapp.model )
but...
appname= 'myapp'
app = __impor
I'm a little unclear about import / __import__
I'm exploring dynamically importing modules for a project, and ran
into this behavior
works as expected:
app = __import__( myapp )
appModel = __import__( myapp.model )
but...
appname= 'myapp'
app = __import__( "%s" % appname )
ap
On Sat, Apr 26, 2008 at 4:14 AM, Gabriel Genellina
<[EMAIL PROTECTED]> wrote:
> The short answer is: don't do that! __init__.py may import any module, but
> other modules in the package should not import anything from __init__.py
> The same rule applies to the main module in an application: it ca
En Fri, 25 Apr 2008 15:03:18 -0300, Luca <[EMAIL PROTECTED]> escribió:
Hi all. I'm trying to do something with python import but isn't working
for me.
Using python 2,5 I've a program structured like this:
* a main module called (for example) "mommy" with an __init__.py and a
file called "mom
On 25 Apr., 20:03, Luca <[EMAIL PROTECTED]> wrote:
> Hi all. I'm trying to do something with python import but isn't working for
> me.
>
> Using python 2,5 I've a program structured like this:
>
> * a main module called (for example) "mommy" with an __init__.py and a
> file called "mommy.py"
> * a
Luca wrote:
Hi all. I'm trying to do something with python import but isn't working for me.
Using python 2,5 I've a program structured like this:
* a main module called (for example) "mommy" with an __init__.py and a
file called "mommy.py"
* a __version__ var defined inside the main __init__.py
Hi all. I'm trying to do something with python import but isn't working for me.
Using python 2,5 I've a program structured like this:
* a main module called (for example) "mommy" with an __init__.py and a
file called "mommy.py"
* a __version__ var defined inside the main __init__.py
>From the mo
Frank Millman wrote:
> One small point. The docs have the following warning -
>
> "Important: the caller is responsible for closing the file argument, if
> it was not None, even when an exception is raised. This is best done
> using a try ... finally statement. "
>
> I have added this to my code.
Rob Wolfe wrote:
> Frank Millman wrote:
> > Hi all
> >
> > However, I want the ability to have duplicate program names stored in
> > different subdirectories. At the time of selecting the menu option I
> > know which company is active, so I know which directory I want to run
> > the program from,
Frank Millman wrote:
> Hi all
>
> I am writing a business/accounting application. Once a user has logged
> in they are presented with a menu. Each menu option has a description
> and an associated file name and program name. The file name is the name
> of a .py file (impName) and the program name
Hi all
I am writing a business/accounting application. Once a user has logged
in they are presented with a menu. Each menu option has a description
and an associated file name and program name. The file name is the name
of a .py file (impName) and the program name is the name of a class in
that fi
Ok, thanks again. That was helpful.
--
http://mail.python.org/mailman/listinfo/python-list
In <[EMAIL PROTECTED]>, jdemoor wrote:
>> from module import *
>> import module
>>
>> as these kinds of import are not mutually exclusive.
>
> Would this run the code in 'module' twice, or just make the objects in
> it accessible by several names ?
The code at module level is only executed at fi
[EMAIL PROTECTED] wrote:
> Thanks for the replies.
>
>> You can do both
>>
>> from module import *
>> import module
>>
>> as these kinds of import are not mutually exclusive.
>
> Would this run the code in 'module' twice, or just make the objects in
> it accessible by several names ?
The latter
Thanks for the replies.
> You can do both
>
> from module import *
> import module
>
> as these kinds of import are not mutually exclusive.
Would this run the code in 'module' twice, or just make the objects in
it accessible by several names ?
--
http://mail.python.org/mailman/listinfo/python-l
[EMAIL PROTECTED] wrote:
> I'm new to Python and have the following problem :
> I have an application started by a main.py file, which does a ' from
> module_1 import * '.
> main.py is responsible from the creation of an object which is then
> used in module_1.
> What is the best way to make that
In <[EMAIL PROTECTED]>, jdemoor wrote:
> I have an application started by a main.py file, which does a ' from
> module_1 import * '.
> main.py is responsible from the creation of an object which is then
> used in module_1.
> What is the best way to make that object visible in the module_1
> namesp
Hi,
I'm new to Python and have the following problem :
I have an application started by a main.py file, which does a ' from
module_1 import * '.
main.py is responsible from the creation of an object which is then
used in module_1.
What is the best way to make that object visible in the module_1
na
<[EMAIL PROTECTED]> wrote:
> do i need to download tools.pyc ?
Python doesn't have any "tools" module builtin. So, what tool is?
--
Lawrence - http://www.oluyede.org/blog
"Nothing is more dangerous than an idea
if it's the only one you have" - E. A. Chartier
--
http://mail.python.org/mailman/l
On Sunday 20 August 2006 21:39, [EMAIL PROTECTED] wrote:
> i have just downloas python and trying to import tools module
>
> C:\Documents and Settings\toto>python
> Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v
> Type "help", "copyright", "credits" or "license"
>
> >>> import tools
>
> Traceback
i have just downloas python and trying to import tools module
C:\Documents and Settings\toto>python
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v
Type "help", "copyright", "credits" or "license"
>>> import tools
Traceback (most recent call last):
File "", line 1, in ?
ImportError: No module nam
34 matches
Mail list logo