最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Python一鍵實(shí)現(xiàn)統(tǒng)計(jì)本地文件或壓縮包的代碼行數(shù)

 更新時(shí)間:2026年05月01日 07:23:12   作者:time_error  
本文主要介紹了一個(gè)Python腳本,用于一鍵統(tǒng)計(jì)本地文件夾或壓縮包的代碼行數(shù),包括代碼行數(shù)、空白行數(shù)、注釋行數(shù)、總行數(shù)等,文中的示例代碼講解詳細(xì),希望對(duì)大家有所幫助

需求分析

Python一鍵統(tǒng)計(jì)你的本地文件夾或壓縮包的代碼行數(shù),可處理任意層嵌套壓縮包、文件夾、多個(gè)或單個(gè)代碼文件,其中統(tǒng)計(jì)部分包含代碼行數(shù)、空白行數(shù)、注釋行數(shù)、總行數(shù)。這對(duì)于自己學(xué)習(xí)或開發(fā)的小白來說,可以清楚地知道自己過去一周、一個(gè)月在本地機(jī)器寫了多少行代碼。

使用教程

此時(shí),輸入合適的絕對(duì)路徑或文件夾(含單個(gè)文件)作為檢測(cè)目標(biāo)。

嵌套壓縮包,輸入py -3 count_code_Ultra.py “your_path"運(yùn)行結(jié)果圖如下:

單個(gè)文件,py -3 count_code_Ultra.py “C:\Users\your_mid_path\count_code_Ultra.py"(要使用絕對(duì)路徑)。

文件夾,py -3 count_code_Ultra.py C:\Users\your_last_path\

注意內(nèi)部不使用引號(hào)也是可以的,而且csv、xlsx文件的代碼行數(shù)不計(jì)數(shù)統(tǒng)計(jì)當(dāng)中,文件數(shù)數(shù)量計(jì)入統(tǒng)計(jì)當(dāng)中。

代碼示例

# -*- coding: utf-8 -*-
import os
import sys
import argparse
import urllib.parse
import tempfile
import shutil
import zipfile
import tarfile

EXTENSIONS = {
    '.py': 'python',
    '.js': 'javascript',
    '.ts': 'typescript',
    '.jsx': 'javascript',
    '.tsx': 'typescript',
    '.html': 'html',
    '.css': 'css',
    '.sql': 'sql',
    '.sh': 'shell',
    '.bat': 'batch',
    '.ps1': 'powershell',
    '.md': 'markdown',
    '.json': 'json',
    '.yaml': 'yaml',
    '.yml': 'yaml',
    '.xml': 'xml',
    '.txt': 'text',
    '.conf': 'config',
    '.ini': 'config',
    '.env': 'env',
    '.db': 'database',
    '.c': 'c',
    '.h': 'c',
    '.cpp': 'cpp',
    '.cc': 'cpp',
    '.cxx': 'cpp',
    '.hpp': 'cpp',
    '.java': 'java',
    '.go': 'go',
    '.rs': 'rust',
    '.swift': 'swift',
    '.kt': 'kotlin',
    '.scala': 'scala',
    '.rb': 'ruby',
    '.php': 'php',
    '.pl': 'perl',
    '.lua': 'lua',
    '.r': 'r',
    '.m': 'objective-c',
    '.mm': 'objective-c',
}

ARCHIVE_EXTENSIONS = {'.zip', '.tar', '.tar.gz', '.tar.bz2', '.tar.zst', '.tgz', '.gz', '.bz2', '.7z', '.rar'}

SKIP_DIRS = {'__pycache__', '.git', '.venv', 'venv', 'node_modules', '.pytest_cache', '.mypy_cache', 'dist', 'build', '.egg-info'}

