Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to make a program that can open save and print texts with Quickly, but I can't get the printing part to work.

In my code when you press the "printbutton" it opens a print dialog:

def on_printbutton_clicked(self,widget):
    self.printdialog.show()

and that works fine. And when you click "ok" it will gather the settings from the dialog and try to print:

def on_printdialog_response(self,widget,ok):
    printjob = gtkunixprint.PrintJob(self.filename,self.printdialog.get_selected_printer,self.printdialog.get_setting,self.printdialog.get_page_setup)

but when I run it doesn't work and just gives me this:

NameError: global name 'gtkunixprint' is not defined

Is "gtkunixprint" wrong? Or is it something else in my code? Or should I first import something?

I hope you can help me.

share|improve this question
NameError: global name 'gtkunixprint' is not defined It looks like something is messed up with your imports. Could you include them? Also, you should probably include your Ubuntu and Python version numbers. – InkBlend Oct 5 '12 at 4:11

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.