Invalid Syntax error =/

I keep getting an invalid syntax error..

Page 1 of 1

4 Replies - 2679 Views - Last Post: 06 May 2009 - 07:14 AM Rate Topic: -----

#1 tech_force  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 02-May 09

Invalid Syntax error =/

Post icon  Posted 05 May 2009 - 08:46 PM

I got the snippet from a forum on here, and I figured I would use it as a self tutorial, and try to have some fun with it, this is what the code is:

class Trans(Frame):
	def __init__(self, parent, id, title):
		Frame.__init__(self, parent, id, title, size=(700, 800), style=DEFAULT_FRAME_STYLE | STAY_ON_TOP)
		self.Text = TextCtrl(self, style=TE_MULTILINE | HSCROLL)
		self.Text.SetBackgroundColour('Black'), self.Text.SetForegroundColour('Steel Blue')
		self.SetTransparent(150)
		self.Show()
app = App()
Trans(None, 1, "Transparent Window")
app.MainLoop()



I enter the code as is, I tried entering it into python(python gui) and into Python Shell, both of them give me an invalid syntax error, i enter the 1st line, and proceed to entering the 2nd line, when I have finished that, I proceed to the 3rd line, when I hit enter to do so, it gives me an invalid syntax error, on line 1. I don't know what the problem is, can anybody help?

Is This A Good Question/Topic? 0
  • +

Replies To: Invalid Syntax error =/

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3093
  • View blog
  • Posts: 19,139
  • Joined: 14-September 07

Re: Invalid Syntax error =/

Posted 05 May 2009 - 09:12 PM

I'd type it all out in a text editor or IDLE and then compile it. Are you importing the proper libraries/modules?
Was This Post Helpful? 0
  • +
  • -

#3 tech_force  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 02-May 09

Re: Invalid Syntax error =/

Posted 05 May 2009 - 10:21 PM

View PostKYA, on 5 May, 2009 - 08:12 PM, said:

I'd type it all out in a text editor or IDLE and then compile it. Are you importing the proper libraries/modules?


Honestly, I am just beginning with python, so I'm just winging it here, but I do appreciate the help, it helps me to learn, which I am here to do!
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6036
  • View blog
  • Posts: 23,421
  • Joined: 23-August 08

Re: Invalid Syntax error =/

Posted 06 May 2009 - 05:05 AM

This code, which comes from this snippet, requires wxPython. Do you have wxPython?
Was This Post Helpful? 0
  • +
  • -

#5 tech_force  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 02-May 09

Re: Invalid Syntax error =/

Posted 06 May 2009 - 07:14 AM

View PostJackOfAllTrades, on 6 May, 2009 - 04:05 AM, said:

This code, which comes from this snippet, requires wxPython. Do you have wxPython?


No, I don't have it, but I am currently downloading it =]
So whats the difference in WXPython, Python Shell and Python(Python GUI)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1