Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import sys
- import os
- import math
- from datetime import datetime
- os.environ["QT_LOGGING_RULES"] = "*.warning=false" # STFU Qt warnings
- from PyQt5.QtWidgets import (
- QApplication, QWidget, QFileDialog, QInputDialog,
- QDialog, QLabel, QVBoxLayout, QHBoxLayout, QLineEdit, QPushButton,
- QShortcut
- )
- from PyQt5.QtGui import QPainter, QFont, QColor, QKeySequence
- from PyQt5.QtCore import Qt, QPoint
- draw_string0 = "...oooOOO000OOOooo..." # T
- draw_string1 = "H E L P M Y T E X T E D I T O R I S B U S T E D" # Y
- draw_string2 = "[[[]]]|||///\\\\"
- draw_string3 = "HACKTHEMATRIX"
- draw_string4 = "//"
- draw_string5 = "]]||"
- draw_string6 = "\\\\"
- draw_string7 = ">>><<<"
- draw_string8 = "-=+"
- draw_string9 = " " # Erase
- class AsciiArtWindow(QWidget):
- def __init__(self, width=80, height=80):
- super().__init__()
- # Auto-commit vectors when the gesture ends
- self.vector_commit_on_release = True
- # Ctrl+S Save
- QShortcut(QKeySequence("Ctrl+S"), self, activated=self.save_file)
- # Ctrl+O Open
- QShortcut(QKeySequence("Ctrl+O"), self, activated=self.open_file)
- # Ctrl+B Edit Brushes
- QShortcut(QKeySequence("Ctrl+B"), self, activated=self.brush_editor)
- # Glyph tiles
- self.glyphs = {
- "Tile1": r'''
- ______ ______
- / / / /
- / / / /
- / / / /
- / / / /
- / / / /
- /_____/ /_____/
- \ \ \ \
- \ \ \ \
- \ \ \ \
- \ \ \ \
- \ \ \ \
- \_____\ \_____\
- '''.lstrip("\n"),
- "Tile2": r'''
- '''.lstrip("\n"),
- "Tile3": r'''
- __,----,__
- .' '.
- | ________ |
- | [ | |
- | | | |
- | | | |
- | | | |
- | | | |
- | [________| |
- \____________/
- '''.lstrip("\n"),
- "Tile4": r'''
- /_/
- /_/
- /_/
- /_/
- /_/
- /__\
- '''.lstrip("\n"),
- "Tile5": r'''
- \_\
- \_\
- \_\
- \_\
- \_\
- /__\
- '''.lstrip("\n"),
- "Tile6": r'''
- |_|
- |_|
- |_|
- |_|
- |_|
- /___\
- '''.lstrip("\n"),
- "Tile7": r'''
- \_\
- \_\
- \_\
- \_\
- \_\
- /|\
- '''.lstrip("\n"),
- "Tile8": r'''
- (_)
- (_)
- (_)
- (_)
- (_)
- -
- |||
- '''.lstrip("\n"),
- "Tile9": r'''
- \|/
- - __
- (_) /_/
- (_) /_/
- (_) /_/
- (_)/_/
- (_ /
- (_/
- '''.lstrip("\n"),
- "Tile10": r'''
- \|/
- -
- (_)
- (_)
- (_)
- (_)
- (_)
- '''.lstrip("\n"),
- "Tile11": r'''
- ///
- -- _
- \_\ /
- \_\ / /
- \_\/ /
- \__/
- '''.lstrip("\n"),
- "Tile12": r'''
- nnn
- /_/
- /_/
- /_/
- /_/
- /_/
- /_/
- '''.lstrip("\n"),
- }
- # Brushes
- self.draw_string0 = draw_string0
- self.draw_string1 = draw_string1
- self.draw_string2 = draw_string2
- self.draw_string3 = draw_string3
- self.draw_string4 = draw_string4
- self.draw_string5 = draw_string5
- self.draw_string6 = draw_string6
- self.draw_string7 = draw_string7
- self.draw_string8 = draw_string8
- self.draw_string9 = draw_string9
- self.draw_string = self.draw_string0
- self.draw_index = 0
- # Canvas/grid setup
- self.width_chars = width
- self.height_chars = height
- self.char_grid = [[' '] * width for _ in range(height)]
- self.text_color = QColor("black")
- # NOTE: These are "cell" sizes. Your chosen font may not match perfectly.
- self.char_width = 8
- self.char_height = 24
- # Cursor for WASD movement
- self.cursor_x = 0
- self.cursor_y = 0
- # Vector preview (non-permanent overlay)
- # Shift + Left-Drag => preview; Release => pinned preview; Enter => commit; Esc => clear
- self.vector_active = False
- self.vector_pinned = False
- self.vector_start = None # (x,y)
- self.vector_end = None # (x,y)
- self.vector_points = [] # list[(x,y)]
- self.vector_char = '_'
- self.vector_len = 0
- # Window setup
- self.base_title = "QtAwesome ASCII Arts!"
- self.setWindowTitle(self.base_title)
- self.resize(self.width_chars * self.char_width,
- self.height_chars * self.char_height)
- # Transparent background while keeping the frame
- self.BG_Flag = True
- self.setAttribute(Qt.WA_TranslucentBackground, self.BG_Flag)
- self.setAutoFillBackground(False)
- # Show Cursor
- self.Show_Cursor = False
- # Monospace font
- self.font = QFont("Courier", 14)
- # Track mouse movement even without buttons (useful for cursor display)
- self.setMouseTracking(True)
- # Minimum size so manual resizing doesn't collapse it
- self.setMinimumSize(self.char_width * 10, self.char_height * 1)
- self.show()
- # ---------------- Title helper ----------------
- def set_base_title(self, s: str):
- self.base_title = s
- self.update_title()
- def update_title(self):
- if self.vector_points and (self.vector_active or self.vector_pinned):
- self.setWindowTitle(f"{self.base_title} [vector len={self.vector_len} char='{self.vector_char}']")
- else:
- self.setWindowTitle(self.base_title)
- # ---------------- Brush editor ----------------
- def brush_editor(self):
- # If already open
- if hasattr(self, "brush_window") and self.brush_window.isVisible():
- self.brush_window.raise_()
- return
- self.brush_window = QDialog(self)
- self.brush_window.setWindowTitle("Edit Brushes")
- self.brush_window.setWindowFlags(Qt.Window)
- layout = QVBoxLayout()
- def make_row(label, getter, setter):
- row = QHBoxLayout()
- lbl = QLabel(label)
- edit = QLineEdit(getter())
- btn = QPushButton("Save")
- def save():
- new_value = edit.text()
- setter(new_value)
- # If this brush is currently active by value, keep drawing with the updated pattern.
- # (This is best-effort; you can refine by tracking an "active brush key" if desired.)
- if self.draw_string == getter():
- self.draw_string = getter()
- self.update_title()
- btn.clicked.connect(save)
- row.addWidget(lbl)
- row.addWidget(edit)
- row.addWidget(btn)
- return row
- layout.addLayout(make_row("Brush T:", lambda: self.draw_string0, lambda v: setattr(self, "draw_string0", v)))
- layout.addLayout(make_row("Brush Y:", lambda: self.draw_string1, lambda v: setattr(self, "draw_string1", v)))
- layout.addLayout(make_row("Brush U:", lambda: self.draw_string2, lambda v: setattr(self, "draw_string2", v)))
- layout.addLayout(make_row("Brush I:", lambda: self.draw_string3, lambda v: setattr(self, "draw_string3", v)))
- layout.addLayout(make_row("Brush J:", lambda: self.draw_string4, lambda v: setattr(self, "draw_string4", v)))
- layout.addLayout(make_row("Brush K:", lambda: self.draw_string5, lambda v: setattr(self, "draw_string5", v)))
- layout.addLayout(make_row("Brush L:", lambda: self.draw_string6, lambda v: setattr(self, "draw_string6", v)))
- layout.addLayout(make_row("Brush M:", lambda: self.draw_string7, lambda v: setattr(self, "draw_string7", v)))
- layout.addLayout(make_row("Brush N:", lambda: self.draw_string8, lambda v: setattr(self, "draw_string8", v)))
- layout.addLayout(make_row("Eraser:", lambda: self.draw_string9, lambda v: setattr(self, "draw_string9", v)))
- self.brush_window.setLayout(layout)
- self.brush_window.resize(700, 260)
- self.brush_window.show()
- # ---------------- Drawing helpers ----------------
- def draw_at_cursor(self):
- if 0 <= self.cursor_x < self.width_chars and 0 <= self.cursor_y < self.height_chars:
- if not self.draw_string:
- return
- char = self.draw_string[self.draw_index % len(self.draw_string)]
- self.char_grid[self.cursor_y][self.cursor_x] = char
- self.draw_index += 1
- self.update()
- def draw_char(self, pos: QPoint):
- x = pos.x() // self.char_width
- y = pos.y() // self.char_height
- if 0 <= x < self.width_chars and 0 <= y < self.height_chars:
- if not self.draw_string:
- return
- char = self.draw_string[self.draw_index % len(self.draw_string)]
- self.char_grid[y][x] = char
- self.draw_index += 1
- # ---------------- Vector preview helpers ----------------
- def grid_pos_from_pixel(self, pos: QPoint) -> tuple[int, int]:
- x = pos.x() // self.char_width
- y = pos.y() // self.char_height
- # Clamp to bounds
- x = max(0, min(self.width_chars - 1, x))
- y = max(0, min(self.height_chars - 1, y))
- return (x, y)
- def bresenham(self, x0: int, y0: int, x1: int, y1: int) -> list[tuple[int, int]]:
- points = []
- dx = abs(x1 - x0)
- dy = -abs(y1 - y0)
- sx = 1 if x0 < x1 else -1
- sy = 1 if y0 < y1 else -1
- err = dx + dy
- x, y = x0, y0
- while True:
- points.append((x, y))
- if x == x1 and y == y1:
- break
- e2 = 2 * err
- if e2 >= dy:
- err += dy
- x += sx
- if e2 <= dx:
- err += dx
- y += sy
- return points
- def vector_char_for_angle(self, dx: int, dy: int) -> str:
- """
- Rules (visual orientation):
- '_' if within +/-15Β° of horizontal
- '|' if within +/-15Β° of vertical
- '\' if negative slope
- '/' if positive slope
- IMPORTANT:
- Screen coords have +y downward; invert dy for math angle so that:
- up-right => '/'
- down-right => '\'
- """
- if dx == 0 and dy == 0:
- return '_'
- ang = math.degrees(math.atan2(-dy, dx)) # -180..180 using inverted dy
- abs_ang = abs(ang)
- # horizontal: near 0 or near 180
- if abs_ang <= 15 or abs_ang >= 165:
- return '_'
- # vertical: near 90
- if abs(abs_ang - 90) <= 15:
- return '|'
- return '\\' if ang < 0 else '/'
- def update_vector_preview(self):
- if not self.vector_start or not self.vector_end:
- self.vector_points = []
- self.vector_len = 0
- self.update_title()
- return
- x0, y0 = self.vector_start
- x1, y1 = self.vector_end
- dx = x1 - x0
- dy = y1 - y0
- self.vector_char = self.vector_char_for_angle(dx, dy)
- pts = self.bresenham(x0, y0, x1, y1)
- # Clip to bounds (should already be in bounds, but keep it safe)
- clipped = []
- for x, y in pts:
- if 0 <= x < self.width_chars and 0 <= y < self.height_chars:
- clipped.append((x, y))
- self.vector_points = clipped
- self.vector_len = len(self.vector_points)
- self.update_title()
- def clear_vector_preview(self):
- self.vector_active = False
- self.vector_pinned = False
- self.vector_start = None
- self.vector_end = None
- self.vector_points = []
- self.vector_len = 0
- self.update_title()
- self.update()
- def commit_vector(self):
- """Write the pinned/active vector into the grid (makes it permanent)."""
- if not self.vector_points:
- return
- for x, y in self.vector_points:
- self.char_grid[y][x] = self.vector_char
- # After commit, clear overlay
- self.clear_vector_preview()
- # ---------------- Mouse events ----------------
- def mouseMoveEvent(self, event):
- self.cursor_x = event.x() // self.char_width
- self.cursor_y = event.y() // self.char_height
- if event.buttons() & Qt.LeftButton:
- if self.vector_active:
- self.vector_end = self.grid_pos_from_pixel(event.pos())
- self.update_vector_preview()
- else:
- self.draw_char(event.pos())
- self.update()
- def mousePressEvent(self, event):
- # Update cursor first
- self.cursor_x = event.x() // self.char_width
- self.cursor_y = event.y() // self.char_height
- if event.button() == Qt.LeftButton:
- if event.modifiers() & Qt.ShiftModifier:
- # SHIFT + drag => vector preview
- self.vector_active = True
- self.vector_pinned = False
- p = self.grid_pos_from_pixel(event.pos())
- self.vector_start = p
- self.vector_end = p
- self.update_vector_preview()
- else:
- self.draw_char(event.pos())
- self.update()
- def mouseReleaseEvent(self, event):
- if event.button() == Qt.LeftButton and self.vector_active:
- self.vector_active = False
- # finalize end point at release
- self.vector_end = self.grid_pos_from_pixel(event.pos())
- self.update_vector_preview()
- if self.vector_commit_on_release:
- self.commit_vector() # writes into char_grid (permanent)
- else:
- self.vector_pinned = True # overlay-only behavior
- self.update()
- # ---------------- Help & file I/O ----------------
- def show_help(self):
- if hasattr(self, "help_window") and self.help_window.isVisible():
- self.help_window.raise_()
- self.help_window.activateWindow()
- return
- self.help_window = QDialog(self)
- self.help_window.setWindowTitle("Key Bindings")
- self.help_window.setWindowFlags(Qt.Window)
- layout = QVBoxLayout()
- label = QLabel()
- label.setText(
- "QtAwesome ASCII Arts! - Key Bindings\n\n"
- "Drawing (brush select):\n"
- " T - Brush 0\n"
- " Y - Brush 1\n"
- " U - Brush 2\n"
- " I - Brush 3\n"
- " J - Brush 4\n"
- " K - Brush 5\n"
- " L - Brush 6\n"
- " M - Brush 7\n"
- " N - Brush 8\n"
- " E - Eraser\n\n"
- "Vector preview tool:\n"
- " Shift + Mouse Drag - Preview vector line (non-permanent)\n"
- " release click - Commit vector line (make permanent)\n"
- " Esc - Clear vector preview\n\n"
- "Controls:\n"
- " Mouse Drag - Draw characters\n"
- " WASD, Arrows - Move cursor and draw\n"
- " R - Reset canvas\n"
- " P - Populate entire area with text\n"
- " B - Toggle background\n"
- " C - Toggle Show Cursor\n"
- " Ctrl+S - Save\n"
- " Ctrl+O - Open\n"
- " Ctrl+B - Edit brushes\n\n"
- "Color Palette:\n"
- " 1-9 - Change color\n"
- " 0 - White\n\n"
- "Help:\n"
- " H - Show this help window\n"
- )
- label.setStyleSheet("font-family: Courier; font-size: 16px;")
- label.setTextInteractionFlags(Qt.TextSelectableByMouse)
- layout.addWidget(label)
- self.help_window.setLayout(layout)
- self.help_window.resize(520, 620)
- self.help_window.show()
- def open_file(self):
- path, _ = QFileDialog.getOpenFileName(
- self,
- "Open ASCII Text File",
- "",
- "Text Files (*.txt);;All Files (*)"
- )
- if not path:
- return
- max_w = 500
- max_h = 500
- with open(path, "r", encoding="ascii", errors="ignore") as f:
- lines = f.read().splitlines()
- if not lines:
- return
- max_width = max(len(line) for line in lines)
- height = len(lines)
- capped_width = min(max_width, max_w)
- capped_height = min(height, max_h)
- self.width_chars = max(1, capped_width)
- self.height_chars = max(1, capped_height)
- self.char_grid = [[' ' for _ in range(self.width_chars)]
- for _ in range(self.height_chars)]
- for y in range(self.height_chars):
- line = lines[y]
- for x in range(min(len(line), self.width_chars)):
- self.char_grid[y][x] = line[x]
- # Resize window roughly to match loaded content
- self.resize(self.width_chars * self.char_width,
- self.height_chars * self.char_height)
- self.clear_vector_preview()
- self.update()
- self.set_base_title(f"QtAwesome ASCII Arts! [loaded: {os.path.basename(path)}]")
- def save_file(self):
- filename = f"ascii_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt"
- with open(filename, "w", encoding="ascii") as f:
- for row in self.char_grid:
- line = "".join(row)
- if any(c != ' ' for c in line):
- out = line.rstrip()
- else:
- out = " "
- f.write(out + "\n")
- self.set_base_title(f"QtAwesome ASCII Arts! [saved: {filename}]")
- # ---------------- Layout / grid management ----------------
- def paintEvent(self, event):
- painter = QPainter(self)
- painter.setFont(self.font)
- if not self.BG_Flag:
- painter.fillRect(self.rect(), QColor("white"))
- painter.setRenderHint(QPainter.TextAntialiasing)
- # Permanent grid
- painter.setPen(self.text_color)
- for y in range(self.height_chars):
- for x in range(self.width_chars):
- ch = self.char_grid[y][x]
- if ch.strip():
- painter.drawText(x * self.char_width, (y + 1) * self.char_height, ch)
- # Vector overlay (non-permanent)
- if self.vector_points and (self.vector_active or self.vector_pinned):
- painter.save()
- painter.setPen(QColor("darkGray"))
- for (x, y) in self.vector_points:
- painter.drawText(x * self.char_width, (y + 1) * self.char_height, self.vector_char)
- painter.restore()
- # Cursor rectangle overlay
- if self.Show_Cursor:
- painter.setPen(QColor("red"))
- painter.drawRect(
- self.cursor_x * self.char_width,
- self.cursor_y * self.char_height,
- self.char_width,
- self.char_height
- )
- def resizeEvent(self, event):
- self.update_grid()
- self.update()
- def update_grid(self):
- new_w = max(1, self.width() // self.char_width)
- new_h = max(1, self.height() // self.char_height)
- if new_w != self.width_chars or new_h != self.height_chars:
- old_grid = self.char_grid
- old_h = len(old_grid)
- old_w = len(old_grid[0]) if old_grid else 0
- self.width_chars = new_w
- self.height_chars = new_h
- new_grid = [[' '] * new_w for _ in range(new_h)]
- for y in range(min(new_h, old_h)):
- for x in range(min(new_w, old_w)):
- new_grid[y][x] = old_grid[y][x]
- self.char_grid = new_grid
- # If vector exists, clamp it and recompute
- if self.vector_points and (self.vector_active or self.vector_pinned):
- if self.vector_start:
- x, y = self.vector_start
- self.vector_start = (max(0, min(self.width_chars - 1, x)),
- max(0, min(self.height_chars - 1, y)))
- if self.vector_end:
- x, y = self.vector_end
- self.vector_end = (max(0, min(self.width_chars - 1, x)),
- max(0, min(self.height_chars - 1, y)))
- self.update_vector_preview()
- def populate(self, s):
- if not s:
- return
- length = len(s)
- index = 0
- for y in range(self.height_chars):
- for x in range(self.width_chars):
- self.char_grid[y][x] = s[index % length]
- index += 1
- # ---------------- Tiles ----------------
- def draw_tile(self, name):
- if name not in self.glyphs:
- return
- lines = self.glyphs[name].split("\n")
- lines = lines.lstrip("\n").rstrip("\n")
- for dy, line in enumerate(lines):
- for dx, ch in enumerate(line):
- x = self.cursor_x + dx
- y = self.cursor_y + dy
- if 0 <= x < self.width_chars and 0 <= y < self.height_chars:
- self.char_grid[y][x] = ch
- self.update()
- # ---------------- Key handling ----------------
- def keyPressEvent(self, event):
- key = event.key()
- # Clear vector preview
- if key == Qt.Key_Escape:
- self.clear_vector_preview()
- return
- # Commit vector preview
- if key in (Qt.Key_Return, Qt.Key_Enter):
- # Only commit if a vector is showing
- if self.vector_points and (self.vector_active or self.vector_pinned):
- self.commit_vector()
- return
- if key == Qt.Key_R:
- self.char_grid = [[' '] * self.width_chars for _ in range(self.height_chars)]
- self.draw_index = 0
- self.clear_vector_preview()
- self.update()
- return
- # Color keys
- if key == Qt.Key_1:
- self.text_color = QColor("black")
- elif key == Qt.Key_2:
- self.text_color = QColor("red")
- elif key == Qt.Key_3:
- self.text_color = QColor("blue")
- elif key == Qt.Key_4:
- self.text_color = QColor("green")
- elif key == Qt.Key_5:
- self.text_color = QColor("purple")
- elif key == Qt.Key_6:
- self.text_color = QColor("orange")
- elif key == Qt.Key_7:
- self.text_color = QColor("yellow")
- elif key == Qt.Key_8:
- self.text_color = QColor("cyan")
- elif key == Qt.Key_9:
- self.text_color = QColor("magenta")
- elif key == Qt.Key_0:
- self.text_color = QColor("white")
- # Brush selection
- elif key == Qt.Key_T:
- self.draw_string = self.draw_string0
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_Y:
- self.draw_string = self.draw_string1
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_U:
- self.draw_string = self.draw_string2
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_I:
- self.draw_string = self.draw_string3
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_J:
- self.draw_string = self.draw_string4
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_K:
- self.draw_string = self.draw_string5
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_L:
- self.draw_string = self.draw_string6
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_M:
- self.draw_string = self.draw_string7
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_N:
- self.draw_string = self.draw_string8
- self.set_base_title(f"Awesome ASCII Art {self.draw_string}")
- elif key == Qt.Key_E:
- self.draw_string = self.draw_string9
- self.set_base_title("Awesome ASCII Art Eraser")
- # WASD / arrow drawing
- elif key in (Qt.Key_W, Qt.Key_Up):
- self.cursor_y = max(0, self.cursor_y - 1)
- self.draw_at_cursor()
- elif key in (Qt.Key_S, Qt.Key_Down):
- self.cursor_y = min(self.height_chars - 1, self.cursor_y + 1)
- self.draw_at_cursor()
- elif key in (Qt.Key_A, Qt.Key_Left):
- self.cursor_x = max(0, self.cursor_x - 1)
- self.draw_at_cursor()
- elif key in (Qt.Key_D, Qt.Key_Right):
- self.cursor_x = min(self.width_chars - 1, self.cursor_x + 1)
- self.draw_at_cursor()
- # Help
- elif key == Qt.Key_H:
- self.show_help()
- # Populate
- elif key == Qt.Key_P:
- string, ok = QInputDialog.getText(
- self, "Populate Text area",
- "Type the characters to fill area:"
- )
- if ok and string:
- self.populate(string)
- self.update()
- # Toggle background
- elif key == Qt.Key_B:
- self.BG_Flag = not self.BG_Flag
- self.setAttribute(Qt.WA_TranslucentBackground, self.BG_Flag)
- # Toggle cursor display
- elif key == Qt.Key_C:
- self.Show_Cursor = not self.Show_Cursor
- # Tiles (examples from your dev keys)
- elif key == Qt.Key_G:
- self.set_base_title("Tile 1")
- self.draw_tile("Tile1")
- elif key == Qt.Key_V:
- self.set_base_title("Tile 2")
- self.draw_tile("Tile2")
- elif key == Qt.Key_Z:
- self.set_base_title("Tile 3")
- self.draw_tile("Tile3")
- elif key == Qt.Key_X:
- self.set_base_title("Tile 4")
- self.draw_tile("Tile4")
- self.update()
- if __name__ == "__main__":
- app = QApplication(sys.argv)
- if len(sys.argv) < 2:
- window = AsciiArtWindow(80, 80)
- print("Optional")
- print(f"Usage: {sys.argv[0]} [width height]")
- elif len(sys.argv) != 3:
- print(f"Usage: {sys.argv[0]} [width height]")
- sys.exit(1)
- else:
- x = int(sys.argv[1])
- y = int(sys.argv[2])
- if x < 1:
- x = 1
- if y < 1:
- y = 10
- window = AsciiArtWindow(x, y)
- sys.exit(app.exec_())
Advertisement
Add Comment
Please, Sign In to add comment