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'









share|improve this question




















  • 1




    im is a tuple: im = (), Why do you think you have a save() method?
    – eyllanesc
    Nov 10 at 21:41








  • 3




    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












  • 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

















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'









share|improve this question




















  • 1




    im is a tuple: im = (), Why do you think you have a save() method?
    – eyllanesc
    Nov 10 at 21:41








  • 3




    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












  • 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















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'









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 a save() method?
    – eyllanesc
    Nov 10 at 21:41








  • 3




    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












  • 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
















  • 1




    im is a tuple: im = (), Why do you think you have a save() method?
    – eyllanesc
    Nov 10 at 21:41








  • 3




    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












  • 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










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



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python