Git Product home page Git Product logo

gophersnake's People

Contributors

felixp7 avatar madscientistninja avatar sloumdrone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gophersnake's Issues

IPv6 unsupported

Attempting to connect to an IPv6 address or a DNS name that with only an AAAA record gives an "Unknown address type." error message.

GIF File display

Hi there. It doesn't look like this is too actively maintained, but since I am working on a similar project I thought I might be able to help out with GIF image display:

I had been having trouble with GIFs as well. The byte string was coming back from the server solidly, but I couldn't get it to display or download properly. I then tried a PNG and found that using PIL or Pillow (depending on python version) worked. The added bonus is that it will display ALL of your images pretty cleanly (including GIFs). So you can treat type 'g' and type 'I' files the same (as well as type 'p' which I found to be PNG on floodgap).

from PIL import Image, ImageTk
from io import BytesIO


def build_image(bytes_str):
    # pass the response string (as a bytes string)

    stream = BytesIO(bytes_str)
    print(type(stream))
    pil_image = Image.open(stream)
    tkimage = ImageTk.PhotoImage(pil_image)
    return tkimage



def show_image(data):
    # 'site_display' is a tk Text widget

    current_image = self.build_image(data)
    site_display.config(state=tk.NORMAL)
    site_display.delete(1.0, tk.END)
    site_display.image_create(tk.END, image = self.current_image)
    site_display.config(state=tk.DISABLED)

io is in the standard library, but you'll need to pip or easy_install pillow (which gets imported as PIL in python3).

Hopefully that is useful to you.

I have been having trouble with search for my project. I cannot find documentation anywhere for how an item type '7' expects the query to be transmitted. I looked at your code, but couldnt quite figure out what form a querystring is to take (or if it is actually a querystring?). Any help you can provide would be much appreciated!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.