All Projects → turbobin → Open-Manager

turbobin / Open-Manager

Licence: MIT license
如何管理杂乱的电脑桌面和一大堆的浏览器收藏网址?我用python写了一个工具,迅速提高工作效率。

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Open-Manager

tkmacosx
Tkmacosx is a Python library extension to the Tkinter module. Change background and foreground colors of a Button, Use ColorVar to change colors of multiple widgets just like StringVar, and much more.
Stars: ✭ 48 (+17.07%)
Mutual labels:  tkinter
Amazon-Flipkart-Price-Comparison-Engine
Compares price of the product entered by the user from e-commerce sites Amazon and Flipkart 💰 📊
Stars: ✭ 41 (+0%)
Mutual labels:  tkinter
Browthon-Reborn
Latest version of Browthon. A clean version in Python with PyQt5
Stars: ✭ 14 (-65.85%)
Mutual labels:  webbrowser
renpy-text-editor
Renpy Text Editor - A dedicated text editor for the RenPy Engine.
Stars: ✭ 30 (-26.83%)
Mutual labels:  tkinter
tk tools
Python tkinter tools, Python3.7+
Stars: ✭ 86 (+109.76%)
Mutual labels:  tkinter
Mandelbrot-set-explorer
An interactive Mandelbrot set, made with Python3 and Tkinter
Stars: ✭ 31 (-24.39%)
Mutual labels:  tkinter
Health-Discernment-System
A menu based multiple chronic disease detection system which will detect if a person is suffering from a severe disease by taking an essential input image.
Stars: ✭ 25 (-39.02%)
Mutual labels:  tkinter
webbrowser-rs
Rust library to open URLs in the web browsers available on a platform
Stars: ✭ 150 (+265.85%)
Mutual labels:  webbrowser
MagicMouse
A webbrowser for Squeak using Chrome/Chromium. Not to be confused with a highly innovative pointing device.
Stars: ✭ 24 (-41.46%)
Mutual labels:  webbrowser
PyGraphicsGui
A "CookieCutter" for a Pythonic GUI with custom graphics - clone this to jump-start your project and learn how to integrate between ModernGL and Tkinter on Python3.6.
Stars: ✭ 30 (-26.83%)
Mutual labels:  tkinter
ESP32Partitions
No description or website provided.
Stars: ✭ 30 (-26.83%)
Mutual labels:  tkinter
pymae
Materials for the book "Python for Mechanical and Aerospace Engineering"
Stars: ✭ 56 (+36.59%)
Mutual labels:  tkinter
Three-Factor-Security-Door
What do you get when you mix a Raspberry Pi, a MySQL database, an RFID reader, an LCD touchscreen, a relay switch, an electronic door strike and a Twilio SMS account?
Stars: ✭ 49 (+19.51%)
Mutual labels:  tkinter
xmpaint
处理有向图的有力工具
Stars: ✭ 65 (+58.54%)
Mutual labels:  tkinter
ARF-Converter
Bulk ARF file converter
Stars: ✭ 15 (-63.41%)
Mutual labels:  tkinter
tkinter-tabview
tkinter-tabview
Stars: ✭ 41 (+0%)
Mutual labels:  tkinter
mp4analyser
mp4 file analyser written in Python
Stars: ✭ 50 (+21.95%)
Mutual labels:  tkinter
pyGISS
📡 A lightweight GIS Software in less than 100 lines of code
Stars: ✭ 114 (+178.05%)
Mutual labels:  tkinter
tukaan
A modern, cross platform Python toolkit for creating desktop GUI applications. Contributors are welcome!
Stars: ✭ 97 (+136.59%)
Mutual labels:  tkinter
Pycraft
Pycraft is the OpenGL, open world, video game made entirely with Python. This project is a game to shed some light on OpenGL programming in Python as it is a seldom touched area of Python's vast amount of uses. Feel free to give this project a run, and message us if you have any feedback!
Stars: ✭ 39 (-4.88%)
Mutual labels:  tkinter

工作了一段时间发现,电脑桌面上已经满屏的常用软件、常用项目文件夹的快捷方式,一大堆的常用文档,浏览器上收藏的工作网址更是有100+,通常想打开一个文档、网址要寻找半天,于是萌生了写一个工具集中管理这些地址的想法。

实现:Python - tkinter + webbrowser

效果如下:

功能:

  • 关键字搜索,字母不区分大小写。
  • 添加:URL网址,本地软件路径,本地文档路径
  • 双击/敲回车键快捷打开
  • 选中删除
  • 修改:可使用添加功能,支持同名覆盖

