Re: Importing modules with arguments

2021-07-30 Thread Chris Angelico
On Sat, Jul 31, 2021 at 5:11 AM Charles Smith wrote: > > First off, thanks for the answer. I don't see the cached module as a problem > here. If you provide arguments to a module, the goal is "most likely" to > alter/parameterize the behavior of the first import. Now, I agree that > behavior be

Re: Importing modules with arguments

2021-07-30 Thread Charles Smith
First off, thanks for the answer. I don't see the cached module as a problem here. If you provide arguments to a module, the goal is "most likely" to alter/parameterize the behavior of the first import. Now, I agree that behavior becomes unpredictable because passing different parameters on subs

Re: Importing modules with arguments

2021-07-30 Thread Chris Angelico
On Sat, Jul 31, 2021 at 3:48 AM Charles Smith wrote: > > I have found myself wanting to import module and provide arguments to them. > There's two main reason I could think of for this. First is to prevent a > circular import, though most of circular imports can be prevented by changing > the d

Re: importing modules

2013-07-30 Thread Dave Angel
On 07/29/2013 05:57 PM, syed khalid wrote: I am attempting to import modules from Shogun to python from a non-standard python directory ie from my /home/xxx directory. is there a way on ubuntu to selectively some modules, scripts, data from one directory and others modules, scripts from another

Re: Importing modules into IronPython

2013-07-03 Thread Benjamin Kaplan
On Wed, Jul 3, 2013 at 3:05 PM, HighBeliever wrote: > Hi, I have to shift a Python 2.7 program to run in Windows. Doing that has > forced me to use IronPython because my program is dependent on a .dll file > that uses .NET framework. > > I moved all my code to Iron Python and modified it to work

Re: importing modules dynamicly

2011-01-11 Thread Jean-Michel Pichavant
dubux wrote: I am trying to import modules dynamicly from a directory (modules/) in which i have __init__.py with the __all__ variable set. Everything imports correctly and I have verified this however I am stuck on actually using my classes in the dynamicly imported modules. this bit is in my m

Re: importing modules dynamicly

2011-01-10 Thread Steven D'Aprano
On Mon, 10 Jan 2011 20:42:17 -0800, dubux wrote: > After loading all the modules, i try to do something like: > > instance = modules.modulename.class() No you don't. class is a reserved word in Python, you would get a SyntaxError if you did that. Please post the error you get, including the co

Re: Importing modules from miscellaneous folders

2011-01-05 Thread Benjamin Kaplan
On Wed, Jan 5, 2011 at 8:08 PM, Jshgwave wrote: > > On a Windows PC, I would like to be able to store modules in > topic-specific foldersinstead of in Python26/Lib/site-packages, > and then import into an IPython session those modules and the > functions in them. > > To test this, I have made a to

Re: importing modules from higher level directory

2010-06-26 Thread D'Arcy J.M. Cain
On Sat, 26 Jun 2010 11:10:06 +0200 Thomas Jollans wrote: > Also, please refrain from top posting. If you are going to berate people for bad netiquette you should learn it too. Please trim your included text. You included the entire rest of the OP's message including his signature after your res

Re: importing modules from higher level directory

2010-06-26 Thread Thomas Jollans
On 06/26/2010 01:35 AM, Tom Pacheco wrote: > from .. import module > or > from ..module import foo > > this is intended for use within packages. And it only works within nested packages. Also, please refrain from top posting. > > see > http://www.python.org/dev/peps/pep-0328/ > > also search

Re: importing modules from higher level directory

2010-06-25 Thread Tom Pacheco
from .. import module or from ..module import foo this is intended for use within packages. see http://www.python.org/dev/peps/pep-0328/ also search for python relative import - tom Nathan Huesken wrote: Hi, Is it somehow possible to import modules from *.py files in a higher level directo

Re: importing modules from higher level directory

2010-06-25 Thread Emile van Sebille
On 6/25/2010 2:20 PM Nathan Huesken said... Hi, Is it somehow possible to import modules from *.py files in a higher level directory? Intuitively I would do import ../module but that does not work. How does it work? IIRC, sys.path controls the search order. You could insert your preferred

