TypeError: process() takes 1 positional argument but 2 were given [duplicate]












0
















This question already has an answer here:




  • TypeError: quit() takes 1 positional argument but 2 were given (keyboard bind)

    2 answers



  • Keyboard Shortcut “Takes 1 positional argument but 2 were given”

    1 answer




So, i'm trying to make a barcode generator. The process() function 'translate' the decimals into 7-bits that EAN-13 barcode use. But i got TypeError instead.



class App(Frame):
encoded =
def __init__(self,master):
Frame.__init__(self,master)

##################
text_1 = Label(self,text='Save Barcode to PS file [eg: EAN13.eps]:')

text_2 = Label(self,text='Enter code (first 12 decimal digits):')

self.file_entry = Entry(self)

self.code_entry = Entry(self)
self.code_entry.bind('<Return>',self.process)
###################
text_1.grid(row = 0, column = 1,columnspan = 3)
self.file_entry.grid(row = 1, column = 1,columnspan = 3)
text_2.grid(row = 2, column = 1,columnspan = 3)
self.code_entry.grid(row = 3, column = 1,columnspan = 3)

def process(self):
num = self.code_entry.get()
checksum = (num[0]+num[2]+num[4]+num[6]+num[8]+num[10])+(3*(num[1]+num[3]+num[5]+num[7]+num[9]+num[11]))
.......


What i get in the end is TypeError in process(), i thought there's only one argument, self.



Where did i go wrong?










share|improve this question













marked as duplicate by Lafexlos, Bryan Oakley python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 15:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

    – Avishay Cohen
    Nov 21 '18 at 15:06
















0
















This question already has an answer here:




  • TypeError: quit() takes 1 positional argument but 2 were given (keyboard bind)

    2 answers



  • Keyboard Shortcut “Takes 1 positional argument but 2 were given”

    1 answer




So, i'm trying to make a barcode generator. The process() function 'translate' the decimals into 7-bits that EAN-13 barcode use. But i got TypeError instead.



class App(Frame):
encoded =
def __init__(self,master):
Frame.__init__(self,master)

##################
text_1 = Label(self,text='Save Barcode to PS file [eg: EAN13.eps]:')

text_2 = Label(self,text='Enter code (first 12 decimal digits):')

self.file_entry = Entry(self)

self.code_entry = Entry(self)
self.code_entry.bind('<Return>',self.process)
###################
text_1.grid(row = 0, column = 1,columnspan = 3)
self.file_entry.grid(row = 1, column = 1,columnspan = 3)
text_2.grid(row = 2, column = 1,columnspan = 3)
self.code_entry.grid(row = 3, column = 1,columnspan = 3)

def process(self):
num = self.code_entry.get()
checksum = (num[0]+num[2]+num[4]+num[6]+num[8]+num[10])+(3*(num[1]+num[3]+num[5]+num[7]+num[9]+num[11]))
.......


What i get in the end is TypeError in process(), i thought there's only one argument, self.



Where did i go wrong?










share|improve this question













marked as duplicate by Lafexlos, Bryan Oakley python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 15:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

    – Avishay Cohen
    Nov 21 '18 at 15:06














0












0








0









This question already has an answer here:




  • TypeError: quit() takes 1 positional argument but 2 were given (keyboard bind)

    2 answers



  • Keyboard Shortcut “Takes 1 positional argument but 2 were given”

    1 answer




So, i'm trying to make a barcode generator. The process() function 'translate' the decimals into 7-bits that EAN-13 barcode use. But i got TypeError instead.



class App(Frame):
encoded =
def __init__(self,master):
Frame.__init__(self,master)

##################
text_1 = Label(self,text='Save Barcode to PS file [eg: EAN13.eps]:')

text_2 = Label(self,text='Enter code (first 12 decimal digits):')

self.file_entry = Entry(self)

self.code_entry = Entry(self)
self.code_entry.bind('<Return>',self.process)
###################
text_1.grid(row = 0, column = 1,columnspan = 3)
self.file_entry.grid(row = 1, column = 1,columnspan = 3)
text_2.grid(row = 2, column = 1,columnspan = 3)
self.code_entry.grid(row = 3, column = 1,columnspan = 3)

def process(self):
num = self.code_entry.get()
checksum = (num[0]+num[2]+num[4]+num[6]+num[8]+num[10])+(3*(num[1]+num[3]+num[5]+num[7]+num[9]+num[11]))
.......


What i get in the end is TypeError in process(), i thought there's only one argument, self.



Where did i go wrong?










share|improve this question















This question already has an answer here:




  • TypeError: quit() takes 1 positional argument but 2 were given (keyboard bind)

    2 answers



  • Keyboard Shortcut “Takes 1 positional argument but 2 were given”

    1 answer




So, i'm trying to make a barcode generator. The process() function 'translate' the decimals into 7-bits that EAN-13 barcode use. But i got TypeError instead.



class App(Frame):
encoded =
def __init__(self,master):
Frame.__init__(self,master)

##################
text_1 = Label(self,text='Save Barcode to PS file [eg: EAN13.eps]:')

text_2 = Label(self,text='Enter code (first 12 decimal digits):')

self.file_entry = Entry(self)

self.code_entry = Entry(self)
self.code_entry.bind('<Return>',self.process)
###################
text_1.grid(row = 0, column = 1,columnspan = 3)
self.file_entry.grid(row = 1, column = 1,columnspan = 3)
text_2.grid(row = 2, column = 1,columnspan = 3)
self.code_entry.grid(row = 3, column = 1,columnspan = 3)

def process(self):
num = self.code_entry.get()
checksum = (num[0]+num[2]+num[4]+num[6]+num[8]+num[10])+(3*(num[1]+num[3]+num[5]+num[7]+num[9]+num[11]))
.......


What i get in the end is TypeError in process(), i thought there's only one argument, self.



Where did i go wrong?





This question already has an answer here:




  • TypeError: quit() takes 1 positional argument but 2 were given (keyboard bind)

    2 answers



  • Keyboard Shortcut “Takes 1 positional argument but 2 were given”

    1 answer








python oop tkinter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 15:00









Lil StudentLil Student

42




42




marked as duplicate by Lafexlos, Bryan Oakley python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 15:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Lafexlos, Bryan Oakley python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 21 '18 at 15:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

    – Avishay Cohen
    Nov 21 '18 at 15:06



















  • It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

    – Avishay Cohen
    Nov 21 '18 at 15:06

















It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

– Avishay Cohen
Nov 21 '18 at 15:06





It's not clear for me where process is activated, please add the actual line where the error is coming from. and if you can, the error stack trace. from what you are saying, it seems like you use my_app.process(variable), but process only need self, so, you need to use it like this: my_app.process()

– Avishay Cohen
Nov 21 '18 at 15:06












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith