Kent Johnson schrieb:
> [EMAIL PROTECTED] wrote:
>
>> in dgf.py: (hope the formatting gets good for you, t-bird breaks the
>> lines badly on my machine...)
>>
>> def csvwriter(*column_definitions):
>> """Edit Me!"""
>> if sys.argv[0] == /usr/local/bin/xyz.py:
>> output_c
[EMAIL PROTECTED] wrote:
> in dgf.py: (hope the formatting gets good for you, t-bird breaks the
> lines badly on my machine...)
>
> def csvwriter(*column_definitions):
> """Edit Me!"""
> if sys.argv[0] == /usr/local/bin/xyz.py:
> output_csv_filename = "xyz.csv"
>
Jeff Younker schrieb:
>
> Telling us your goal might allow us to recommend a better
> and faster way of accomplishing it.
>
> - Jeff Younker - [EMAIL PROTECTED] -
>
>
>
in dgf.py: (hope the formatting gets good for you, t-bird breaks the
lines badly on my machine...)
def csvwriter(*column_d
On Mar 7, 2008, at 6:04 AM, [EMAIL PROTECTED] wrote:
> Kent Johnson schrieb:
>>
>> Why do you need to do this? It sounds like a design change is needed.
>> Anyway the answer to your question is yes. This recipe should point
>> you
>> in the right direction:
>> http://aspn.activestate.com/ASPN/Co
There are basically a number of things you might want:
1.) sys.argv[0]
2.) __main__.__file__
3.) sys._getframe
The first two will tell which script is the main program. The last one
will tell you which function has called you.
But as Kent has pointed out, this is rarely a good idea. Actually, it
Kent Johnson schrieb:
> [EMAIL PROTECTED] wrote:
>> Hello Tutor!
>>
>> I am building a couple of scripts to manage a database for our
>> company. The projects name is 'dgf'. As a lot of the functionality is
>> used in more than one of these scripts, I moved this functionality to
>> a module (dgf
[EMAIL PROTECTED] wrote:
> Hello Tutor!
>
> I am building a couple of scripts to manage a database for our company.
> The projects name is 'dgf'. As a lot of the functionality is used in
> more than one of these scripts, I moved this functionality to a module
> (dgf.py). It has several function
Hello Tutor!
I am building a couple of scripts to manage a database for our company.
The projects name is 'dgf'. As a lot of the functionality is used in
more than one of these scripts, I moved this functionality to a module
(dgf.py). It has several functions now.
Question: Is there an easy wa