Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sublime & intellisence
#1
Hello Guys,
New coders stupid question, using sublime as my IDE, i THOUGHT i had sublime setup correctly for Python however as you can see from the video i am having some issues. With the intellisence, instead of just adding to the end of my line the last few characters i need to be helpful, it adds the entire line again which means i end up with this:

spaceship_group = pygame.sprite.pygame.sprite.Group(*sprites)

instead of this:

spaceship_group = pygame.sprite.Group(*sprites)

See video here
https://www.youtube.com/watch?v=7bS7n3Fs...e=youtu.be

additional annoying this, for some reason it doesn't pick up when i start typing "Pygame"....that's odd right???

I am just trying to work through some tutorials as a distraction to the Team Treehouse training i am also doing so could use some advice :)

in an effort to include everything, below is my code, don't think its needed for this question but just in case i have missed something in the video:
import pygame
from pygame.locals import *
#fps
clock = pygame.time.Clock()
fps = 60


#screen res
screen_width = 600  
screen_height = 800

screen = pygame.display.set_mode((screen_width, screen_height))

pygame.display.set_caption("Space Invaders")

#load image
bg = pygame.image.load("img/bg.png")

#create spacship class
class spaceship(pygame.sprite.sprite)
	def __init__(self, x, y):
		pygame.sprite.sprite.__init__(self)
		self.image = pygame.image.load("img/spaceship.png") # load image
		self.rect = self.image.get_rect() # force image to rectangle
		self.rect.center = [x, y]

#create sprite group
spaceship_group = pygame.sprite.pygame.sprite.Group(*sprites)

def draw_bg():
	screen.blit(bg,(0,0))

run = True # Bools need upper case  "true" is not correct, must be "True"

while run:
	clock.tick(fps)


	#draw background	
	draw_bg()


	# event handlers
	for event in pygame.event.get():
		if event.type == pygame.QUIT:  # Quit must be upper case, this one controls the X on display
			run = False

	pygame.display.update()

pygame.quit()
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  while loop not working-I am using sublime text editor mma_python 4 1,060 Feb-05-2023, 06:26 PM
Last Post: deanhystad
  Sublime Text Editor not recognizing Python elroberto 5 2,802 Jun-13-2022, 04:00 PM
Last Post: rob101
  Code folding in Sublime Text Mondata 2 2,758 Mar-12-2021, 04:16 PM
Last Post: Mondata
  How to link Sublime Text 3 Build system to Python 3.9 Using Windows 10 Fanman001 2 4,532 Mar-04-2021, 03:09 PM
Last Post: martpogs
  Sublime Text TechNitium 4 2,713 Jan-23-2021, 08:41 AM
Last Post: TechNitium
  Sublime Text + Anaconda not indenting Python code correctly Maxximiliann 0 1,954 Jun-13-2020, 06:09 PM
Last Post: Maxximiliann
  switching from pycharm to sublime issue Drifter 2 1,937 Jun-09-2020, 09:19 PM
Last Post: Drifter
  Contextual pop-up menus in Sublime Text Mondata 4 2,384 Apr-08-2020, 06:32 PM
Last Post: buran
  Sublime Text 3 WinError 2 File Specified HelloWorld17 0 2,782 Apr-02-2020, 09:03 AM
Last Post: HelloWorld17
  Sublime text not responding Mat 1 1,930 Mar-23-2020, 11:42 AM
Last Post: Fre3k

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020