def url_to_path(url_or_path):
    path = url_or_path.strip()
    if path.startswith('file://'):
        path = path.replace('file:///', '').replace('file://', '')
    elif '://' in path:
        parsed = urllib.parse.urlparse(path)
        path = parsed.path if parsed.path else parsed.netloc
    path = path.replace('/', os.sep).replace('\\', os.sep)
    if path.startswith('\\') and ':' not in path:
        path = path[1:]
    return path.rstrip('\\')

def split_archive_path(path):
    if os.path.exists(path):
        return path, ''
    
    lower_path = path.lower()
    all_extensions = ['.tar.gz', '.tar.bz2', '.tar.zst', '.tgz', '.zip', '.7z', '.rar', '.tar', '.gz', '.bz2']
    
    all_candidates = []
    
    for ext in all_extensions:
        ext_lower = ext.lower()
        start = 0
        while True:
            idx = lower_path.find(ext_lower, start)
            if idx == -1:
                break
            archive_path = path[:idx + len(ext)]
            sub_path = path[idx + len(ext):].lstrip('\\').lstrip('/')
            all_candidates.append((idx, archive_path, sub_path))
            start = idx + 1
    
    all_candidates.sort(key=lambda x: x[0])
    
    for idx, archive_path, sub_path in all_candidates:
        if os.path.exists(archive_path):
            return archive_path, sub_path
    
    return path, ''

def get_archive_ext(filename):
    name = filename.lower()
    if name.endswith('.tar.gz'):
        return '.tar.gz'
    elif name.endswith('.tar.bz2'):
        return '.tar.bz2'
    elif name.endswith('.tar.zst'):
        return '.tar.zst'
    for ext in ['.tar.gz', '.tar.bz2', '.tar.zst', '.tgz', '.zip', '.tar', '.gz', '.bz2', '.7z', '.rar']:
        if name.endswith(ext):
            return ext
    return os.path.splitext(filename)[1].lower()

def extract_archive(archive_path, extract_dir):
    ext = get_archive_ext(archive_path)
    base_name = os.path.splitext(archive_path)[0]
    if ext in ['.tar.gz', '.tar.bz2', '.tar.zst']:
        base_name = os.path.splitext(base_name)[0]
    
    temp_dir = tempfile.mkdtemp()
    
    try:
        if ext == '.zip':
            with zipfile.ZipFile(archive_path, 'r') as zip_ref:
                zip_ref.extractall(temp_dir)
                return temp_dir
        elif ext == '.tar':
            with tarfile.open(archive_path, 'r') as tar:
                tar.extractall(temp_dir, filter='data')
                return temp_dir
        elif ext == '.tar.gz' or ext == '.tgz':
            with tarfile.open(archive_path, 'r:gz') as tar:
                tar.extractall(temp_dir, filter='data')
                return temp_dir
        elif ext == '.tar.bz2':
            with tarfile.open(archive_path, 'r:bz2') as tar:
                tar.extractall(temp_dir, filter='data')
                return temp_dir
        elif ext == '.tar.zst':
            try:
                import zstandard
                with tarfile.open(archive_path, 'r:bz2') as tar:
                    tar.extractall(temp_dir, filter='data')
                    return temp_dir
            except ImportError:
                pass
        elif ext == '.gz':
            import gzip
            output_file = os.path.join(temp_dir, os.path.basename(base_name))
            with gzip.open(archive_path, 'rb') as f_in:
                with open(output_file, 'wb') as f_out:
                    shutil.copyfileobj(f_in, f_out)
            return temp_dir
        elif ext == '.bz2':
            import bz2
            output_file = os.path.join(temp_dir, os.path.basename(base_name))
            with bz2.open(archive_path, 'rb') as f_in:
                with open(output_file, 'wb') as f_out:
                    shutil.copyfileobj(f_in, f_out)
            return temp_dir
        elif ext == '.7z':
            import py7zr
            with py7zr.SevenZipFile(archive_path, 'r') as sz:
                sz.extractall(temp_dir)
            return temp_dir
        elif ext == '.rar':
            try:
                import rarfile
                with rarfile.RarFile(archive_path, 'r') as rf:
                    rf.extractall(temp_dir)
                return temp_dir
            except ImportError:
                try:
                    import subprocess
                    unrar_path = r'C:\Program Files\WinRAR\unrar.exe'
                    result = subprocess.run([unrar_path, 'x', '-o+', archive_path, temp_dir], capture_output=True)
                    if result.returncode == 0:
                        return temp_dir
                except Exception:
                    pass
    except Exception as e:
        print('Warning: Failed to extract ' + archive_path + ': ' + str(e))
    
    if temp_dir and os.path.exists(temp_dir):
        try:
            shutil.rmtree(temp_dir)
        except Exception:
            pass
    return None

