展开菜单
首页 精品内容 本月促销 装机必备 Windows PDF教程 macOS软件 IOS软件 Android AI 专题
全部分类

当前位置:

首页 > 编程开发 > Python基础指南之逻辑运算符and or not的应用详解

Python基础指南之逻辑运算符and or not的应用详解

Python逻辑运算符and、or、not具有短路求值特性,能返回操作数本身而非布尔值。and要求所有操作数为真才真,or任一为真即真,not取反。实际应用中,它们常被用于条件判断、条件赋值、设置默认值、避免除零等错误,有效简化if-else结构,提升代码简洁性与可读性。

本文目录

    一、开篇:逻辑——程序的决策核心

    程序说到底,就是一连串“如果……就……”的决策拼图。而让这些决策得以运转的,正是三个基础得不能再基础的逻辑运算符——and(与)、or(或)、not(非)。

    Python基础指南之逻辑运算符and or not的应用详解

    先快速感受一下它们的日常画风:

    # 每天都会写的逻辑判断
    if age >= 18 and has_id_card:
        print("允许进入")
    
    if is_vip or total_amount > 1000:
        print("免运费")
    
    if not is_banned:
        print("可以发帖")
    

    但Python的逻辑运算符远比表面看起来的那张“布尔表”要深邃得多。它们有短路求值的特性,有返回操作数本身而非布尔值的独特行为,还有在各种Python惯用写法中的巧妙应用。今天这篇文章,我们就一起从入门到精通,彻底搞懂Python逻辑运算符的所有门道。

    1.1 先做个测试

    # 这些表达式的结果是什么?
    print(3 and 5)           # ?
    print(0 and 5)           # ?
    print(3 or 5)            # ?
    print(0 or 5)            # ?
    print(not 3)             # ?
    print(not 0)             # ?
    print([] and "hello")    # ?
    print("" or "default")   # ?
    

    如果你的第一反应全是True和False,那说明你还需要更深入一些。正确答案我们稍后揭晓。

    二、逻辑运算符的基本功能

    2.1 and —— 逻辑与

    and要求两边都为真,结果才为真:

    # and 的真值表
    print(True and True)    # True
    print(True and False)   # False
    print(False and True)   # False
    print(False and False)  # False
    
    # 实际应用
    age = 25
    has_ticket = True
    can_enter = age >= 18 and has_ticket
    print(can_enter)        # True
    
    # 多个and连用
    score = 85
    is_valid_score = 0 <= score and score <= 100
    # 等价于链式比较:0 <= score <= 100
    

    2.2 or —— 逻辑或

    or要求两边至少有一边为真,结果就为真:

    # or 的真值表
    print(True or True)     # True
    print(True or False)    # True
    print(False or True)    # True
    print(False or False)   # False
    
    # 实际应用
    is_vip = False
    total_amount = 1500
    free_shipping = is_vip or total_amount >= 1000
    print(free_shipping)    # True —— 金额够了
    
    # 多条件或
    is_admin = False
    is_moderator = False
    is_author = True
    can_edit = is_admin or is_moderator or is_author
    print(can_edit)         # True
    

    2.3 not —— 逻辑非

    not取反:真变假,假变真:

    # not 的真值表
    print(not True)     # False
    print(not False)    # True
    
    # 实际应用
    is_banned = False
    if not is_banned:
        print("账号正常,可以操作")
    
    # 双重否定 —— 将任意值转为布尔值
    print(not not 42)   # True
    print(not not "")   # False
    print(not not [])   # False
    
    # not 的优先级高于 and 和 or
    print(not True and False)    # False —— (not True) and False
    print(not (True and False))  # True  —— not (False)
    

    三、短路求值:Python逻辑运算的核心特性

    3.1 什么是短路求值

    短路求值(short-circuit evaluation)简单说就是:逻辑运算符一旦能确定最终结果,就不再计较后面的表达式了。这不仅是为了性能,更是编程中一种精妙的控制流手段。

    # and 的短路:如果左边为假,右边不会执行
    def check_expensive():
        print("执行了耗时检查...")
        return True
    
    result = False and check_expensive()
    print(result)    # False
    # 注意:没有输出"执行了耗时检查..."!
    
    # or 的短路:如果左边为真,右边不会执行
    result = True or check_expensive()
    print(result)    # True
    # 同样没有输出"执行了耗时检查..."
    

    3.2 短路求值的实际价值

    # 场景1:安全地访问可能为None的对象
    user = None
    # 传统写法
    if user is not None:
        print(user.name)
    
    # 短路写法
    print(user and user.name)    # None —— 不会尝试访问None.name
    # user为None(假值),直接返回None,不执行user.name
    
    user = type('User', (), {'name': '张三'})()
    print(user and user.name)    # 张三
    
    # 场景2:使用默认值
    username = "" or "匿名用户"
    print(username)    # 匿名用户 —— "为空字符串(假值),返回默认值
    
    config_host = None
    host = config_host or "localhost"
    print(host)        # localhost
    
    # 场景3:条件执行
    # 只有当列表非空时才计算其长度
    data = [1, 2, 3, 4, 5]
    result = data and len(data) > 3
    print(result)      # True
    
    empty_data = []
    result = empty_data and len(empty_data) > 3
    print(result)      # False —— 不报错!len(empty_data)没被执行
    
    # 场景4:避免除零错误
    def safe_division(a, b):
        """安全除法:b为0时返回None而非抛出异常"""
        return b != 0 and a / b
    
    print(safe_division(10, 2))    # 5.0
    print(safe_division(10, 0))    # False(而非ZeroDivisionError!)
    
    # 改进版:返回None
    def safe_division2(a, b):
        return b != 0 and a / b or None
    
    # 但这个版本有bug!因为a/b等于0时会被当作假值
    # 更好的实现:
    def safe_division3(a, b):
        if b == 0:
            return None
        return a / b
    

    四、核心知识点:and和or返回的是操作数,不是布尔值

    4.1 这是Python逻辑运算符最重要的特性

    现在来揭晓开篇测试题的正确答案——注意,答案很可能跟你想的不一样:

    # Python的逻辑运算符返回操作数本身,而非单纯的True/False!
    
    # and 的规则:
    # 如果左边为假值 → 返回左边
    # 如果左边为真值 → 返回右边
    
    print(3 and 5)           # 5 —— 3是真值,所以返回右边的5
    print(0 and 5)           # 0 —— 0是假值,短路返回0
    print([] and "hello")    # [] —— 空列表是假值,返回[]
    print("hi" and "world")  # world —— "hi"是真值,返回"world"
    
    # or 的规则:
    # 如果左边为真值 → 返回左边
    # 如果左边为假值 → 返回右边
    
    print(3 or 5)            # 3 —— 3是真值,短路返回3
    print(0 or 5)            # 5 —— 0是假值,返回右边的5
    print("" or "default")   # default —— ""是假值,返回"default"
    print("hello" or "bye")  # hello —— "hello"是真值,返回"hello"
    
    # not 的规则:始终返回布尔值 True 或 False
    print(not 3)             # False
    print(not 0)             # True
    print(not [])            # True
    print(not "hello")       # False
    

    4.2 这个特性的实际威力

    正因为and和or返回的是操作数本身,它们就可以被用来做选择性取值——这比硬生生地写if-else要简洁得多。

    # or 的经典用法:提供默认值
    # 等价于:如果a为假值,则使用b作为默认值
    name = user_input or "匿名用户"
    port = env_port or 8080
    path = config_path or "/default/path"
    
    # 但注意0和空字符串也是假值!
    def get_limit(limit):
        """获取分页限制,默认为10"""
        return limit or 10
    
    print(get_limit(20))   # 20 —— limit不为0,正常返回
    print(get_limit(0))    # 10 —— 0是假值!这可能不是期望的行为!
    
    # ✅ 更精确的默认值处理
    def get_limit_v2(limit):
        """如果limit是None则用默认10,否则用limit本身(包括0)"""
        return limit if limit is not None else 10
    
    print(get_limit_v2(20))   # 20
    print(get_limit_v2(0))    # 0 —— 正确!
    print(get_limit_v2(None)) # 10
    
    # and 的经典用法:条件取值
    # 只有满足条件时才取后面的值
    result = is_valid and compute_expensive_value()
    # 等价于:result = compute_expensive_value() if is_valid else is_valid
    
    # 链式使用
    a = 10
    b = 20
    c = 0
    # 返回第一个假值,或最后一个值
    print(a and b and c)  # 0 —— c是假值,返回c
    print(a and b)        # 20 —— a和b都是真值,返回最后一个
    

    五、Python中的真值测试

    5.1 哪些值是"假的"

    要玩转逻辑运算符,必须先搞清楚Python里什么样的东西会被当作“假”。

    # Python中以下值是"假值"(falsy):
    # 1. False
    # 2. None
    # 3. 0(包括 0, 0.0, 0j, Decimal(0), Fraction(0, 1))
    # 4. 空的序列和集合:'', (), [], {}, set(), range(0)
    # 5. 自定义类中定义了 __bool__ 或 __len__ 且返回False/0
    
    falsy_values = [
        False,
        None,
        0,
        0.0,
        0j,
        '',
        [],
        (),
        {},
        set(),
        range(0),
        frozenset(),
    ]
    
    for v in falsy_values:
        print(f"{v!r:12} → bool = {bool(v)}")
    
    # 输出均为False
    
    # 除了以上这些,其他所有值都是真值!
    truthy_values = [
        True,
        1, -1, 0.001,
        " ", "False", "0",
        [None], [[]],
        {None: None},
        object(),
        lambda: None,
    ]
    
    for v in truthy_values:
        print(f"{v!r:15} → bool = {bool(v)}")
    # 输出均为True
    

    5.2 常见误区

    # 误区1:"False" 字符串是真值
    print(bool("False"))    # True —— 非空字符串都是真值!
    
    # 误区2:[None] 是真值
    print(bool([None]))     # True —— 非空列表都是真值!
    
    # 误区3:只检查是否为None时用 or
    count = 0
    result = count or 10    # 10 —— 但0可能是合法的count值!
    # ✅ 正确做法:
    result = count if count is not None else 10  # 0
    
    # 误区4:将或条件写成数学形式
    # ❌ 错误写法
    # if status == "active" or "pending":   # 这总是True!
    # 等价于 if (status == "active") or "pending":
    # "pending"是非空字符串,永远为True
    
    # ✅ 正确写法
    if status == "active" or status == "pending":
        pass
    # 或
    if status in ("active", "pending"):
        pass
    

    六、逻辑运算符的优先级与组合

    6.1 优先级顺序

    # 优先级从高到低:
    # not > and > or
    
    # 示例1:
    result = not True and False or True
    # 等价于:((not True) and False) or True
    # = (False and False) or True
    # = False or True
    # = True
    print(result)    # True
    
    # 示例2:
    result = True or False and False
    # 等价于:True or (False and False)
    # = True or False
    # = True
    print(result)    # True
    
    # 示例3:
    result = True and not False or False
    # 等价于:(True and (not False)) or False
    # = (True and True) or False
    # = True or False
    # = True
    print(result)    # True
    
    # ? 建议:复杂的逻辑表达式加括号,提高可读性
    # 好:
    result = (a > 0) and (b < 10) or (c is None)
    # 不好:
    result = a > 0 and b < 10 or c is None  # 虽然效果相同,但对读者不友好
    

    6.2 逻辑运算符与其他运算符的优先级

    # 比较运算符 > 逻辑运算符
    # 即:>、<、== 高于 not、and、or
    
    result = 5 > 3 and 10 < 20
    # 等价于:(5 > 3) and (10 < 20)
    
    result = not 5 == 3
    # 等价于:not (5 == 3)
    
    # 完整优先级链(从高到低):
    # ** (幂运算)
    # +x, -x, ~x (一元运算符)
    # *, /, //, %
    # +, - (二元加减)
    # <<, >> (移位)
    # & (按位与)
    # ^ (按位异或)
    # | (按位或)
    # ==, !=, >, <, >=, <=, is, is not, in, not in
    # not
    # and
    # or
    # = (赋值)
    

    七、逻辑运算符的惯用写法

    7.1 or 设置默认值

    # 经典模式:使用or设置默认值
    def get_config(key, default=None):
        """从环境变量或配置文件中获取配置"""
        import os
        value = os.environ.get(key) or default
        return value
    
    # 注意区分:None  vs  假值
    # or 对 0, "", [] 等也会启用默认值
    def process(data, limit=None):
        limit = limit or 100    # 如果limit是0,也会变成100!
        # ... 
    
    # Python 3.10+ 更好的默认值写法
    def get_data(timeout=None):
        timeout = timeout or 30  # 老写法
        
    # 如果需要区分None和0:
    def get_data_v2(timeout=None):
        if timeout is None:
            timeout = 30
        return timeout
    

    7.2 and 条件执行

    # 模式:只有条件满足时才执行操作
    def log_if_enabled(message, enabled=True):
        """如果日志启用,则记录消息"""
        return enabled and print(f"[LOG] {message}")
    
    log_if_enabled("操作成功")       # [LOG] 操作成功
    log_if_enabled("操作失败", False)  # 什么都不输出
    
    # 模式:链式访问可能不存在的属性
    user = None
    # 安全的属性访问
    name = user and user.profile and user.profile.name
    print(name)  # None —— 不会因为None没有profile而抛异常
    
    user = type('User', (), {'profile': type('Profile', (), {'name': '张三'})()})()
    name = user and user.profile and user.profile.name
    print(name)  # 张三
    

    7.3 not 取反与双重否定

    # not 用于反转条件
    is_empty = not data       # 等价于 len(data) == 0
    is_invalid = not is_valid
    
    # 双重否定将任意值转为布尔值
    # 这等价于 bool(x)
    print(not not "hello")    # True
    print(not not 0)          # False
    print(not not [1, 2])     # True
    
    # 在实际中,bool(x)更清晰
    print(bool("hello"))      # True —— 比 not not x 更可读
    

    7.4 三元表达式 vs 逻辑运算符

    # Python中的三元表达式
    value = a if condition else b
    
    # 用逻辑运算符"模拟"三元表达式(不推荐但值得理解)
    # condition and true_value or false_value
    # 注意:这个模式有bug!当true_value为假值时失效
    
    x = 5
    result = (x > 0) and "正数" or "非正数"
    print(result)  # 正数 —— 正确
    
    x = -5
    result = (x > 0) and "正数" or "非正数"
    print(result)  # 非正数 —— 正确
    
    x = 5
    result = (x > 0) and "" or "非正数"
    print(result)  # 非正数 —— 错误!""是假值,短路到了or的另一边!
    
    # ✅ 所以Python 2.5引入了真正的三元表达式
    result = "正数" if x > 0 else "非正数"
    print(result)  # 正数 —— 总是正确
    

    八、any() 和 all() —— 批量逻辑判断

    8.1 基本用法

    # all(): 所有元素都为真 → True(等价于对可迭代对象做 and)
    # any(): 任一元素为真 → True(等价于对可迭代对象做 or)
    
    # all() —— 全部为真
    print(all([True, True, True]))     # True
    print(all([True, False, True]))    # False
    print(all([1, 2, 3]))              # True(所有非零)
    print(all([1, 0, 3]))              # False
    print(all([]))                     # True!空可迭代对象返回True
    
    # any() —— 存在为真
    print(any([True, False, False]))   # True
    print(any([False, False, False]))  # False
    print(any([0, 0, 1]))              # True
    print(any([]))                     # False!空可迭代对象返回False
    

    8.2 实际应用

    # 场景1:验证多个条件
    def validate_user(user):
        """用户信息完整性验证"""
        conditions = [
            user.get("name"),           # 名字不能为空
            user.get("age", 0) >= 18,   # 年龄不小于18
            "@" in user.get("email", ""), # 邮箱包含@
            len(user.get("password", "")) >= 8, # 密码至少8位
        ]
        return all(conditions)
    
    user1 = {"name": "张三", "age": 25, "email": "zhangsan@example.com", "password": "12345678"}
    user2 = {"name": "", "age": 17, "email": "invalid", "password": "123"}
    
    print(validate_user(user1))    # True
    print(validate_user(user2))    # False
    
    # 场景2:权限检查
    def has_any_permission(user, required_permissions):
        """用户是否拥有至少一项所需权限"""
        user_perms = set(user.get("permissions", []))
        return any(p in user_perms for p in required_permissions)
    
    user = {"name": "张三", "permissions": ["read", "comment"]}
    print(has_any_permission(user, ["admin", "moderator"]))    # False
    print(has_any_permission(user, ["admin", "read"]))        # True
    
    # 场景3:数据质量检查
    def is_clean_row(row):
        """检查数据行是否完整(所有字段非空)"""
        return all(row.values())
    
    rows = [
        {"name": "张三", "age": 25, "city": "北京"},
        {"name": "李四", "age": None, "city": "上海"},
        {"name": "", "age": 30, "city": "广州"},
    ]
    clean_rows = [r for r in rows if is_clean_row(r)]
    print(f"清洗后剩{len(clean_rows)}行")
    
    # 场景4:检查字符串特征
    def is_strong_password(password):
        """检查密码是否满足多个条件"""
        checks = [
            len(password) >= 8,
            any(c.isupper() for c in password),    # 至少一个大写字母
            any(c.islower() for c in password),    # 至少一个小写字母
            any(c.isdigit() for c in password),    # 至少一个数字
            any(not c.isalnum() for c in password), # 至少一个特殊字符
        ]
        return all(checks)
    
    print(is_strong_password("Abc123!@"))   # True
    print(is_strong_password("abc123"))     # False —— 没有大写和特殊字符
    

    九、实战案例

    9.1 表单验证器

    class FormValidator:
        """表单验证器,展示逻辑运算符的组合使用"""
        
        def __init__(self, data):
            self.data = data
            self.errors = []
        
        def required(self, field, message=None):
            """必填字段验证"""
            value = self.data.get(field)
            if not value:  # 空字符串、None、0都视为未填写
                self.errors.append(message or f"{field}为必填项")
            return self  # 链式调用
        
        def min_length(self, field, length, message=None):
            """最小长度验证"""
            value = self.data.get(field, "")
            if value and len(value) < length:
                self.errors.append(message or f"{field}至少需要{length}个字符")
            return self
        
        def is_email(self, field, message=None):
            """邮箱格式验证"""
            value = self.data.get(field, "")
            if value and ("@" not in value or "." not in value.split("@")[-1]):
                self.errors.append(message or f"{field}不是有效的邮箱地址")
            return self
        
        def is_valid(self):
            """是否通过验证"""
            return not self.errors  # 无错误 = 验证通过
        
        def get_errors(self):
            """获取所有错误"""
            return self.errors
    
    # 使用
    form_data = {
        "username": "",
        "password": "123",
        "email": "invalid_email",
    }
    
    validator = (FormValidator(form_data)
        .required("username", "用户名不能为空")
        .required("password", "密码不能为空")
        .min_length("password", 6, "密码至少6位")
        .is_email("email", "邮箱格式不正确")
    )
    
    if not validator.is_valid():
        for error in validator.get_errors():
            print(f"❌ {error}")
    else:
        print("✅ 验证通过")
    

    9.2 智能搜索过滤器

    class SmartFilter:
        """智能过滤器:组合多个条件筛选数据"""
        
        def __init__(self, items):
            self.items = items
            self.conditions = []
        
        def add_condition(self, condition, required=True):
            """添加筛选条件
            condition: 一个函数,接受item返回bool
            required: 是否必须满足
            """
            self.conditions.append((condition, required))
            return self
        
        def apply(self):
            """应用所有条件,返回筛选结果"""
            results = []
            for item in self.items:
                # 所有required条件必须满足(and),非required条件至少满足一个(or)
                required_passed = all(cond(item) for cond, req in self.conditions if req)
                optional_passed = any(cond(item) for cond, req in self.conditions if not req)
                
                if required_passed and (optional_passed or not any(not req for _, req in self.conditions)):
                    results.append(item)
            
            return results
    
    # 使用:筛选商品
    products = [
        {"name": "MacBook Pro", "price": 12999, "brand": "Apple", "category": "笔记本"},
        {"name": "ThinkPad X1", "price": 8999, "brand": "Lenovo", "category": "笔记本"},
        {"name": "iPad Air", "price": 4999, "brand": "Apple", "category": "平板"},
        {"name": "Surface Pro", "price": 6999, "brand": "Microsoft", "category": "平板"},
        {"name": "MacBook Air", "price": 7999, "brand": "Apple", "category": "笔记本"},
    ]
    
    filtered = (SmartFilter(products)
        .add_condition(lambda p: p["category"] == "笔记本")      # 必须是笔记本
        .add_condition(lambda p: p["price"] < 10000)            # 价格低于10000
        .add_condition(lambda p: p["brand"] == "Apple", required=False)  # 最好是Apple
        .apply()
    )
    
    for p in filtered:
        print(f"{p['name']} - ¥{p['price']} ({p['brand']})")
    

    十、本章小结

    本文我们把Python逻辑运算符的方方面面拆了个底朝天:

    1. 三个基本运算符:and(逻辑与)、or(逻辑或)、not(逻辑非)。
    2. 短路求值:and左边为假则短路,or左边为真则短路。这不仅是性能优化,更是安全编程的重要手段。
    3. 最关键的知识点:and和or返回操作数本身,而非布尔值。这使它们可以用于选择性取值(value = a or default)和条件执行(condition and action())。
    4. 真值测试:False、None、0、空序列/集合是假值,其余都是真值。注意"False"、[None]等的陷阱。
    5. 优先级:not > and > or。复杂表达式建议加括号。
    6. 惯用写法:or设置默认值、and条件执行、any()/all()批量判断,这些都是写出Pythonic代码的重要技巧。

    逻辑运算符是编程中最常用的运算符之一。正确理解它们的特性,能让你写出更简洁、更安全、更优雅的Python代码。

    本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系bd@zhengruan.com
    作者最新文章
    编程开发 Python
    相关文章 更多
    精品专题 更多
    装机必备

    正软商城装机必备专区,精选办公、浏览器、安全防护、影音播放、压缩解压、设计创作和系统工具等电脑常用正版软件,帮助用户快速完成新电脑软件配置。

    Windows

    正软商城Windows软件专区,汇集适用于Windows电脑的办公、设计、安全防护、影音播放、开发工具和系统优化软件,提供软件介绍、系统要求、正版授权及购买下载服务。

    PDF教程

    正软商城PDF教程频道提供PDF编辑、转换、合并、拆分、压缩及格式处理方法,同时介绍常用PDF软件和工具的使用技巧。

    macOS软件

    正软商城macOS软件专区,精选适用于Mac电脑的办公、设计、影音、效率、开发和系统工具,提供软件功能介绍、macOS兼容版本、正版授权及购买下载服务。

    IOS软件

    正软商城iOS软件专区,精选适用于iPhone和iPad的办公、学习、影音、设计、效率及AI应用,提供功能介绍、适用设备、系统要求和正版获取方式等信息。

    AI

    正软商城AI软件专区,汇集AI写作、AI绘画、AI视频、AI办公、AI编程、AI翻译、智能客服和数据分析等人工智能工具,提供功能介绍、适用平台、收费方式及正版购买信息。

    Mac软件 更多
    Postman macOS版
    Postman macOS版

    Postman是一套面向API全生命周期的开发与测试平台,可在Mac上发送和调试多种协议请求,管理集合、环境及认证信息,并完成脚本测试、模拟服务、监控、文档发布和团队协作。它适合开发、测试及运维人员使用,提供个人免费方案。

    Docker Desktop macOS版
    Docker Desktop macOS版

    Docker Desktop 是 Docker 官方为 Mac 提供的容器开发环境,集成 Docker Engine、命令行工具、Compose、Build、Kubernetes 与图形化管理界面。

    Android Studio macOS版
    Android Studio macOS版

    Android Studio 是 Google 面向安卓应用开发提供的官方集成开发环境,基于 IntelliJ IDEA 构建。它整合智能代码编辑、Gradle 构建、界面预览、设备模拟、性能分析、调试测试及 APK 分析等工具。

    Xcode macOS版
    Xcode macOS版

    Xcode 是苹果面向 Mac 提供的官方集成开发环境,将代码编辑、项目构建、SwiftUI 实时预览、设备模拟、自动化测试、断点调试、性能分析和应用分发整合在同一套工作流中,适合开发与维护 iPhone、iPad、Mac、Apple Wa

    JetBrains WebStorm macOS版
    JetBrains WebStorm macOS版

    JetBrains WebStorm 是面向 JavaScript、TypeScript 和现代 Web 技术的专业集成开发环境,可智能理解项目结构,提供代码补全、重构、错误检查、运行调试、测试及 Git 工具。

    PhpStorm macOS版
    PhpStorm macOS版

    PhpStorm 是 JetBrains 推出的专业 PHP 集成开发环境,可在 Mac 上完成代码编写、智能检查、重构、调试、测试和数据库管理。它支持主流 PHP 框架、Composer、Git、Docker 与远程解释器。

    JetBrains PyCharm macOS版
    JetBrains PyCharm macOS版

    JetBrains PyCharm 是面向 Python 开发者的集成开发环境,提供智能补全、代码检查、重构、调试、测试、版本控制及虚拟环境管理功能。Mac 版兼容 Intel 与 Apple 芯片,核心功能可免费使用。

    JetBrains IntelliJ IDEA macOS版
    JetBrains IntelliJ IDEA macOS版

    IntelliJ IDEA 是 JetBrains 推出的专业集成开发环境,重点服务于 Java、Kotlin 与 JVM 项目开发。软件集成代码补全、静态检查、重构、调试、测试、版本控制及构建工具,并可借助插件扩展语言和框架支持。

    Visual Studio Code macOS版
    Visual Studio Code macOS版

    Visual Studio Code 是微软提供的免费代码编辑器,支持 macOS,并为 Intel 与 Apple 芯片 Mac 提供适配版本。软件集代码编辑、调试、Git 源代码管理、集成终端和扩展市场于一体。

    REAPER macOS版
    REAPER macOS版

    REAPER是Cockos开发的数字音频工作站,提供多轨音频与MIDI录制、剪辑、处理、混音和母带制作工具。Mac版兼容Intel与Apple芯片,支持AU、VST、VST3、CLAP等插件格式,并提供高度可定制的工作流程。

    Adobe Audition macOS版
    Adobe Audition macOS版

    Adobe Audition 是面向播客、影视后期、音乐制作及内容创作者的专业音频工作站,提供波形精修、多轨录制与混音、频谱编辑、降噪修复、响度匹配和效果处理工具,并可与 Adobe Premiere 协同完成视频声音制作。

    Pro Tools macOS版
    Pro Tools macOS版

    Pro Tools 是 Avid 推出的专业数字音频工作站,覆盖多轨录音、无损剪辑、MIDI 编曲、插件处理、自动化混音及声音与画面同步等工作。它拥有 Intro、Artist、Studio 和 Ultimate 等方案。

    WINDOWS 更多
    Postman Windows版
    Postman Windows版

    Postman 是面向 API 全生命周期的开发与协作平台。Windows 桌面版可用于构建和发送 HTTP、GraphQL、gRPC、WebSocket、MQTT 等请求,并提供环境变量、集合、脚本测试、模拟服务、监控、文档及团队工作区等

    Docker Desktop Windows版
    Docker Desktop Windows版

    Docker Desktop 为 Windows 开发者提供集成式容器环境,内置 Docker Engine、命令行工具、Compose、Build 与 Kubernetes 等组件,可在本机完成镜像构建、容器运行、日志查看和资源管理。

    Android Studio Windows版
    Android Studio Windows版

    Android Studio 是 Google 面向 Android 应用开发提供的官方集成开发环境,以 IntelliJ IDEA 为基础,集成智能代码编辑、Gradle 构建、设备模拟、界面预览、调试测试及性能分析工具,

    JetBrains WebStorm Windows版
    JetBrains WebStorm Windows版

    WebStorm 是 JetBrains 面向 JavaScript、TypeScript 和现代 Web 技术打造的集成开发环境。它提供项目级代码分析、智能补全、安全重构、导航搜索,并集成调试、测试、终端、Git 与常用前端工具,

    JetBrains PhpStorm Windows版
    JetBrains PhpStorm Windows版

    PhpStorm 是 JetBrains 面向 PHP 与现代 Web 开发打造的专业集成开发环境,提供代码补全、静态检查、重构、调试、测试、数据库、版本控制及前端语言支持。Windows 用户可直接下载安装程序,

    JetBrains PyCharm Windows版
    JetBrains PyCharm Windows版

    PyCharm 是 JetBrains 推出的 Python 集成开发环境,提供智能代码补全、错误检查、重构、调试、测试、Git、终端及 Jupyter Notebook 支持。统一版安装后可体验 30 天 Pro 功能,

    JetBrains IntelliJ IDEA Windows版
    JetBrains IntelliJ IDEA Windows版

    JetBrains IntelliJ IDEA 是以 Java、Kotlin 和 JVM 项目为核心的专业集成开发环境,提供智能补全、代码检查、安全重构、调试、测试、版本控制及构建工具集成。统一发行版的核心功能可免费用于商业和非商业项目,

    Visual Studio Code Windows版
    Visual Studio Code Windows版

    Visual Studio Code 是微软推出的免费代码编辑器,Windows 版集成智能补全、代码导航、调试、终端和版本控制,并可通过扩展添加语言、格式化及远程开发能力。它启动较快、配置灵活,

    REAPER Windows版
    REAPER Windows版

    REAPER 是 Cockos 推出的数字音频工作站,适用于录音、MIDI 编曲、音频编辑、混音、母带制作及声音设计。软件安装包小巧,支持多轨录制、灵活路由、自动化、第三方插件和脚本扩展,并提供完整功能的 60 天免费评估期。

    Adobe Audition Windows版
    Adobe Audition Windows版

    Adobe Audition 是面向播客、影视后期、广播与音乐制作的专业音频工作站,提供波形编辑、多轨混音、频谱分析、录音、降噪修复和效果处理等功能。Windows 版通过 Adobe Creative Cloud 安装和管理,

    Pro Tools Windows版
    Pro Tools Windows版

    Pro Tools 是 Avid 推出的专业数字音频工作站,提供多轨录音、音频剪辑、MIDI编曲、插件处理、自动化混音及影视声音制作能力。它适合音乐人、录音师、制作人和音频后期团队使用,并提供免费入门版、订阅方案及永久授权选择。

    Cubase Windows版
    Cubase Windows版

    Cubase 是 Steinberg 推出的数字音频工作站,提供 MIDI 编曲、多轨录音、音频编辑、虚拟乐器、效果处理、自动化、混音和母带输出工具。其 Pro、Artist 与 Elements 版本面向不同预算和制作规模,