-1
a=lb + "(IP(src='" + SrcIP + "', dst='" + DestIP + "')/TCP(sport=" + SrcPort + ", dport=" + DestPort + ",flags='"+P+""+S+""+A+""+U+""+F+""+R+"'), timeout=" + Timeout + ")"

p=eval(a)

p.show()

tkMessageBox.showinfo(title = "the configuration and results", message = "The configuration is:\nFlags:"+psh+"\n"+syn+"\n"+ack+"\n"+urg+"\n"+fin+"\n"+rst+"\nSource IP:"+SrcIP + "\nDestination IP: " + DestIP + "\nSource Port: " +SrcPort+ "\nDestination port: " + DestPort +  "\nTimeout: " +Timeout+"\nSend/Received method: "+lb+"\t")

How can i put the result of p.show() in tkMessageBox.showinfo?

Ray
  • 2,472
  • 18
  • 22
  • Can you give more details? What p.show() do? – KiraLT Jan 25 '14 at 10:58
  • 1
    **Don't call functions with `eval`**: You can create the parameters you are going to use and then call the function, instead of creating a string for `eval`. In most cases, using eval is a [very bad practise](http://stackoverflow.com/questions/1832940/is-using-eval-in-python-a-bad-practice) – A. Rodas Jan 25 '14 at 11:11
  • @Lukas a is a function containing many variables set by the user the p=eval(a) run the function and the p.show() gives the result i want a way to put those results in tkMessageBox – user3234849 Jan 25 '14 at 12:04
  • @A.Rodas could you please tell me how that could be done ? – user3234849 Jan 25 '14 at 12:05

1 Answers1

0

I don't think you can, as the .show() method only uses print statements.

Pierre
  • 6,047
  • 1
  • 30
  • 49