def extract_zip_with_subdir(zip_path, sub_path, extract_dir):
    temp_dir = tempfile.mkdtemp()
    
    try:
        with zipfile.ZipFile(zip_path, 'r') as zip_ref:
            if sub_path:
                for member in zip_ref.namelist():
                    if member.startswith(sub_path + '/') or member == sub_path:
                        zip_ref.extract(member, temp_dir)
                new_base = temp_dir
                if sub_path:
                    actual_sub = os.path.join(temp_dir, sub_path)
                    if os.path.exists(actual_sub):
                        new_base = actual_sub
                return new_base
            else:
                zip_ref.extractall(temp_dir)
                return temp_dir
    except Exception as e:
        print('Warning: Failed to extract ' + zip_path + ' subdir ' + sub_path + ': ' + str(e))
    
    if temp_dir and os.path.exists(temp_dir):
        try:
            shutil.rmtree(temp_dir)
        except Exception:
            pass
    
    return None

def count_lines(file_path):
    try:
        with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
            lines = f.readlines()
    except Exception:
        try:
            with open(file_path, 'r', encoding='gbk', errors='ignore') as f:
                lines = f.readlines()
        except Exception:
            return 0, 0, 0, 0
    
    total_lines = len(lines)
    code_lines = 0
    blank_lines = 0
    comment_lines = 0
    
    in_multiline_comment = False
    ext = os.path.splitext(file_path)[1].lower()
    
    for line in lines:
        stripped = line.strip()
        
        if ext == '.py':
            if stripped.startswith('"""') or stripped.startswith("'''"):
                comment_lines += 1
                if stripped.count('"""') == 2 or stripped.count("'''") == 2:
                    continue
                in_multiline_comment = not in_multiline_comment
                continue
            if in_multiline_comment:
                comment_lines += 1
                continue
            if stripped.startswith('#'):
                comment_lines += 1
                continue
        elif ext in ['.js', '.ts', '.jsx', '.tsx', '.html', '.css', '.java', '.c', '.cpp', '.h', '.m', '.mm', '.swift', '.kt', '.scala', '.go', '.rs', '.rb', '.php', '.pl', '.lua', '.sh']:
            if '/*' in stripped and '*/' in stripped:
                comment_lines += 1
                continue
            if '/*' in stripped:
                comment_lines += 1
                in_multiline_comment = True
                continue
            if '*/' in stripped:
                comment_lines += 1
                in_multiline_comment = False
                continue
            if in_multiline_comment:
                comment_lines += 1
                continue
            if stripped.startswith('//'):
                comment_lines += 1
                continue
        elif ext == '.bat' or ext == '.ps1':
            if stripped.startswith('REM') or stripped.startswith('::'):
                comment_lines += 1
                continue
        
        if not stripped:
            blank_lines += 1
        else:
            code_lines += 1
    
    return total_lines, code_lines, blank_lines, comment_lines

