PIXNET Logo登入

不會的就放這邊

跳到主文

不會的程式和問題都放在這邊~所以叫做不會的就放這邊 這部落格放的東西關於:生活旅遊、科技產業相關、程式、和一些不懂的東西....

部落格全站分類:職場甘苦

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 07 週五 202311:44
  • 我該如何檢查資料夾底下否有重複的檔案,如果有我該如何另存新檔

你可以透過Python的os模組中的path.exists()方法來檢查檔案是否存在。如果檔案存在,可以使用datetime模組來生成一個新的檔案名稱。以下是示範程式碼
import os
from datetime import datetime
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(8)

  • 個人分類:Python
▲top
  • 4月 07 週五 202311:42
  • 0到15變成0到F

hex_list = [f"{i:X}" for i in range(16)]
print(hex_list)
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(6)

  • 個人分類:Python
▲top
  • 4月 07 週五 202311:41
  • Python - how to str hex to int

Python use
strhex = "0x01"
int(strhex,16)
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(4)

  • 個人分類:Python
▲top
  • 9月 27 週一 202113:47
  • 【Python】 時間相減範例程式

image
時間相減範例程式
start_dt = datetime.datetime.strptime(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()), '%Y-%m-%d %H:%M:%S')
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(73)

  • 個人分類:Python
▲top
  • 8月 25 週三 202111:28
  • 【python】 local variable referenced before assignment 錯誤的解決方案

每次都遇到 local variable referenced before assignment 錯誤的解決方案 這個問題
主要是變數需要變成全域變數才可以使用
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(977)

  • 個人分類:Python
▲top
  • 6月 12 週六 202113:40
  • 【Python】十六進位轉十進制

進入pyhton
>>> int("0x12F", base=16)
303
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(22)

  • 個人分類:Python
▲top
  • 1月 20 週三 202123:18
  • 【Python】語法總整理

自動py-to-exe空界面
python太多語法,放這邊練習


filedialog 對話框函數測試

import tkinter as tk
from tkinter import ttk
from tkinter import filedialog as fd
def do_askopenfilename():
    file=fd.askopenfilename()
    print(type(file))
    print(file)
def do_askopenfilenames():
    files=fd.askopenfilenames()
    print(type(files))
    print(files)
def do_asksaveasfilename():
    file=fd.asksaveasfilename()
    print(type(file))
    print(file)
def do_askdirectory():
    dir=fd.askdirectory()
    print(type(dir))
    print(dir)
def do_askopenfile():
    file=fd.askopenfile()
    print(type(file))
    print(file) 
def do_askopenfiles():
    files=fd.askopenfiles()
    print(type(files))
    print(files)
def do_asksaveasfile():
    file=fd.asksaveasfile()
    print(type(file))
    print(file)     
root=tk.Tk()
root.title("檔案開啟儲存")
ttk.Button(root, text="askopenfilename", command=do_askopenfilename).pack()
ttk.Button(root, text="askopenfilenames", command=do_askopenfilenames).pack()
ttk.Button(root, text="asksaveasfilename", command=do_asksaveasfilename).pack()
ttk.Button(root, text="askdirectory", command=do_askdirectory).pack()
ttk.Button(root, text="askopenfile", command=do_askopenfile).pack()
ttk.Button(root, text="askopenfiles", command=do_askopenfiles).pack()
ttk.Button(root, text="asksaveasfile", command=do_asksaveasfile).pack()
root.mainloop()
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(152)

  • 個人分類:Python
▲top
  • 1月 20 週三 202123:17
  • 【Python】關於open 的write換行多一行

更新: 原來是我read回來最後一個字串帶有換行
所以當我在寫入時,就會有多一個換行的\n寫入
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(77)

  • 個人分類:Python
▲top
  • 1月 20 週三 202102:41
  • 【Python】使用Python把資料上傳到google excel

使用python 上傳資料到google excel上
https://sites.google.com/site/zsgititit/home/python-cheng-shi-she-ji/shi-yongpython-shang-chuan-zi-liao-daogoogle-shi-suan-biao
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(1) 人氣(39)

  • 個人分類:Python
▲top
  • 12月 01 週二 202011:02
  • 【Python】錯誤訊息大雜燴

錯誤:UnboundLocalError: local variable 'aww' referenced before assignment
原因 : 變數沒有設定global
(繼續閱讀...)
文章標籤

JL8051 發表在 痞客邦 留言(0) 人氣(16)

  • 個人分類:Python
▲top
1

參觀人氣

  • 本日人氣:
  • 累積人氣:

贊助商廣告

文章分類

toggle 生活 (11)
  • 生活日常 - 醫學 (3)
  • 生活 - 房屋 (5)
  • 生活日常 - 食物 (3)
  • 台北股市 (5)
  • 生活 - 用品 (2)
  • 金融相關 (1)
  • 交通 (3)
  • Youtube (3)
  • 淘寶購物 (5)
  • 旅遊紀錄 (2)
  • 部落格 (3)
