memex-in commited on
Commit
ded13e3
·
verified ·
1 Parent(s): 9305c51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,8 +1,7 @@
1
  import os
2
  from selenium import webdriver
3
  from selenium.webdriver.chrome.options import Options
4
- from PIL import Image
5
- from ascii_magic import from_image_file, to_terminal
6
 
7
  def capture_screenshot(url, output_path='screenshot.png'):
8
  # Set up headless Chrome
@@ -20,9 +19,10 @@ def capture_screenshot(url, output_path='screenshot.png'):
20
  driver.quit()
21
 
22
  def convert_to_ascii(image_path):
23
- # Convert image to ASCII art
24
- output = from_image_file(image_path, columns=100, char='#')
25
- to_terminal(output)
 
26
 
27
  if __name__ == '__main__':
28
  url = input("Enter the website URL (e.g., https://example.com): ").strip()
 
1
  import os
2
  from selenium import webdriver
3
  from selenium.webdriver.chrome.options import Options
4
+ from ascii_magic import AsciiArt
 
5
 
6
  def capture_screenshot(url, output_path='screenshot.png'):
7
  # Set up headless Chrome
 
19
  driver.quit()
20
 
21
  def convert_to_ascii(image_path):
22
+ # Create an AsciiArt instance from the image file
23
+ my_art = AsciiArt.from_image(image_path)
24
+ # Display the ASCII art in the terminal
25
+ my_art.to_terminal(columns=100, monochrome=True)
26
 
27
  if __name__ == '__main__':
28
  url = input("Enter the website URL (e.g., https://example.com): ").strip()