def scan_directory(target_path, is_root=True):
    total_files = 0
    total_lines = 0
    code_lines = 0
    blank_lines = 0
    comment_lines = 0
    file_stats = {}
    
    nested_archives = []
    
    for dirpath, dirnames, filenames in os.walk(target_path):
        dirnames[:] = [d for d in dirnames if d not in SKIP_DIRS]
        
        for filename in filenames:
            file_path = os.path.join(dirpath, filename)
            ext = get_archive_ext(filename)
            
            if ext in ARCHIVE_EXTENSIONS:
                nested_archives.append(file_path)
                continue

            if ext not in EXTENSIONS:
                if ext in ('.xlsx', '.xls', '.xlsb', '.xlsm', '.csv'):
                    total_files += 1
                    lang = 'excel'
                    if lang not in file_stats:
                        file_stats[lang] = {'files': 0, 'lines': 0, 'code': 0, 'comment': 0}
                    file_stats[lang]['files'] += 1
                continue
            
            total_files += 1
            total, code, blank, comment = count_lines(file_path)
            total_lines += total
            code_lines += code
            blank_lines += blank
            comment_lines += comment
            
            lang = EXTENSIONS.get(ext, 'other')
            if lang not in file_stats:
                file_stats[lang] = {'files': 0, 'lines': 0, 'code': 0, 'comment': 0}
            file_stats[lang]['files'] += 1
            file_stats[lang]['lines'] += total
            file_stats[lang]['code'] += code
            file_stats[lang]['comment'] += comment
    
    for archive_path in nested_archives:
        print('  -> Found nested archive: ' + os.path.basename(archive_path))
        nested_dir = extract_archive(archive_path, None)
        if nested_dir:
            nested_results = scan_directory(nested_dir, False)
            if nested_results:
                total_files += nested_results['total_files']
                total_lines += nested_results['total_lines']
                code_lines += nested_results['code_lines']
                blank_lines += nested_results['blank_lines']
                comment_lines += nested_results['comment_lines']
                for lang, stats in nested_results['file_stats'].items():
                    if lang not in file_stats:
                        file_stats[lang] = {'files': 0, 'lines': 0, 'code': 0, 'comment': 0}
                    file_stats[lang]['files'] += stats['files']
                    file_stats[lang]['lines'] += stats['lines']
                    file_stats[lang]['code'] += stats['code']
                    file_stats[lang]['comment'] += stats['comment']
            try:
                shutil.rmtree(nested_dir)
            except Exception:
                pass
    
    return {
        'total_files': total_files,
        'total_lines': total_lines,
        'code_lines': code_lines,
        'blank_lines': blank_lines,
        'comment_lines': comment_lines,
        'file_stats': file_stats
    }

def process_nested_path(archive_path, sub_path, temp_dirs=None):
    if temp_dirs is None:
        temp_dirs = []
    
    if not sub_path:
        return archive_path, ''
    
    parts = sub_path.replace('\\', '/').split('/')
    current_path = archive_path
    
    for i, part in enumerate(parts):
        current_ext = get_archive_ext(current_path)
        
        if current_ext in ARCHIVE_EXTENSIONS:
            print('Extracting archive: ' + current_path)
            temp_dir = extract_archive(current_path, None)
            if not temp_dir:
                return None, None
            temp_dirs.append(temp_dir)
            
            target = os.path.join(temp_dir, part)
            if not os.path.exists(target):
                for root, dirs, files in os.walk(temp_dir):
                    if part in files:
                        target = os.path.join(root, part)
                        break
                    if part in dirs:
                        target = os.path.join(root, part)
                        break
            
            if not os.path.exists(target):
                print('Warning: ' + part + ' not found in archive')
                for td in temp_dirs:
                    try:
                        shutil.rmtree(td)
                    except:
                        pass
                return None, None
            
            current_path = target
        else:
            target = os.path.join(current_path, part)
            if not os.path.exists(target):
                for td in temp_dirs:
                    try:
                        shutil.rmtree(td)
                    except:
                        pass
                return None, None
            current_path = target
    
    return current_path, temp_dirs