Re: importing modules from higher level directory

2010-06-25 Thread Nathan Rice
Add the parent directory to your sys.path... On Fri, Jun 25, 2010 at 5:20 PM, Nathan Huesken wrote: > Hi, > > Is it somehow possible to import modules from *.py files in a higher > level directory? > Intuitively I would do > > import ../module > > but that does not work. > How does it work? > > T

Re: Importing modules

2010-06-07 Thread Dan Stromberg
On Sun, Jun 6, 2010 at 8:16 PM, Ben Finney > wrote: > Anthony Papillion writes: > > > import os > > > > os.path.append('$HOME/gsutils/boto') > > > > thinking I could then successfully do the import boto statement. > > Nope. > > You'll need to give the literal path. Substitution of environment >

Re: Importing modules

2010-06-07 Thread Anthony Papillion
On Jun 6, 10:16 pm, Ben Finney wrote: > Anthony Papillion writes: > > import os > > > os.path.append('$HOME/gsutils/boto') > > > thinking I could then successfully do the import boto statement. > > Nope. > > You'll need to give the literal path. Substitution of environment > variables isn't perfo

Re: Importing modules

2010-06-06 Thread Chris Rebert
On Sun, Jun 6, 2010 at 10:25 PM, Anthony Papillion wrote: > On Jun 6, 10:33 pm, Chris Rebert wrote: >> On Sun, Jun 6, 2010 at 8:16 PM, Ben Finney >> wrote: >> > Anthony Papillion writes: >> >> >> import os >> >> >> os.path.append('$HOME/gsutils/boto') >> >> >> thinking I could then successfull

Re: Importing modules

2010-06-06 Thread Anthony Papillion
On Jun 6, 10:33 pm, Chris Rebert wrote: > On Sun, Jun 6, 2010 at 8:16 PM, Ben Finney wrote: > > Anthony Papillion writes: > > >> import os > > >> os.path.append('$HOME/gsutils/boto') > > >> thinking I could then successfully do the import boto statement. > >> Nope. > > > You'll need to give the

Re: Importing modules

2010-06-06 Thread Chris Rebert
On Sun, Jun 6, 2010 at 8:16 PM, Ben Finney wrote: > Anthony Papillion writes: > >> import os >> >> os.path.append('$HOME/gsutils/boto') >> >> thinking I could then successfully do the import boto statement. >> Nope. > > You'll need to give the literal path. Substitution of environment > variables

Re: Importing modules

2010-06-06 Thread Ben Finney
Anthony Papillion writes: > import os > > os.path.append('$HOME/gsutils/boto') > > thinking I could then successfully do the import boto statement. > Nope. You'll need to give the literal path. Substitution of environment variables isn't performed implicitly in strings. -- \ “When we

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something l

Re: importing modules

2010-05-07 Thread Richard Lamboj
Am Friday 07 May 2010 13:50:15 schrieb Jean-Michel Pichavant: > Richard Lamboj wrote: > > Hello, > > > > I have a question about importing python modules. > > > > I have modul package, with submodules. So how can a submodul access a > > modul that is on level upper? > > > > Is there something lik

Re: importing modules

2010-05-07 Thread Jean-Michel Pichavant
Richard Lamboj wrote: Hello, I have a question about importing python modules. I have modul package, with submodules. So how can a submodul access a modul that is on level upper? Is there something like "import ../../blah"? I don't mean something like this: "import bla.blub.moep" Kind Re

Re: importing modules

2010-05-07 Thread Andi Albrecht
Richard Lamboj schrieb: > > Hello, > > I have a question about importing python modules. > > I have modul package, with submodules. So how can a submodul access a modul > that is on level upper? > > Is there something like "import ../../blah"? I don't mean something like > this: "import bla.blu

Re: importing modules