toggle 感測器 (5)
  • CO2 (1)
  • 儀器 (2)
  • 重量 (1)
  • 溫度 (1)
  • 感測器研究 (1)
toggle 程式語言 (11)
  • WindowsAPI (1)
  • VB (121)
  • Python (10)
  • C (41)
  • 大漠插件 with VB (1)
  • Android (1)
  • Arduino (3)
  • Git/ Svn 版本控制 (2)
  • Python (2)
  • Linux (41)
  • PHP (16)
toggle 硬體 (20)
  • Raspberry Pi 樹梅派 (1)
  • I2C (2)
  • ORCAD (1)
  • SPEC (6)
  • Allegro (1)
  • I3C (1)
  • DataSheet (4)
  • ARM (2)
  • BIOS/EC/SIO (3)
  • PADS/PCB (14)
  • Verilog (6)
  • 電腦 (7)
  • QUARTUS (2)
  • Logic Analyzers 邏輯分析儀 (1)
  • Virtual Box (6)
  • 周邊裝置 (5)
  • MCU (16)
  • 硬體電路 (7)
  • 好用工具 (46)
  • Shell script (3)
toggle 工作 (4)
  • 工作不能忘 (1)
  • 面試紀錄 (1)
  • 經驗談 (8)
  • 工作感想 (8)
toggle 文書處理 (5)
  • Browser瀏覽器 (3)
  • MacOS (5)
  • Microsoft (14)
  • Windows (14)
  • UART / RS232 (4)
  • Server (1)
  • 未分類文章 (1)

贊助商廣告

線上

文章搜尋

熱門文章

  • (102,129)[Word] 調整Word項目符號或編號與文字間的間格距離
  • (50,697)C語言 - uint8_t, uint16_t, uint32_t, uint64_t
  • (45,764)cp(複製)和mv(搬移)指令,複製或搬移整個資料夾,包含子資料夾
  • (34,161)免費PCB線上軟體 - EasyEDA 線上版電路圖、電路板繪製軟體介紹
  • (30,776)[工具] 如何製作可DOS開機的USB隨身碟
  • (27,875)【介面】RS485 & RS232 的差別
  • (13,501)【C語言】 function return array
  • (9,203)C範例 - UART傳送與接收程式
  • (6,748)【工具】虛擬串列埠(Serial Port) 模擬器
  • (4,590)Keil - Program Size訊息含意 Code、RO-data、RW-data、ZI-data

最新文章

  • 美國ESTA官方網站
  • 蘋果鈴聲設定步驟不清楚
  • 硬碟系統轉移軟體 Macrium Reflect
  • 汽車關稅
  • EC與BIOS溝通的介面62/66
  • SSD M.2有分 Key-M KeyB/M 兩種
  • PCB 背鑽(Backdrill)
  • 2025年過年經驗
  • NVIDIA GB200 NVL72
  • 去中國上海開通漫遊可以用line FB YT網站嗎?

最新留言

  • [25/10/21] Faculty of Economics and Management 於文章「[C觀念] volatile 的用法和用...」留言:
    What a great article! I’ll kee...
  • [25/10/21] Faculty of Economics and Management 於文章「[淘寶] 判斷商品能不能透過集運回台灣的...」留言:
    very useful article; thanks so...
  • [25/10/21] Faculty of Economics and Management 於文章「[Word] 調整Word項目符號或編號...」留言:
    Thank you for the effort expen...
  • [25/10/21] Faculty of Economics and Management 於文章「20140918-義隆電子104研發替代...」留言:
    The site is very rich in impor...
  • [23/09/08] W 於文章「【win10】Traditional C...」留言:
    超棒的 馬上自己解決 不用打擾IT...
  • [23/08/10] terry 於文章「更新win10後 VirtualBox無...」留言:
    我在WIN10 virtualbox 6.01版 安裝cen...
  • [23/07/15] 我愛動物森友會 於文章「WIN10更新後乙太網路(網路)不能使用...」留言:
    我是移除更新後,就又可以連線了...
  • [23/05/16] 訪客 於文章「【生活】台中 草悟道 勤美誠品綠園道DM...」留言:
    台灣最新詐術~你是否發現最近怪事一羅匡~諸事不順~身體不適~...
  • [22/08/23] Wayne Hsu 於文章「【win10】Traditional C...」留言:
    謝謝你! 公司剛換新電腦一直沒辦法打繁體 用了這個就好...
  • [22/06/04] jwang0189 於文章「免費PCB線上軟體 - EasyEDA ...」留言:
    非常實用的文章,謝謝提供,已點廣告表示支持 https://...

文章精選

誰來我家