def scan_path(target_path):
    if not os.path.exists(target_path):
        archive_path, sub_path = split_archive_path(target_path)
        if os.path.exists(archive_path) and sub_path:
            archive_ext = archive_path.lower()
            if archive_ext.endswith('.zip'):
                print('Extracting from archive: ' + archive_path)
                print('Subdirectory: ' + sub_path)
                scan_base = extract_zip_with_subdir(archive_path, sub_path, None)
                if scan_base and os.path.exists(scan_base):
                    print('Scanning subdirectory: ' + sub_path)
                    results = scan_directory(scan_base, None)
                    try:
                        shutil.rmtree(scan_base)
                    except Exception:
                        pass
                    if results:
                        results['is_archive'] = True
                        results['archive_name'] = os.path.basename(archive_path) + ' / ' + sub_path
                    return results
            elif archive_ext.endswith(('.7z', '.rar', '.tar', '.tar.gz', '.tar.bz2', '.tgz', '.gz', '.bz2')):
                final_path, temp_dirs = process_nested_path(archive_path, sub_path)
                if final_path:
                    final_ext = get_archive_ext(final_path) if os.path.isfile(final_path) else ''
                    if final_ext in ARCHIVE_EXTENSIONS:
                        results = scan_path(final_path)
                        for td in temp_dirs:
                            try:
                                shutil.rmtree(td)
                            except:
                                pass
                        if results:
                            results['is_archive'] = True
                            results['archive_name'] = os.path.basename(archive_path) + ' / ' + sub_path
                        return results
                    elif os.path.isfile(final_path):
                        results = scan_path(final_path)
                        for td in temp_dirs:
                            try:
                                shutil.rmtree(td)
                            except:
                                pass
                        if results:
                            results['is_archive'] = True
                            results['archive_name'] = os.path.basename(archive_path) + ' / ' + sub_path
                        return results
                    elif os.path.isdir(final_path):
                        print('Scanning subdirectory: ' + sub_path)
                        results = scan_directory(final_path, None)
                        for td in temp_dirs:
                            try:
                                shutil.rmtree(td)
                            except:
                                pass
                        if results:
                            results['is_archive'] = True
                            results['archive_name'] = os.path.basename(archive_path) + ' / ' + sub_path
                        return results
                for td in temp_dirs:
                    try:
                        shutil.rmtree(td)
                    except:
                        pass
                return None
        print('Error: Path does not exist - ' + target_path)
        return None
    
    ext = get_archive_ext(target_path)
    
    if ext in ARCHIVE_EXTENSIONS:
        print('Extracting archive: ' + target_path)
        extract_dir = None
        nested_dir = extract_archive(target_path, extract_dir)
        if nested_dir:
            print('Scanning files (including nested archives)...')
            results = scan_directory(nested_dir, extract_dir)
            try:
                shutil.rmtree(nested_dir)
            except Exception:
                pass
            if results:
                results['is_archive'] = True
                results['archive_name'] = os.path.basename(target_path)
            return results
        else:
            print('Error: Unsupported archive format - ' + target_path)
            return None
    
    if os.path.isfile(target_path):
        file_ext = get_archive_ext(target_path)
        if file_ext not in EXTENSIONS:
            print('Error: Unsupported file type - ' + target_path)
            return None
        
        total, code, blank, comment = count_lines(target_path)
        lang = EXTENSIONS.get(file_ext, 'other')
        
        return {
            'total_files': 1,
            'total_lines': total,
            'code_lines': code,
            'blank_lines': blank,
            'comment_lines': comment,
            'file_stats': {lang: {'files': 1, 'lines': total, 'code': code, 'comment': comment}}
        }
    
    if not os.path.isdir(target_path):
        print('Error: Path is not a valid file or directory - ' + target_path)
        return None
    
    return scan_directory(target_path)