2010-05-07 Thread Alex Hall
I have a main folder. Inside that I have a "modes" package (subfolder holding __init__.py) as well as a "misc" package. When modes has to import helpers.py from misc, I use this: from .misc import helpers The period makes Python look up one level for misc, then go into it to find helpers. On 5/7/1

Re: Importing modules

2010-03-19 Thread Dave Angel
Peyman Askari wrote: I want to write a function which imports modules the first time, and reloads them afterwards, but I am running into problems with global variables and exec. I will include a full script, but let me elaborate first. Essentially what you need is def import_or_reload(): "

Re: importing modules from subdirs

2010-03-11 Thread Alex Hall
Halfway there. It imports now, but it says that the module does not have functions which I know it does have. I will just leave it all in one folder for now and play with organization after I get the project working better. On 3/11/10, Steve Holden wrote: > Alex Hall wrote: >> Hi all, >> The manu

Re: importing modules from subdirs

2010-03-11 Thread Steve Holden
Alex Hall wrote: > Hi all, > The manual says, for modules in a project stored in subdirectories, you can > do: > import folderName.module > > I have a couple questions, though: > 1. Do I then have to call functions from module like > folder.module.function, or can I still use the normal module.fu

Re: importing modules from subdirs

2010-03-11 Thread Gary Herron
Alex Hall wrote: Hi all, The manual says, for modules in a project stored in subdirectories, you can do: import folderName.module I have a couple questions, though: 1. Do I then have to call functions from module like folder.module.function, or can I still use the normal module.function? Ei

Re: Importing Modules

2010-03-10 Thread Gabriel Genellina
En Wed, 10 Mar 2010 09:19:29 -0300, PEYMAN ASKARI escribió: I wanted to know if imported classes are treated differently than internal classes. If by 'internal classes' you mean 'classes defined in the main module', no, they're absolutely the same. class A(): __init__(self): pass and c

Re: Importing Modules

2010-03-10 Thread Terry Reedy
On 3/10/2010 7:19 AM, PEYMAN ASKARI wrote: Hello I frequent the PyGtk mailing list all the time, but this is the first time I am posting here =) I wanted to know if imported classes are treated differently than internal classes. I have attached a minimal example which points out what I mean. E

Re: Importing modules

2009-05-01 Thread Terry Reedy
norseman wrote: OH - something you mentioned that didn't seem to be addressed. import - load a complete library from - obtain specific 'function'(s) from a library from can also be used to get a specific module from a package If you 'import pack.mod', then you have to write 'pack.mod.ob' to

Re: Importing modules

2009-05-01 Thread norseman
Gabriel Genellina wrote: En Thu, 30 Apr 2009 14:33:38 -0300, Jim Carlock escribió: I'm messing around with a program right at the moment. It ends up as two applications, one runs as a server and one as a client which presents a Window. It almost works, so I need to work through it to work out i

Re: Importing modules

2009-04-30 Thread Gabriel Genellina
En Thu, 30 Apr 2009 14:33:38 -0300, Jim Carlock escribió: I'm messing around with a program right at the moment. It ends up as two applications, one runs as a server and one as a client which presents a Window. It almost works, so I need to work through it to work out it's bugs, and I'll be rewr

Re: Importing modules

2009-01-30 Thread rdmurray
Quoth Mudcat : > [attribution omitted by Mudcat] > > I think you've probably had issues with circular imports (i.e. mutual > > dependencies), unless you can precisely remember what you were doing and > > what went wrong. > > That's possible, but circular imports become more of a hazard if you > hav

Re: Importing modules

2009-01-30 Thread Aahz
In article <631e2879-6171-417e-8254-7f78c8cfc...@i24g2000prf.googlegroups.com>, alex23 wrote: > >If you're having to set up your imports in a specific order, odds are >you have either a circular dependency or are overusing 'from >import *'. You should -never- (IMO) do something like 'from librar

Re: Importing modules

2009-01-21 Thread Mudcat
On Jan 21, 11:29 am, alex23 wrote: > Well, you can always stick those imports into a 'common.py' and do > 'from common import *' in each file that uses them. But doing so can > be a pain to maintain and debug for anything more than the most simple > of applications. Being able to see a module's d

