原创 import 搜索模塊

1.跨文件夾導入a.py模塊  import sys import os #返回當前文件的絕對路徑 #print(os.path.abspath('.')) #print(sys.path) sys.path.append(os.pat

原创 c 語言讀取本地文件

#include<stdio.h> int readFile(char *buff[]) { FILE *fp = NULL; fp = fopen("data/test.txt", "r"); if(fp==NUL

原创 在linux中安裝Jupyter notebook

https://blog.csdn.net/chaolei3/article/details/79264630   https://www.cnblogs.com/yellow-hgy/p/10232633.html     ubutun

原创 喫蘋果小遊戲(Python)

1.公共類模塊 import pygame from pygame.rect import Rect def print_text(font, x, y, text, color=(255, 255, 255)): imgT

原创 == 和 is 區別

1.‘==’是兩個值的判斷 ‘is’是地址指向的判斷(也是id值的判斷) a=[11,22,33] b=[11,22,33] print(a==b)#==> True print(a is b)#==>False c=a print(a

原创 matplotlib 圖像顏色直方圖

參考學習 定義 cv2.calcHist(images, channels, mask, histSize, ranges[, hist[, accumulate ]]) ->hist imaes:輸入的圖像channels:選擇圖像的

原创 微信打飛機遊戲(python)

import pygame import random import sys #初始化 pygame.init() pygame.display.set_caption('飛機火拼')#設置窗口標題 screen= pygame.di

原创 統計文章內詞頻率

import collections target_str="THE TRAGEDY OF ROMEO AND JULIET" with open('./羅密歐與朱麗葉(英文版)莎士比亞.txt', encoding='utf-8')

原创 貪喫蛇小遊戲(python)

import pygame import sys import random SCREEN_X=600 SCREEN_Y=600 class Snake(object): def __init__(self):

原创 一步一步學OPENGL----vs2019下 OpenGL glew和glfw環境搭建

1.實驗準備  glew下載地址(選擇 Binaries Windows 32-bit and 64-bit)  glfw下載地址(選擇 32-bit Windows binaries) vs2019社區版本(這個不懂自己百度下載吧,需要

原创 安裝tensorflow==1.13.1錯誤 升級numpy

ERROR: Could not find a version that satisfies the requirement grpcio>=1.8.6 (from tensorflow==1.13.1) (from versions:

原创 2.OpenGL繪製窗口

#include<GLFW/glfw3.h> #include<glad/glad.h> #include<stdio.h> using namespace std; void framebuffer_size_callback(GLF

原创 python製作文字音頻

#谷歌文字轉語音api from gtts import gTTS with open("demo.txt",'r',encoding="utf8") as f: audio = gTTS(text=f.read(),lang=

原创 SSpanel面板搬遷後遇到的HTTP500問題解決

https://blog.csdn.net/qq_36641456/article/details/89044100 https://www.9malio.com/36/.html

原创 os.path中的isfile正確用法

os.path.isfile()用於判斷某一對象(需提供絕對路徑)是否爲文件 import os dirct = '/home/workespace/notebook/' for i in os.listdir(dirct):