def print_results(results, root_path):
    display_name = results.get('archive_name', root_path)
    if results.get('is_archive'):
        print('\n' + '=' * 60)
        print('Archive: ' + display_name)
        print('=' * 60)
    else:
        print('\n' + '=' * 60)
        print('Directory: ' + display_name)
        print('=' * 60)
    
    print('\nTotal Statistics:')
    print('   Total files:     ' + str(results['total_files']))
    print('   Code lines:     ' + str(results['code_lines']))
    print('   Comment lines:  ' + str(results['comment_lines']))
    print('   Blank lines:    ' + str(results['blank_lines']))
    print('   Total lines:    ' + str(results['total_lines']))
    
    if results['file_stats']:
        print('\nStatistics by file type:')
        print('-' * 65)
        print('{:<15} {:>6} {:>10} {:>10} {:>10} {:>10}'.format('Type', 'Files', 'Code', 'Comment', 'Blank', 'Total'))
        print('-' * 65)
        
        sorted_stats = sorted(results['file_stats'].items(), key=lambda x: x[1]['code'], reverse=True)
        for lang, stats in sorted_stats:
            blank = stats['lines'] - stats['code'] - stats['comment']
            print('{:<15} {:>6} {:>10} {:>10} {:>10} {:>10}'.format(
                lang, stats['files'], stats['code'], stats['comment'], blank, stats['lines']))
    
    print('=' * 60)

def main():
    parser = argparse.ArgumentParser(
        description='Count files and lines of code in a directory, file, or archive (including nested)',
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog='''
Examples:
  python counter_code_Ultra.py "C:\\path\\to\\directory"
  python counter_code_Ultra.py  "C:\\path\\to\\file.py"
  python counter_code_Ultra.py  "C:\\path\\to\\archive.zip"
  python counter_code_Ultra.py  "C:\\path\\to\\archive.zip\\subdir"
  python counter_code_Ultra.py "C:\\path\\to\\nested.tar.gz"
        '''
    )
    
    parser.add_argument(
        'path', 
        nargs='?', 
        default='C:\\Users\\your_username\\Documents\\Vscode',
        help='Directory, file, or archive path to scan'
    )
    
    args = parser.parse_args()
    
    target_path = url_to_path(args.path)
    
    print('Scanning: ' + target_path)
    
    results = scan_path(target_path)
    
    if results:
        print_results(results, target_path)
    else:
        sys.exit(1)

if __name__ == '__main__':
    main()

優(yōu)化與建議

無法統(tǒng)計(jì)Github、Gitee等遠(yuǎn)程文件的代碼行數(shù),增加遠(yuǎn)程功能。

無法分清楚統(tǒng)計(jì)每個(gè)用戶用git上傳了多少行代碼,增加用戶統(tǒng)計(jì)功能。

實(shí)際上有些公司以消耗Token值作為KPI,此種情況實(shí)用性低。