Re: Importing modules

2009-01-21 Thread Mudcat
> I think you've probably had issues with circular imports (i.e. mutual > dependencies), unless you can precisely remember what you were doing and > what went wrong. That's possible, but circular imports become more of a hazard if you have to import in several locations. Unify that to one file, an

Re: Importing modules

2009-01-21 Thread alex23
On Jan 22, 1:45 am, Mudcat wrote: > This is something I've wondered about for a while. I know that > theoretically Python is supposed to auto-recognize duplicate imports; > however I've run into problems in the past if I didn't arrange the > imports in a certain way across multiple files. As a res

Re: Importing modules

2009-01-21 Thread Marco Mariani
Mudcat wrote: This is something I've wondered about for a while. I know that theoretically Python is supposed to auto-recognize duplicate imports; however I've run into problems in the past if I didn't arrange the imports in a certain way across multiple files. I think you've probably had issu

Re: Importing modules

2009-01-21 Thread Mudcat
This is something I've wondered about for a while. I know that theoretically Python is supposed to auto-recognize duplicate imports; however I've run into problems in the past if I didn't arrange the imports in a certain way across multiple files. As a result, I worry about conflicts that arise bec

Re: Importing modules

2009-01-07 Thread Mel
Steve Holden wrote: > e4m...@gmail.com wrote: [ ... ] >> Could someone point me to some docs that explain the Python way of >> loading modules when breaking old, big (everything in one script) into >> more manageable modular scripts? >> > Import each module into every other module that requires i

Re: Importing modules

2009-01-07 Thread Paul McGuire
...and don't worry about a possible performance issue of importing os (or any other module) multiple times - the Python import manager is smart enough to recognize previously imported modules, and wont import them again. If a module uses the os module, then it should import it - that's just it. A

Re: Importing modules

2009-01-07 Thread Steve Holden
e4m...@gmail.com wrote: > Coming from a scripting background where we used to write everything > into one script, I'm now going modular with Python. I place related > functions in one module, and other functions in other modules. > > This all works OK, but I'm a bit confused about importing module

Re: Importing modules

2009-01-07 Thread Diez B. Roggisch
e4m...@gmail.com wrote: > Coming from a scripting background where we used to write everything > into one script, I'm now going modular with Python. I place related > functions in one module, and other functions in other modules. > > This all works OK, but I'm a bit confused about importing modul

Re: Importing modules in embedded Python

2008-07-02 Thread Marcin Krol
OK I found the answer in yet another Google search, right after I gave up and posted here - turns out in order to import dynamically linked modules, one has to pass -E argument to the linker. Exception exceptions.ImportError: '/usr/lib/python2.4/lib-dynload/timemodule.so: undefined symbol: Py

Re: importing modules question

2007-10-18 Thread Amit Khemka
On 10/18/07, warhero <[EMAIL PROTECTED]> wrote: > Hey all, sorry for the totally newb question. I recently switched over > to python from ruby. I'm having problems figuring out how module > importing works.. as a simple example I've got these files: > > /example/loader.py > /example/loadee.py > > l

Re: importing modules question

2007-10-17 Thread warhero
got it figured out. nevermind. -- http://mail.python.org/mailman/listinfo/python-list

Re: re-importing modules

2007-05-01 Thread Chris Mellon
On 5/1/07, John Nagle <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > I'd hate for reload to disappear, it is great for interactive > > development/debugging, at least under some circumstances. (If you have > > complex and tangled class hierarchies, it might not be powerful enough.) > > > >

Re: re-importing modules

2007-05-01 Thread [EMAIL PROTECTED]
John Nagle wrote: > Steven D'Aprano wrote: > > I'd hate for reload to disappear, it is great for interactive > > development/debugging, at least under some circumstances. (If you have > > complex and tangled class hierarchies, it might not be powerful enough.) > > > > As for the semantics being awf

RE: re-importing modules

