Deformed Form

Dave Angel davea at ieee.org
Fri Jun 11 14:44:30 EDT 2010


Victor Subervi wrote:
> On Fri, Jun 11, 2010 at 12:24 PM, Stephen Hansen
> <me+list/python at ixokai.io>wrote:
>
>   
>> Sure, if you have some file that two separate scripts import, and in
>> said file you generate some value-- as long as that value will be the
>> same at all times, it'll appear that the two scripts are sharing some
>> state. They are not, however. The two scripts can not communicate.
>>
>>     
>
> I'm glad you have lots of experience and I respect that. However, I did not
> say that "two separate scripts import said file." To repeat:
>
> 1) variable value generated is
> create_edit_passengers2.py<http://example.com/create_edit_passengers2.py>
> 2) create_edit_passengers2.py<http://example.com/create_edit_passengers2.py>calls
> create_edit_passengers3.py
> <http://example.com/create_edit_passengers2.py>via a <form...> and
> passes the value of the var thereunto.
> 3) theoretically! Yet for some reason I can't call it in
> create_edit_passengers3.py
> <http://example.com/create_edit_passengers2.py>but *can* call it in a
> script that is imported by
> create_edit_passengers3.py <http://example.com/create_edit_passengers2.py>
>
> I think I'm being clear here, am I not? With all your knowledge and
> understanding, I still fail to understand how it is you don't understand and
> cannot answer my question.
>
> <snip>
You could try actually stating something approaching what your code is 
doing.

"variable value generated is create_edit_passengers2.py"   So you're generating that source code, and storing it in some variable called "value"?


"calls create_edit_passengers3.py"   You say you're calling
     create_edit_passengers3.py

but that's not a function, it's a source file.  You can't call a source 
file.

And "passes the value of the var therunto"  is mighty roundabout.  
Assuming you meant "import" in the last part, how are you passing the 
value?  Import doesn't take any parameters.

"script that is imported by".  Nitpick:  a script cannot be imported.  
Once it is, it's a module.

"for some reason I can't call it in create_edit_passengers3.py"  No idea 
what "it" refers to, is it some mythical script that you're still trying 
to call?

Your problem could be circular imports.  If one module imports another, 
which directly or indirectly imports the first, you can get into various 
trouble.  If somebody imports the *script* you're definitely hosed, 
since there will then be two instances of that one, the script, and the 
module.


Maybe it's all clear if one looks at those files, but from here the 
links seem broken.  So I'm just going by your message, which is 
confusing.  I suggest you construct a simple example to show the 
problem, one small enough to include here in its entirety.  Then 
describe it in proper Python terminology.

DaveA




More information about the Python-list mailing list