原理:

  • 导入库
    tkinter,webbrowser均为python标准库,不需要另外安装

     import tkinter as tk
     import json
     import webbrowser
     from tkinter import messagebox
     from tkinter import *
  • 使用python自带界面开发库tkinter开发基本界面

     if __name__ == '__main__':
         root = Tk()  # 构造窗体
         root.title('Open Everything') # 标题
         root.iconbitmap('opentool.ico') # 加载图标
     
         root.resizable(0,0) # 固定窗口大小
         app = Application(master=root)	
  • 读取json文件,加载数据到Listbox

     self.urllist = self.readUrlList() # 获取列表
     if self.urllist:
         self.createWidgets()
         self.mainloop()
     else:
         messagebox.showinfo('Error','读取地址列表失败!请查看openlist.json文件是否存在并且格式正确。')
     # 加载地址列表
         for item in self.urllist:
             self.listbox.insert(END, item)  # 从尾部插入
  • 添加事件处理

     def doevent(self):
         self.keywdbox.bind("<Return>",self.showlist) # 按回车键,显示搜索结果
         self.keywdbox.bind("<BackSpace>",self.showlistAll)
         self.listbox.bind('<Double-Button-1>',self.openurl) # 双击打开地址
         self.listbox.bind('<Return>',self.openurl) # 按Enter键打开地址
  • 使用webbrowser.open(url)方法打开路径.
    这个方法比较强大,如果是http地址,会直接在浏览器中打开,如果是本地地址,会直接打开本地的软件/文件夹/文档等

     def openurl(self,event):
         urlname = self.listbox.get(self.listbox.curselection())
         url = self.urllist[urlname] # 根据key值获取对应url值
    
         if url is not None and url != '':
             webbrowser.open(url)
         else:
             messagebox.showinfo('Error !', '打开地址失败!地址为空。')
  • 搜索功能
    搜索功能实现比较简单,遍历字典key值,判断关键字是否存在key中

     def showlist(self, event):
         keywd = self.keywdbox.get().strip()
         if keywd:
             self.listbox.delete(0, END) # 先做清空列表动作
    
             for item in self.urllist:
                 if keywd.lower() in item.lower():   # 判断关键字是否存在字典key中
                     self.listbox.insert(END, item)  # 加载搜索结果
  • 退出软件时重新保存json文件

     def savaUrllist(self):
         with open('openlist.json', 'w', encoding='utf-8') as f:
             json.dump(self.urllist,f, ensure_ascii=False, indent=2)
    
         print('文件保存成功。')
  • 打包软件
    win下使用pyinstaller
    Mac下使用py2app

使用教程

LICENSE

MIT


更新 -- 20180916 Thinks for @CYDROM's pull requests

更新点:

  • 增加实时查询:输入就开始查询。之前输入关键字需要按Enter键筛选结果,现在只要输入就在同时筛选,优化了用户体验;
  • 拼音查询:全拼或拼音首字母查询,比如之前要输入完整的关键字'百度'',现在输入'baidu'就可以快速筛选出来;
    • 安装第三方包pip install pypinyin
from pypinyin import Style
import pypinyin
......
	def showlist(self, event):
        keywd = self.keywdbox.get().strip()
        if keywd:
            self.listbox.delete(0, END)
            # print(urllist)
            for item in self.urllist:
                if (keywd.lower() in item.lower()) or (keywd.lower() in pypinyin.slug(item.lower(), separator='') or
                    (keywd.lower() in pypinyin.slug(item.lower(),style=Style.FIRST_LETTER,separator=''))):
                    self.listbox.insert(END, item)  # 加载搜索结果
        else:
            self.listbox.delete(0, END)
            for item in self.urllist:
                self.listbox.insert(END, item)  # 空字符时,加载所有列表
  • 方向键快捷键:输入框中按 Down键,进入条目区,条目区按下Left键返回搜索框;

优化:

  • 打开软件时,使光标直接定位到搜索框
  • 打开添加子窗口时,使光标定位到输入框,并使根窗口失效(不可点击),上一版本可打开多个添加窗口,根窗口还可以聚焦,不太合理。

具体实现细节,可 git clone https://github.com/turbobin/Open-Manager.git查看。


更新 --20181205

Chrome书签收藏有 200 个以上了,如何把这些书签导入我的收藏神器中呢? 1.在 Chrome 浏览器中右上角点击书签 --> 书签管理器 --> 点击右上角 --> 导出书签,会下载一个类似bookmarks_2018_12_05.html文件,双击打开,如图:

2.下面我们来用 BeautifulSoup 把书签名和对应 url 爬下来,保存 json 文件,程序如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# created on '2018/12/05'

from bs4 import BeautifulSoup
import requests
import json

def create_soup():
	f = open("bookmarks_2018_12_05.html", encoding="utf-8")
	soup = BeautifulSoup(f, 'html.parser')
	return soup


def dumps_json(soup):
	openlist = dict()
	tag_a = soup.find_all('a')
	for a in tag_a:
		openlist[a.string] = a.get('href')

	content = json.dumps(openlist, ensure_ascii=False, indent=2)
	with open("openlist.json", "w", encoding="utf-8") as f:
		f.write(content)


def main():
	soup = create_soup()
	dumps_json(soup)

if __name__ == '__main__':
	main()

3.把文件 openlist.json (固定命名) 放到 OpenTool.exe 文件同级目录下,可以和原来的 openlist.json 做一下合并,现在打开软件,可以看到书签已经加载进来了。


欢迎 Star 和 Fork ~

如有问题,请提出改进建议,谢谢!联系:[email protected]


博客地址:https://turbobin.github.io/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].