2007-05-01 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of John Nagle > Sent: Monday, April 30, 2007 7:32 PM > To: python-list@python.org > Subject: Re: re-importing modules > > [EMAIL PROTECTED] wrote: > > >>In

Re: re-importing modules

2007-04-30 Thread John Nagle
Graham Dumpleton wrote: > On May 1, 3:51 pm, Paul Rubin wrote: > >>Graham Dumpleton <[EMAIL PROTECTED]> writes: >> >>>That it doesn't reload a parent when a child changes may be fine in an >>>interactive debugger, but can cause problems if not done where >>>automatic rel

Re: re-importing modules

2007-04-30 Thread Graham Dumpleton
On May 1, 3:51 pm, Paul Rubin wrote: > Graham Dumpleton <[EMAIL PROTECTED]> writes: > > That it doesn't reload a parent when a child changes may be fine in an > > interactive debugger, but can cause problems if not done where > > automatic reloading is being done in a lon

Re: re-importing modules

2007-04-30 Thread Paul Rubin
Graham Dumpleton <[EMAIL PROTECTED]> writes: > That it doesn't reload a parent when a child changes may be fine in an > interactive debugger, but can cause problems if not done where > automatic reloading is being done in a long running web application > where you want to avoid server restarts. O

Re: re-importing modules

2007-04-30 Thread Graham Dumpleton
On May 1, 2:17 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 01 May 2007 00:32:20 +, John Nagle wrote: > > [EMAIL PROTECTED] wrote: > > >>>In addition to the warning that reload() does not recursively reload > >>>modules that the reloaded module depends on, be warned that reloading a

Re: re-importing modules

2007-04-30 Thread John Nagle
Steven D'Aprano wrote: > I'd hate for reload to disappear, it is great for interactive > development/debugging, at least under some circumstances. (If you have > complex and tangled class hierarchies, it might not be powerful enough.) > > As for the semantics being awful, I disagree. reload() does

Re: re-importing modules

2007-04-30 Thread Steven D'Aprano
On Tue, 01 May 2007 00:32:20 +, John Nagle wrote: > [EMAIL PROTECTED] wrote: > >>>In addition to the warning that reload() does not recursively reload >>>modules that the reloaded module depends on, be warned that reloading a >>>module does not magically affect any functions or objects from t

Re: re-importing modules

2007-04-30 Thread John Nagle
Gabriel Genellina wrote: > En Mon, 30 Apr 2007 21:32:20 -0300, John Nagle <[EMAIL PROTECTED]> > escribió: > >> [EMAIL PROTECTED] wrote: >> In addition to the warning that reload() does not recursively reload modules that the reloaded module depends on, be warned that reloading a m

Re: re-importing modules

2007-04-30 Thread Gabriel Genellina
En Mon, 30 Apr 2007 21:32:20 -0300, John Nagle <[EMAIL PROTECTED]> escribió: > [EMAIL PROTECTED] wrote: > >>> In addition to the warning that reload() does not recursively reload >>> modules that the reloaded module depends on, be warned that reloading a >>> module does not magically affect any

Re: re-importing modules

2007-04-30 Thread John Nagle
[EMAIL PROTECTED] wrote: >>In addition to the warning that reload() does not recursively reload >>modules that the reloaded module depends on, be warned that reloading a >>module does not magically affect any functions or objects from the old >>version that you may be holding on to. Maybe rel

Re: re-importing modules

2007-04-30 Thread kyosohma
On Apr 30, 3:00 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Mon, 2007-04-30 at 12:44 -0700, [EMAIL PROTECTED] wrote: > > On Apr 30, 12:49 pm, "T. Crane" <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > When troubleshooting code that's saved in a text file, I often find that I > > > want to make a

Re: re-importing modules

2007-04-30 Thread Carsten Haese
On Mon, 2007-04-30 at 12:44 -0700, [EMAIL PROTECTED] wrote: > On Apr 30, 12:49 pm, "T. Crane" <[EMAIL PROTECTED]> wrote: > > Hi, > > > > When troubleshooting code that's saved in a text file, I often find that I > > want to make a change to it, re-save it, then reimport it. However, just > > typin

