On Thu, 05 Feb 2009 03:32:59 -, Vincent Davis
wrote:
"The problem is you seem to be thinking in terms of objects having names.
They don't. Names have objects."I agree this is my problem. This is not
correct terminology then?
The name of the object is anobject
No. The name of the objec
Hendrik van Rooyen wrote:
> "MRAB" wrote:
>
>> The actual names of the variables and functions shouldn't matter to the
>> outside world; the name of an output file shouldn't depend on the name
>> of a variable.
>
> That is a matter of opinion.
> It is however, an interesting problem, namely:
>
>
Hi,
Vincent Davis wrote:
Sorry for not being clear
I would have something like this
x = [1, 2, 3,5 ,6 ,9,234]
Then
def savedata(dataname): ..
savedata(x)
this would save a to a file called x.csv This is my problem, getting the
name to be x.csv which is the same as the name of the lis
"MRAB" wrote:
> The actual names of the variables and functions shouldn't matter to the
> outside world; the name of an output file shouldn't depend on the name
> of a variable.
That is a matter of opinion.
It is however, an interesting problem, namely:
How does one get hold of the actual nam
In article ,
Rhodri James wrote:
>
>Fundamentally, the concept of a single unique name for any object isn't
>something built into the language (or, indeed, most languages I can think
>of). An object can have no names (though it'll promptly get garbage
>collected if it isn't assigned to a name som
On Thu, Feb 5, 2009 at 2:37 PM, Vincent Davis wrote:
> Jervis Whitley wrote "Although you should really solve your problem by
> thinking about it
> from a completely different angle, maybe subclassing your datatype and
> adding a 'name'
> attribute ? I'm sure some of the others here have suggested
Jervis Whitley wrote "Although you should really solve your problem by
thinking about it
from a completely different angle, maybe subclassing your datatype and
adding a 'name'
attribute ? I'm sure some of the others here have suggested that already."
That is beyond my current knowledge. Any suggest
"The problem is you seem to be thinking in terms of objects having names.
They don't. Names have objects."I agree this is my problem. This is not
correct terminology then?
The name of the object is anobject
Let me give another example and let me know if I am just beating a dead
horse.
In my curr
On Thu, Feb 5, 2009 at 3:57 AM, Vincent Davis wrote:
> Sorry for not being clear
> I would have something like this
> x = [1, 2, 3,5 ,6 ,9,234]
> Then
> def savedata(dataname): ..
>
> savedata(x)
> this would save a to a file called x.csv This is my problem, getting the
> name to be x.csv
On Thu, 05 Feb 2009 01:36:17 -, Vincent Davis
wrote:
if I start with
M = [1,3,5,7]
M is [1,3,5,7]
This seems one way, as [1,3,5,7] is not M in the sense that there is
no operation I can preform on [1,3,5,7] and get M back. Other than
asking/testing M==[1,3,5,7]
Correct. If you actually
My argument comes down to; we use M so we don't have to type
[1,3,5,7], I realize that this is in part because we might not no what
M will be.
This is starting to sound like double talk on my part, I have only
been programing in python for 2 weeks so my credibility is only that
of an outside that
if I start with
M = [1,3,5,7]
M is [1,3,5,7]
This seems one way, as [1,3,5,7] is not M in the sense that there is
no operation I can preform on [1,3,5,7] and get M back. Other than
asking/testing M==[1,3,5,7]
This seems fine to me. but when I savedata(M) it seems I should be
able to refer to both [
On Wed, 04 Feb 2009 17:23:55 -, Vincent Davis
wrote:
I guess what I am saying is that it does not seem like I am adding any
information that is not already there when I have to enter that list and
list name after all they are the same.
Thanks
But you are. Consider just for a moment wha
Vincent Davis wrote:
I guess what I am saying is that it does not seem like I am adding
any information that is not already there when I have to enter that
list and list name after all they are the same.
If you write:
y = x
then both x and y refer to the same list.
The actual names of the va
can I do it the otherway, that issavedata('nameoflist')
for limited cases where your variable is defined globally, you
can use:
>>> a = [1,2,3,4]
>>> def save(s):
... print globals().get(s, "UNDEFINED")
...
>>> save("a")
[1, 2, 3, 4]
>>> save("b")
UNDEFINED
>>> b = (6,5,
I know nothing but that sucks. I can think of a lot of times I would like to
do something similar. There really is no way to do this, it seems like there
would be some simple way kind of like str(listname) but backwards or
different.
Python does the only reasonable thing: doesn't give you acces
can I do it the otherway, that issavedata('nameoflist')
Thanks
Vincent Davis
720-301-3003
On Wed, Feb 4, 2009 at 10:23 AM, Vincent Davis wrote:
> I guess what I am saying is that it does not seem like I am adding any
> information that is not already there when I have to enter that list and
>
I guess what I am saying is that it does not seem like I am adding any
information that is not already there when I have to enter that list and
list name after all they are the same.
Thanks
Vincent Davis
On Wed, Feb 4, 2009 at 10:18 AM, Vincent Davis wrote:
> I know nothing but that sucks. I ca
I know nothing but that sucks. I can think of a lot of times I would like to
do something similar. There really is no way to do this, it seems like there
would be some simple way kind of like str(listname) but backwards or
different.
Thanks
Vincent Davis
On Wed, Feb 4, 2009 at 10:07 AM, MRAB wr
Vincent Davis wrote:
> Sorry for not being clear I would have something like this x = [1, 2,
> 3,5 ,6 ,9,234]
>
> Then def savedata(dataname): ..
>
> savedata(x)
>
> this would save a to a file called x.csv This is my problem, getting
> the name to be x.csv which is the same as the name of
Sorry for not being clearI would have something like this
x = [1, 2, 3,5 ,6 ,9,234]
Then
def savedata(dataname): ..
savedata(x)
this would save a to a file called x.csv This is my problem, getting the
name to be x.csv which is the same as the name of the list.
and the data in the file w
I know this is wrong it uses the items in the list as the filename,
how do I refer to the dataname and not the items in it.
Without a sample value for "dataname", it's hard to tell what
you're trying to do. Do you mean
dataname = ['path', 'to', 'file']
...
filename = os.sep.join(datana
Vincent Davis wrote:
> Do to laking knowledge my google searches have not turned up an answer for me.
> I know this is wrong it uses the items in the list as the filename,
> how do I refer to the dataname and not the items in it.
>
> def savedata(dataname):
> filename = str(dataname) # this do
Do to laking knowledge my google searches have not turned up an answer for me.
I know this is wrong it uses the items in the list as the filename,
how do I refer to the dataname and not the items in it.
def savedata(dataname):
filename = str(dataname) # this does not do what I would like it t
24 matches
Mail list logo