Thank you for your reply.
I tried methods that webpage mentioned.
Unfortunately, both __file__ and sys.argv[0] didn't work in the paraview python 
environment.
Do I need to import some modules to use __file__?


----------------------------------------
> Date: Sun, 8 Sep 2013 15:54:54 -0400
> Subject: Re: [Paraview] python script path
> From: [email protected]
> To: [email protected]
> CC: [email protected]
>
> Check this out: 
> http://stackoverflow.com/questions/595305/python-path-of-script
>
>
>
> On Sat, Sep 7, 2013 at 10:09 PM, qe qe <[email protected]> wrote:
>> Is there a way to find the path of the a running python script?
>> I'm trying to get it from __file__ or sys.argv[0].
>> But both of them give errors.
>> When I tried __file__, it says __file__ is not defined.
>> When i tried sys.argv[0], it says 'module' object has no attribute 'argv'.
>>
>> Thanks,
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at 
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ParaView Wiki at: 
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview                            
>>            
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to