Error getting while running python function

J

Jaydeep Patil

I have defined one function as below.

def InfoDir(msg):
msg1 = wx.MessageDialog(msg)
msg1.ShowModal()
msg1.Destroy()

InfoDir("Testing")


It gives below error.
msg1 = wx.MessageDialog(msg)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 2922, in __init__
_windows_.MessageDialog_swiginit(self,_windows_.new_MessageDialog(*args, **kwargs))
TypeError: Required argument 'message' (pos 2) not found

Process finished with exit code 1



Please give me solution for this.
 
C

Chris Angelico

I have defined one function as below.

def InfoDir(msg):
msg1 = wx.MessageDialog(msg)
msg1.ShowModal()
msg1.Destroy()

InfoDir("Testing")


It gives below error.
msg1 = wx.MessageDialog(msg)
File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 2922, in __init__
_windows_.MessageDialog_swiginit(self,_windows_.new_MessageDialog(*args, **kwargs))
TypeError: Required argument 'message' (pos 2) not found

Process finished with exit code 1

It looks like you're missing a required argument :)

http://www.wxpython.org/docs/api/wx.MessageDialog-class.html#__init__

Try passing it a parent window as well as the message.

ChrisA
 
J

Jaydeep Patil

I have defined one function as below.



def InfoDir(msg):

msg1 = wx.MessageDialog(msg)

msg1.ShowModal()

msg1.Destroy()



InfoDir("Testing")





It gives below error.

msg1 = wx.MessageDialog(msg)

File "C:\Python27\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py", line 2922, in __init__

_windows_.MessageDialog_swiginit(self,_windows_.new_MessageDialog(*args, **kwargs))

TypeError: Required argument 'message' (pos 2) not found



Process finished with exit code 1







Please give me solution for this.



Is anybody answer my query?

Regards
Jay
 
C

Chris Angelico

There is not parent window such. I just write a simple function to define.
There is no class.
Is it possible to work like the way i am doing?

You could try reading the docs; there might be a way to say "no parent
window" (maybe pass it None), but you can't simply omit parameters.

Start with the docs. They're friendly.

ChrisA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top