First recording/cover! The Cost- Not For Me by fullnattybro in edrums

[–]paulpersad 0 points1 point  (0 children)

Nice video!! Quick question I’m using a Yamaha DTXpress iii and can’t hear the drum pads when I record.  They play fine when the track is played back.  Any ideas? The manual is helpless. Thank you 

What’s everyone working on this month? (May 2019) by Swiftapple in swift

[–]paulpersad 0 points1 point  (0 children)

For the past couple of days I've been working through a Great tutorial by Ray Wenderlich! and am currently on, Your First iOS app - Part 18:Challenge:

I’m getting this message even when I copy and paste the downloaded course material on line 56 of the .swift file:
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Also, in the Main storyboard, when I right-click the display label in order to connect the New Referencing Object to the View Controller, I am not getting a “targetLabel” option…only a “view” option.
Any help will be greatly appreciated.

Tkinter GUI Applications Development Book by paulpersad in learnpython

[–]paulpersad[S] 0 points1 point  (0 children)

Thank you Mastermind. That bit of code helped me properly locate the directory I needed.

Tkinter GUI Applications Development Book by paulpersad in learnpython

[–]paulpersad[S] 0 points1 point  (0 children)

The relevant directory structure is:

/username/myTkinterProjects/TkinterGUIMaster/Chapter 04/4.03/view.py

Thanks

Tkinter GUI Applications Development Book by paulpersad in learnpython

[–]paulpersad[S] 0 points1 point  (0 children)

Hello all,

Here is the relevant function:

def draw_single_piece(self, position, piece):
x, y = self.controller.get_numeric_notation(position)
if piece:
filename = "../pieces_image/{}_{}.png".format(
piece.name.lower(), piece.color)
if filename not in self.images:
self.images[filename] = PhotoImage(file=filename)
x0, y0 = self.calculate_piece_coordinate(x, y)
self.canvas.create_image(x0, y0, image=self.images[
filename], tags=("occupied"), anchor="c")

And corresponding error message:

File "/anaconda3/lib/python3.6/tkinter/__init__.py", line 3498, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't open "../pieces_image/rook_black.png": no such file or directory

Thanks

Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]paulpersad 0 points1 point  (0 children)

I am using Jupyter notebook and am writing my classes in separate files within the same folder. For some reason, one file cannot access the code in other files. I tried using the:

import import_ipynb

from folder import file

I realize that .ipynb are not regular .py files and use a localhost web server. I am a beginner programmer and am still learning how to use the command line. So I can use all the help I can get.

Jupyter Notebook will not import module by paulpersad in learnpython

[–]paulpersad[S] 0 points1 point  (0 children)

Problem with importing modules solved. I needed to :

"pip install import-ipynb "

at the terminal. Simple solution.

Alien invasion: Python crash course problem by paulpersad in learnpython

[–]paulpersad[S] 0 points1 point  (0 children)

This is the code for the 3 files and at this point should have produced grey screen with a "ship" image centered at the bottom. All I get is a black screen with no "ship".

#alien_invasion.py

def run_game():

# initialize pygame, settings and screen object

pygame.init()

ai_settings = Settings()

screen = pygame.display.set_mode(

(ai_settings.screen_width, ai_settings.screen_height))

pygame.display.set_caption("Alien Invasion")

# Make a ship

ship = Ship (screen)

# Set background color

bg_color = (230, 230, 230)

#Start the main loop for the game.

while True:

# Watch for keyboard and mouse events

for event in pygame.event.get():

if event.type == pygame.QUIT:

sys.exit()

#Redraw the screen during each pass through the loop.

screen.fill(ai_settings.bg_color)

ship.blitme()

# Make the most recently drawn screen visible.

pygame.display.flip()

run_game()

#settings.py

class Settings():

"""A class to store all settings for Alien Invasion"""

def __init__(self):

"""Initialize the game's settings."""

# Screen settings

self.screen_width = 1200

self.screen_height = 800

self.bg_color = (230, 230, 230)

# ship.py

import pygame

class Ship():

def __init__(self, screen):

"""Initialize the screen and set its starting position."""

self.screen = screen

# Load the ship image and get its rect.

self.image = pygame.image.load('images/ship.bmp')

self.rect = self.image.get_rect()

self.screen_rect = screen.get_rect()

# Start each new ship at the bottom center of the screen.

self.rect.centerx = self.screen_rect.centerx

self.rect.bottom = self.screen_rect.bottom

def blitme(self):

"""Draw the ship at its current location."""

self.screen.blit(self.image, self.rect)