以上就是Python一鍵實(shí)現(xiàn)統(tǒng)計(jì)本地文件或壓縮包的代碼行數(shù)的詳細(xì)內(nèi)容,更多關(guān)于Python統(tǒng)計(jì)代碼行數(shù)的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • python實(shí)現(xiàn)雙人版坦克大戰(zhàn)游戲

    python實(shí)現(xiàn)雙人版坦克大戰(zhàn)游戲

    這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)雙人版坦克大戰(zhàn)游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2021-12-12
  • python3多重排序處理多數(shù)據(jù)的示例詳解

    python3多重排序處理多數(shù)據(jù)的示例詳解

    Python3的多重排序通常指的是對(duì)數(shù)據(jù)集合按照兩個(gè)或多個(gè)人數(shù)屬性進(jìn)行排序的過程,這可以通過將多個(gè)排序關(guān)鍵字作為元組傳遞給內(nèi)置的sorted()函數(shù)或者是使用列表推導(dǎo)式結(jié)合lambda函數(shù)完成,本文詳細(xì)分析了python3多重排序處理多數(shù)據(jù),需要的朋友可以參考下
    2024-07-07
  • 用Python展示動(dòng)態(tài)規(guī)則法用以解決重疊子問題的示例

    用Python展示動(dòng)態(tài)規(guī)則法用以解決重疊子問題的示例

    這篇文章主要介紹了用Python展示動(dòng)態(tài)規(guī)則法用以解決重疊子問題的一個(gè)棋盤游戲的示例,動(dòng)態(tài)規(guī)劃常常適用于有重疊子問題和最優(yōu)子結(jié)構(gòu)性質(zhì)的問題,且耗時(shí)間往往遠(yuǎn)少于樸素解法,需要的朋友可以參考下
    2015-04-04
  • 跟老齊學(xué)Python之玩轉(zhuǎn)字符串(2)更新篇

    跟老齊學(xué)Python之玩轉(zhuǎn)字符串(2)更新篇

    本文是玩轉(zhuǎn)字符串的續(xù)篇,繼續(xù)對(duì)字符串的連接方法進(jìn)行介紹,以及字符串復(fù)制、字符串長(zhǎng)度、字符大小寫的轉(zhuǎn)換。非常不錯(cuò)的文章,希望對(duì)大家有所幫助
    2014-09-09
  • Python如何截圖保存的三種方法(小結(jié))

    Python如何截圖保存的三種方法(小結(jié))

    這篇文章主要介紹了Python如何截圖保存的三種方法(小結(jié)),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-09-09
  • python光學(xué)仿真通過菲涅耳公式實(shí)現(xiàn)波動(dòng)模型

    python光學(xué)仿真通過菲涅耳公式實(shí)現(xiàn)波動(dòng)模型

    這篇文章主要介紹了python光學(xué)仿真通過菲涅耳公式實(shí)現(xiàn)波動(dòng)模型的示例解析原理,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步
    2021-10-10
  • 一文詳解Python包管理工具uv的核心命令使用

    一文詳解Python包管理工具uv的核心命令使用

    這篇文章將帶大家從零開始,全面掌握 uv 的下載、安裝、核心命令使用,并深入剖析它為何被譽(yù)為Python 工具鏈的未來,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2026-02-02
  • pytorch加載自己的數(shù)據(jù)集源碼分享

    pytorch加載自己的數(shù)據(jù)集源碼分享

    這篇文章主要介紹了pytorch加載自己的數(shù)據(jù)集源碼分享,標(biāo)準(zhǔn)的數(shù)據(jù)集流程梳理分為數(shù)據(jù)準(zhǔn)備以及加載數(shù)據(jù)庫–>數(shù)據(jù)加載器的調(diào)用或者設(shè)計(jì)–>批量調(diào)用進(jìn)行訓(xùn)練或者其他作用,需要的朋友可以參考下
    2022-08-08
  • Django如何開發(fā)簡(jiǎn)單的查詢接口詳解

    Django如何開發(fā)簡(jiǎn)單的查詢接口詳解

    這篇文章主要給大家介紹了使用Django如何開發(fā)簡(jiǎn)單的查詢接口的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家學(xué)習(xí)或者使用Django具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-05-05
  • 關(guān)于python的縮進(jìn)規(guī)則的知識(shí)點(diǎn)詳解

    關(guān)于python的縮進(jìn)規(guī)則的知識(shí)點(diǎn)詳解

    在本篇文章里小編給大家整理了關(guān)于python的縮進(jìn)規(guī)則的知識(shí)點(diǎn)詳解,有興趣的朋友們可以學(xué)習(xí)下。
    2020-06-06

最新評(píng)論

津市市| 洛阳市| 洮南市| 美姑县| 桂平市| 文安县| 抚远县| 衢州市| 观塘区| 宁强县| 荔波县| 营山县| 郯城县| 永丰县| 偏关县| 怀安县| 沧州市| 务川| 吉林省| 财经| 新和县| 达拉特旗| 射洪县| 寻乌县| 太白县| 新建县| 清涧县| 车致| 磴口县| 冷水江市| 枣强县| 洛宁县| 大姚县| 辽宁省| 儋州市| 浪卡子县| 乐业县| 岳池县| 门源| 吴堡县| 东兰县|