Tkinter, X-windows and ebay

B

Bob Greschke

When you post something on eBay (and other places) you can use a 'browse'
button on a web page to send a picture file from your hard drive to them for
inclusion in your listing. Can the same kind of thing (not the same exact
thing, of course) be done with a Python/Tkinter program that is running on a
remote machine (that you logged into to start the program), but that's just
using your computer's display (with X11 on a Mac, X-whatever on Linux,
X-Win32 on Windows, etc.)? I've got an inventory program that runs this way
and it would be nice if users could create a text file on their machine, but
then have the program read that file and, for example, update item
quantities according to information in that file. Things like that.

Thanks!

Bob
 
J

James Stroud

Bob said:
When you post something on eBay (and other places) you can use a 'browse'
button on a web page to send a picture file from your hard drive to them for
inclusion in your listing. Can the same kind of thing (not the same exact
thing, of course) be done with a Python/Tkinter program that is running on a
remote machine (that you logged into to start the program), but that's just
using your computer's display (with X11 on a Mac, X-whatever on Linux,
X-Win32 on Windows, etc.)? I've got an inventory program that runs this way
and it would be nice if users could create a text file on their machine, but
then have the program read that file and, for example, update item
quantities according to information in that file. Things like that.

Thanks!

Bob

I think xml-rpc was designed to address these kinds of issues:

http://www.pythonware.com/products/xmlrpc/

James
 
C

Cameron Laird

When you post something on eBay (and other places) you can use a 'browse'
button on a web page to send a picture file from your hard drive to them for
inclusion in your listing. Can the same kind of thing (not the same exact
thing, of course) be done with a Python/Tkinter program that is running on a
remote machine (that you logged into to start the program), but that's just
using your computer's display (with X11 on a Mac, X-whatever on Linux,
X-Win32 on Windows, etc.)? I've got an inventory program that runs this way
and it would be nice if users could create a text file on their machine, but
then have the program read that file and, for example, update item
quantities according to information in that file. Things like that.
.
.
.
In a fairly well-defined sense, no; an X server isn't privileged,
in general, to access the host filesystem. This is a *benefit*
for security reasons.

I'm sympathetic with your desire. One of us should return to the
topic later on variations that might suit you.
 
A

Adonis

Bob said:
When you post something on eBay (and other places) you can use a 'browse'
button on a web page to send a picture file from your hard drive to them for
inclusion in your listing. Can the same kind of thing (not the same exact
thing, of course) be done with a Python/Tkinter program that is running on a
remote machine (that you logged into to start the program), but that's just
using your computer's display (with X11 on a Mac, X-whatever on Linux,
X-Win32 on Windows, etc.)? I've got an inventory program that runs this way
and it would be nice if users could create a text file on their machine, but
then have the program read that file and, for example, update item
quantities according to information in that file. Things like that.

Thanks!

Bob

This is not a full answer to your question, but an idea, just so happens
last few days I have been playing with ssh clients (putty, ssh) X11
Forwarding with success. Essentially the user would run their preferred
X, ssh to the server with X11 forwarding enabled to their host address
and they can run programs like Xterm or even Nautilus, most X programs
and it will be forwarded to their X server over a secured connection. To
address the users file system maybe try setting up a file server on the
Linux system referring to the users home directory, the user then
creates a reference to the file server, then now it may mimic a "local"
feel but all on your Linux server. Now they can run the X app and be
able to achieve what you want. I am in no way an expert and some of my
ideas might not be 100% accurate, but at my university this is how we
have it set and it works perfectly (a very mixed environment as well).

Just an idea, hope this helps.

Adonis
 
B

Bob Greschke

Thanks for the responses, guys!

I figured it was some kind of security/convenience roadblock.

What I came up with was the user can just create a text file (a kind of a
transaction log of what things were done to the copy of the database on his
machine), then cut and paste that text into a window created on their
machine by the main database program (using X-windows, ssh, etc.), then the
main program can read the contents of that text field and update the main
copy of the database.

It should work. :)

Bob
 
P

Paul Rubin

Bob Greschke said:
What I came up with was the user can just create a text file (a kind
of a transaction log of what things were done to the copy of the
database on his machine), then cut and paste that text into a window
created on their machine by the main database program (using
X-windows, ssh, etc.), then the main program can read the contents
of that text field and update the main copy of the database.

It should work. :)

Yuck! Why not use an http interface instead of the remote tkinter
interface? Then the user would interact with your app through a web
browser, giving a familiar UI as well as giving that upload button
(which tells the browser to upload the file).
 
B

Bob Greschke

Paul Rubin said:
Yuck! Why not use an http interface instead of the remote tkinter
interface? Then the user would interact with your app through a web
browser, giving a familiar UI as well as giving that upload button
(which tells the browser to upload the file).

Mainly because the user may be in the middle of the Himalayas trying to
create paperwork for equipment being shipped to Japan and Chile. The
Internet is not always an option in our line of work. We need to have
standalone everythings. We don't live in your real world. :)

The two databases (the one on the user's laptop, and the one back at the
office) don't need to be reconciled until the user gets back. We just need
to (eventually) know which pieces of equipment were sent to Japan, and which
went to Chile.

Bob
 
C

Cameron Laird

Mainly because the user may be in the middle of the Himalayas trying to
create paperwork for equipment being shipped to Japan and Chile. The
Internet is not always an option in our line of work. We need to have
standalone everythings. We don't live in your real world. :)

The two databases (the one on the user's laptop, and the one back at the
office) don't need to be reconciled until the user gets back. We just need
to (eventually) know which pieces of equipment were sent to Japan, and which
went to Chile.
.
.
.
Certainly. And, if you're content with what you have, that's
great; *I* certainly do enough funny things with Tkinter and
X. But what you *can* do is deploy the end-user desktop with
a browser pointed to a local Web page, presumably one with
enough client-side processing to prepare a form. Then, when
he's within range of an IP address, he selects an "upload"
link, and you get all the HTTP-related advantages Paul and
others have mentioned.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top