Re: re-importing modules

2007-04-30 Thread kyosohma
On Apr 30, 12:49 pm, "T. Crane" <[EMAIL PROTECTED]> wrote: > Hi, > > When troubleshooting code that's saved in a text file, I often find that I > want to make a change to it, re-save it, then reimport it. However, just > typing > > import myTestCode > > doesn't always seem to import the newer vers

re-importing modules

2007-04-30 Thread T. Crane
Hi, When troubleshooting code that's saved in a text file, I often find that I want to make a change to it, re-save it, then reimport it. However, just typing import myTestCode doesn't always seem to import the newer version. Is it supposed to? I find that right now I often have to close my i

RE: Importing modules through directory shortcuts on Windows

2006-04-28 Thread Tim Golden
[Roger Upole] | [... snipped ugly code ...] Thanks; I'll have to find the time to experiment with that a bit. TJG This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more inform

Re: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Roger Upole
Warning: Ugly code ahead import win32con, winioctlcon, winnt import win32file, win32api import os, struct temp_dir=win32api.GetTempPath() temp1=win32api.GetTempFileName(temp_dir,'rpp')[0] win32file.DeleteFile(temp1) os.mkdir(temp1) temp2=win32api.GetTempFileName(temp_dir,'rpp')[0] win32file.Delet

RE: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Tim Golden
[Roger Upole] | You can use win32file.DeviceIoControl to link directories. | I can post some code to do so if anyone's interested. I'd certainly be interested... Thanks TJG This e-mail has been scanned for all viruses by S

Re: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Roger Upole
You can use win32file.DeviceIoControl to link directories. I can post some code to do so if anyone's interested. Roger "Brian Quinlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Recently, I became responsible for maintaining some Python code, which was > organized as f

Re: Importing modules through directory shortcuts on Windows

