我正在尝试从firefox android浏览器复制文本,触发一个意图并读取系统剪贴板但是徒劳无功。
firefox webextension副本的剪贴板是否与Android系统剪贴板不同? 如果是这样,还有其他方法吗?
此外,有什么方法可以将大型blob数据从浏览器传输到应用程序。我目前通过意图uri传递它。
答案 0 :(得分:0)
在我看来,import Tkinter as tk
from tkFileDialog import askopenfilename
from Tkinter import *
import pandas as pd
import ttk
import subprocess
# Import all graph codes.
import graph_1
import graph_2
import graph_3
import graph_4
def import_csv_data():
global v
csv_file_path = askopenfilename()
print(csv_file_path)
v.set(csv_file_path)
df = pd.read_csv(csv_file_path)
def openfile():
subprocess.call(['notepad.exe', 'C:/help.txt'])
# Functions for calling graphs.
def graph_1():
graph_1.display_graph(v.get())
def graph_2():
graph_2.display_graph(v.get())
def graph_3():
graph_3.display_graph(v.get())
def graph_4():
graph_4.display_graph(v.get())
# Read in data buttons.
root = tk.Tk()
tk.Label(root, text='File Path').grid(row=0, column=0)
v = tk.StringVar()
entry = ttk.Entry(root, textvariable=v).grid(row=0, column=1)
ttk.Button(root, text='Browse Data Set',command=import_csv_data).grid(row=1, column=0)
# Title and icon of the GUI.
root.title('Graphs')
root.iconbitmap('C:/icon.ico')
root.geometry("370x118")
#Graph Buttons.
ttk.Button(root, text='Graph 1', command=graph_1).grid(row=3, column=0)
ttk.Button(root, text='Graph 2', command=graph_2).grid(row=3, column=1)
ttk.Button(root, text='Graph 3', command=graph_3).grid(row=4, column=0)
ttk.Button(root, text='Graph 4', command=graph_4).grid(row=4, column=1)
def new_window():
# Import all graph codes.
import graph_1
import graph_2
import graph_3
import graph_4
def import_csv_data():
global v
csv_file_path = askopenfilename()
print(csv_file_path)
v.set(csv_file_path)
df = pd.read_csv(csv_file_path)
# Define the functions before calling them.
def doNothing():
print "nothing"
# Functions for calling graphs.
def graph_1():
graph_1.display_graph(v.get())
def graph_2():
graph_2.display_graph(v.get())
def graph_3():
graph_3.display_graph(v.get())
def graph_4():
graph_4.display_graph(v.get())
# Read in data buttons.
root = tk.Tk()
tk.Label(root, text='File Path').grid(row=0, column=0)
v = tk.StringVar()
entry = tk.Entry(root, textvariable=v).grid(row=0, column=1)
ttk.Button(root, text='Browse Data Set',command=import_csv_data).grid(row=1, column=0)
# Title and icon of the GUI.
root.title('Graphs')
root.iconbitmap('C:/icon.ico')
root.geometry("370x118")
#Graph Buttons.
ttk.Button(root, text='Graph 1', command=graph_1).grid(row=3, column=0)
ttk.Button(root, text='Graph 2', command=graph_2).grid(row=3, column=1)
ttk.Button(root, text='Graph 3', command=graph_3).grid(row=4, column=0)
ttk.Button(root, text='Graph 4', command=graph_4).grid(row=4, column=1)
#Menu setup and buttons for new window.
menu = Menu(root)
root.config(menu=menu)
subMenu = Menu(menu)
menu.add_cascade(label="File",menu=subMenu)
subMenu.add_command(label="New", command=new_window)
subMenu.add_command(label="Exit", command=root.destroy)
editMenu = Menu(menu)
menu.add_cascade(label = "Help", menu=editMenu)
editMenu.add_command(label="Help", command=openfile)
# Menu setup and buttons.
menu = Menu(root)
root.config(menu=menu)
subMenu = Menu(menu)
menu.add_cascade(label="File",menu=subMenu)
subMenu.add_command(label="New", command=new_window)
subMenu.add_command(label="Exit", command=root.destroy)
editMenu = Menu(menu)
menu.add_cascade(label = "Help", menu=editMenu)
editMenu.add_command(label="Help", command=openfile)
root.mainloop()
的剪贴板与android的不同。我可以告诉它,因为我使用firefox
应用,它也会显示从Clip Stack
复制的文字。这个应用程序是开源的,也许您可以通过查看its code找到如何处理您的案例。