Re: Python PNG Viewer(Browser Based)

2015-11-03 Thread Ben Finney
Arshpreet Singh  writes:

> On Tuesday, 3 November 2015 21:32:03 UTC+5:30, Chris Warrick  wrote:
> > Your problem is lack of basic understanding of the Internet. 
>
> Yes That's true at some level.

More specifically, your problem is not “how do I do this with Python?”
but rather “what is a web page?”.

So, the research you need to do is not Python-specific, instead you need
to learn about the structure of web pages and web applications.

> My present working system shows me list of all files (PNGs, JPGs, txt,
> SVGs) in browser, when I click on file it opens it and show contents
> of it.

You are directing your web browser to visit a folder on your local file
system. It is obliging you by presenting a directory of local files.

Instead, you need to learn how to author web pages.

There are countless resources for learning about generating a web page
from scratch. You could learn a lot from the Wikibooks project
https://en.wikibooks.org/wiki/Authoring_Webpages>.

You'll also need to appreciate that developing web pages is a *very*
extensive topic. You might need nothing more than to create simple
static pages; you don't need Python at all for that. You might need a
powerful Web programming framework, Python has excellent support for
that https://wiki.python.org/moin/WebFrameworks>.

Without you learning the very basics of web sites, though, you won't get
much use from Python-specific knowledge about web frameworks.

Good hunting!

-- 
 \  “Ridicule is the only weapon which can be used against |
  `\   unintelligible propositions.” —Thomas Jefferson, 1816-07-30 |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python PNG Viewer(Browser Based)

2015-11-03 Thread Arshpreet Singh
On Tuesday, 3 November 2015 21:32:03 UTC+5:30, Chris Warrick  wrote:
> On 3 November 2015 at 12:54, Arshpreet Singh  wrote:
> > Hello Everyone,
> >
> > I am looking for Browser-based PNG file viewer written in
> > Python.(Flask framework preferably)
> >
> > Following project(Flask-Based) provides many things(File manager as
> > well as file viewer)  but it does not support PNG files.
> >
> > https://github.com/vmi356/filemanager
> >
> > Any idea if I have to write my own browser based PNG viewer from
> > scratch(Using PIL or other required library)
> >
> > On the other side if I have to write only Desktop-based only two lines
> > are enough to do many things:
> >
> > Like,
> >
> > from PIL import Image
> > f = Image.open("file.png").show()
> >
> >
> > But I am not getting right sense that how to make possible using 
> > Python+Flask.
> >
> > Hope I am able to tell my problem?
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> 
> Your problem is lack of basic understanding of the Internet. 

Yes That's true at some level.

>Because
> EVERY graphical web browser supports PNG files NATIVELY. With a single
>  tag.

That is easily understandable. 
 
> Just figure out where to add the PNG handler code and read any random
> "how to add images to a webpage" tutorial.
> You might need a new template and some code that is aware of the file
> being an image. But absolutely no PNG viewer is necessary.

My present working system shows me list of all files (PNGs, JPGs, txt, SVGs) in 
browser, when I click on file it opens it and show contents of it. but PNG and 
JPGs are not working. Surely handling one PNG file is easy but no idea how to 
solve multiple file situation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python PNG Viewer(Browser Based)

2015-11-03 Thread marco . nawijn
On Tuesday, November 3, 2015 at 12:55:09 PM UTC+1, Arshpreet Singh wrote:
> Hello Everyone,
> 
> I am looking for Browser-based PNG file viewer written in
> Python.(Flask framework preferably)
> 
> Following project(Flask-Based) provides many things(File manager as
> well as file viewer)  but it does not support PNG files.
> 
> https://github.com/vmi356/filemanager
> 
> Any idea if I have to write my own browser based PNG viewer from
> scratch(Using PIL or other required library)
> 
> On the other side if I have to write only Desktop-based only two lines
> are enough to do many things:
> 
> Like,
> 
> from PIL import Image
> f = Image.open("file.png").show()
> 
> 
> But I am not getting right sense that how to make possible using Python+Flask.
> 
> Hope I am able to tell my problem?

Well, if you only want to open the PNG file in the webbrowser
(in contrast of serving them over the internet), you can do it
in two lines too:

import webbrowser
webbrowser.open('file.png')

But this is probably not what you want.

M.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python PNG Viewer(Browser Based)

2015-11-03 Thread Chris Warrick
On 3 November 2015 at 12:54, Arshpreet Singh  wrote:
> Hello Everyone,
>
> I am looking for Browser-based PNG file viewer written in
> Python.(Flask framework preferably)
>
> Following project(Flask-Based) provides many things(File manager as
> well as file viewer)  but it does not support PNG files.
>
> https://github.com/vmi356/filemanager
>
> Any idea if I have to write my own browser based PNG viewer from
> scratch(Using PIL or other required library)
>
> On the other side if I have to write only Desktop-based only two lines
> are enough to do many things:
>
> Like,
>
> from PIL import Image
> f = Image.open("file.png").show()
>
>
> But I am not getting right sense that how to make possible using Python+Flask.
>
> Hope I am able to tell my problem?
> --
> https://mail.python.org/mailman/listinfo/python-list

Your problem is lack of basic understanding of the Internet. Because
EVERY graphical web browser supports PNG files NATIVELY. With a single
 tag.

Just figure out where to add the PNG handler code and read any random
“how to add images to a webpage” tutorial.
You might need a new template and some code that is aware of the file
being an image. But absolutely no PNG viewer is necessary.

-- 
Chris Warrick 
PGP: 5EAAEA16
-- 
https://mail.python.org/mailman/listinfo/python-list


Python PNG Viewer(Browser Based)

2015-11-03 Thread Arshpreet Singh
Hello Everyone,

I am looking for Browser-based PNG file viewer written in
Python.(Flask framework preferably)

Following project(Flask-Based) provides many things(File manager as
well as file viewer)  but it does not support PNG files.

https://github.com/vmi356/filemanager

Any idea if I have to write my own browser based PNG viewer from
scratch(Using PIL or other required library)

On the other side if I have to write only Desktop-based only two lines
are enough to do many things:

Like,

from PIL import Image
f = Image.open("file.png").show()


But I am not getting right sense that how to make possible using Python+Flask.

Hope I am able to tell my problem?
-- 
https://mail.python.org/mailman/listinfo/python-list