2006-04-26 Thread Duncan Booth
Brian Quinlan wrote: > Anyway, the problem is that Windows does not have a symlink facility to > accommodate this (AFAIK) and the Python import mechanism does not > resolve shortcuts. Windows does have the equivalent of symlinks provided you are running on NTFS with Windows 2000 or later (Goog

Re: Importing modules through directory shortcuts on Windows

2006-04-26 Thread Thomas Heller
Brian Quinlan wrote: > Recently, I became responsible for maintaining some Python code, which > was organized as follows: > > user/pylib > ui > ... > project2/pylib > ui > ... > project3/pylib > ui > ... > python-packages/user => /user/pylib >

Re: Importing Modules

2005-11-02 Thread Terry Hancock
On Wednesday 02 November 2005 07:23 am, Peter Hansen wrote: > Walter Brunswick wrote: > > The purpose is rather irrelevant. > > The purpose of something is not only relevant but essential when someone > asks for the "best" way to do it. > > For example, without knowing anything of your purpose,

Re: Importing Modules

2005-11-02 Thread Peter Hansen
Walter Brunswick wrote: > The purpose is rather irrelevant. The purpose of something is not only relevant but essential when someone asks for the "best" way to do it. For example, without knowing anything of your purpose, I could simply say that writing a module with a series of import stateme

Re: Importing Modules

2005-11-02 Thread Devan L
Sam Pointon wrote: > On the second point, a combination of sys.path, os.listdir and > __import__ should do what you're after, although sifting through the > whole of sys.path and subfolders from Python, rather than the > interpreter itself, could be slow. (And it'll be redundant as well - > __imp

Re: Importing Modules

2005-11-02 Thread Sam Pointon
On the second point, a combination of sys.path, os.listdir and __import__ should do what you're after, although sifting through the whole of sys.path and subfolders from Python, rather than the interpreter itself, could be slow. (And it'll be redundant as well - __import__ will have do the same th

Re: Importing Modules

2005-11-02 Thread Walter Brunswick
The purpose is rather irrelevant. The modules could be used for an assortment of tasks. By conditionals I mean if the name of a module contains a substring, such as "asdf" (i.e. "asdf" in module) or matches a pattern of some sort, for example, all modules which match the regex "module[\d]+\.py"

Re: Importing Modules

2005-11-02 Thread Peter Hansen
Walter Brunswick wrote: > What is the best way to import all modules in a directory > (and possibly a subdirectory/subdirectories), possibly including > conditionals, such as regexes? The "best" was, as always, depends on what your use case is. Why do you want to do this? What will you do wi

Re: Importing modules

2005-05-14 Thread jmdeschamps
CONTEXT: Trying to modularize (is this english?) application development : MVC style, team distributed so that a visual component can be in one module imported and used by the __main__, and connected (read packed) at runtime to other components coming from the main or other modules. PROBLEM: Afte

Re: Importing modules

2005-05-13 Thread qwweeeit
Hi Fredrik, thank you very much for your articles (especially that on import-confusion). At last I grasped, also if not thorougly, the import mechanism. What cleared my doubts was your recursive import paragraph. In the Guido's "Python Reference Manual" he says: "Import statements are executed in t

Re: Importing modules

2005-05-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Another item (for me...) difficult, is "import modules", and "plenty of > information" (as you said) does not help me much: the mechanism of > variable visibility and namespaces is not clear to me. have you read this http://effbot.org/zone/python-objects.htm and

Re: Importing modules

2005-05-12 Thread qwweeeit
Hi Fredrik, thank you for saying that I am > ... posting silly assertions. I didn't born " Python expert", and I am hardly trying to learn something. I don't like classes but this assertion (silly... I agree) is due to the fact that "I don't understand them well" (I hope to change mind in a near fu

Re: Importing modules

2005-05-12 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > So forgive me if I'm in trouble... Instead of mocking me, the better > should be to give me an brief idea of the import's roll (namespaces, > visibility and so on...) if you're interested in learning stuff, why not spend your time reading up on how things work, rather t

Re: Importing modules

2005-05-12 Thread qwweeeit
Hi all. Steve Holden wrote: > > ... to conflict with the "can't teach an old dog new tricks" ... Excuse my English (also some terms of your replay have no correspondance in my English dictionary...) and my lack of patience (beeing an "old dog" ...). My original request was mainly centered on flo

Re: Importing modules

2005-05-11 Thread Mike Meyer
[EMAIL PROTECTED] writes: > A part the fact that I have not understood the "real" difference > between import and from ... import (or also from... import *), is it > possible to re-build the application in only one chunck? > This is only to better understand the application's structure, in order >

Re: Importing modules

2005-05-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: > Fredrik Lundh ha scritto: > >>[EMAIL PROTECTED] wrote: >> >> >>>To understand a program, however, you need also a flow chart... >> >>so understand a carefully designed modular component structure, you >>have to remove the structure so you can create a flow chart? > > >

Re: Importing modules

2005-05-11 Thread qwweeeit
Fredrik Lundh ha scritto: > [EMAIL PROTECTED] wrote: > > > To understand a program, however, you need also a flow chart... > > so understand a carefully designed modular component structure, you > have to remove the structure so you can create a flow chart? Not everyone is a "guru" like you... I

Re: Importing modules

2005-05-11 Thread George Sakkis
"Fredrik Lundh" wrote : > [EMAIL PROTECTED] wrote: > > > To understand a program, however, you need also a flow chart... > > so understand a carefully designed modular component structure, you > have to remove the structure so you can create a flow chart? > > did you perhaps stumble upon a strange

Re: Importing modules

2005-05-11 Thread Sébastien Boisgérault
[EMAIL PROTECTED] wrote: [...] > In some cases there is a further complication: module importing through > an indirect mechanism, like: exec "from " + xxx + " import *". Don't do that. Please ;). If you need too import some modules based on the module name, stored in a string, consider the using

Re: Importing modules

2005-05-11 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > To understand a program, however, you need also a flow chart... so understand a carefully designed modular component structure, you have to remove the structure so you can create a flow chart? did you perhaps stumble upon a strange man with a keg of liquor back in the