I'm getting an AttributeError for the dot notation .save
up vote
0
down vote
favorite
Not sure why, but the error appears while I'm trying to save the object 'im' to the appropriate file, with a time stamp, in png format.
AttributeErrorTraceback (most recent call last)
<ipython-input-11-c7bc734e5e35> in <module>()
1 if __name__ == '__main__':
----> 2 main()
<ipython-input-2-1ec87a892940> in main()
1 def main():
----> 2 screenGrab()
<ipython-input-5-2819746bf312> in screenGrab()
2 box = ()
3 im = ()
----> 4 im.save(os.getcwd()) + '\full_snap__' + str(int(time.time()) + '.png', 'PNG')
AttributeError: 'tuple' object has no attribute 'save'
python
add a comment |
up vote
0
down vote
favorite
Not sure why, but the error appears while I'm trying to save the object 'im' to the appropriate file, with a time stamp, in png format.
AttributeErrorTraceback (most recent call last)
<ipython-input-11-c7bc734e5e35> in <module>()
1 if __name__ == '__main__':
----> 2 main()
<ipython-input-2-1ec87a892940> in main()
1 def main():
----> 2 screenGrab()
<ipython-input-5-2819746bf312> in screenGrab()
2 box = ()
3 im = ()
----> 4 im.save(os.getcwd()) + '\full_snap__' + str(int(time.time()) + '.png', 'PNG')
AttributeError: 'tuple' object has no attribute 'save'
python
1
im is a tuple:im = ()
, Why do you think you have asave()
method?
– eyllanesc
Nov 10 at 21:41
3
im
is an empty tuple, and a tuple has nosave
method.
– Thierry Lathuille
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
As a side note, make path operations more readable with pathlib andstr.format()
:pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Not sure why, but the error appears while I'm trying to save the object 'im' to the appropriate file, with a time stamp, in png format.
AttributeErrorTraceback (most recent call last)
<ipython-input-11-c7bc734e5e35> in <module>()
1 if __name__ == '__main__':
----> 2 main()
<ipython-input-2-1ec87a892940> in main()
1 def main():
----> 2 screenGrab()
<ipython-input-5-2819746bf312> in screenGrab()
2 box = ()
3 im = ()
----> 4 im.save(os.getcwd()) + '\full_snap__' + str(int(time.time()) + '.png', 'PNG')
AttributeError: 'tuple' object has no attribute 'save'
python
Not sure why, but the error appears while I'm trying to save the object 'im' to the appropriate file, with a time stamp, in png format.
AttributeErrorTraceback (most recent call last)
<ipython-input-11-c7bc734e5e35> in <module>()
1 if __name__ == '__main__':
----> 2 main()
<ipython-input-2-1ec87a892940> in main()
1 def main():
----> 2 screenGrab()
<ipython-input-5-2819746bf312> in screenGrab()
2 box = ()
3 im = ()
----> 4 im.save(os.getcwd()) + '\full_snap__' + str(int(time.time()) + '.png', 'PNG')
AttributeError: 'tuple' object has no attribute 'save'
python
python
edited Nov 10 at 21:41
eyllanesc
67.5k82952
67.5k82952
asked Nov 10 at 21:38
Estlin P. Goossen
1
1
1
im is a tuple:im = ()
, Why do you think you have asave()
method?
– eyllanesc
Nov 10 at 21:41
3
im
is an empty tuple, and a tuple has nosave
method.
– Thierry Lathuille
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
As a side note, make path operations more readable with pathlib andstr.format()
:pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18
add a comment |
1
im is a tuple:im = ()
, Why do you think you have asave()
method?
– eyllanesc
Nov 10 at 21:41
3
im
is an empty tuple, and a tuple has nosave
method.
– Thierry Lathuille
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
As a side note, make path operations more readable with pathlib andstr.format()
:pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18
1
1
im is a tuple:
im = ()
, Why do you think you have a save()
method?– eyllanesc
Nov 10 at 21:41
im is a tuple:
im = ()
, Why do you think you have a save()
method?– eyllanesc
Nov 10 at 21:41
3
3
im
is an empty tuple, and a tuple has no save
method.– Thierry Lathuille
Nov 10 at 21:41
im
is an empty tuple, and a tuple has no save
method.– Thierry Lathuille
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
As a side note, make path operations more readable with pathlib and
str.format()
: pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
As a side note, make path operations more readable with pathlib and
str.format()
: pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243658%2fim-getting-an-attributeerror-for-the-dot-notation-save%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
im is a tuple:
im = ()
, Why do you think you have asave()
method?– eyllanesc
Nov 10 at 21:41
3
im
is an empty tuple, and a tuple has nosave
method.– Thierry Lathuille
Nov 10 at 21:41
Furthermore the braces are somewhat wrong and I assume you're looking for im.save(os.getcwd() + '\full_snap__' + str(int(time.time())) + '.png', 'PNG')
– quant
Nov 10 at 21:41
As a side note, make path operations more readable with pathlib and
str.format()
:pathlib.Path.cwd() / 'full_snap__{}.png'.format(int(time.time()))
– roeen30
Nov 10 at 21:53
Wow im so stupid I must've deleted part of it im is meant to be: im = ImageGrab.grab() Also, thank you for the note on the operations!
– Estlin P. Goossen
Nov 11 at 0:18