使用非英语语言进行关键字和变量的 Python 编程 [英] Programming in Python using a Non-English language for keywords and variables

查看:55
本文介绍了使用非英语语言进行关键字和变量的 Python 编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的最终目标是让懂乌尔都语而不是英语的人能够在 Python 环境中编程.

My end goal is to enable people that know the language Urdu and not English to be able to program in a Python environment.

乌尔都语是从左到右书写的.我想拥有所有 python 关键字的乌尔都语版本并使用乌尔都语字符来定义变量/函数/类名称.

Urdu is written left to right. I imagine having Urdu versions of all python keywords and using Urdu characters to define variable/function/class names.

这个目标可能吗?如果是,那么需要做什么?

Is this goal possible? If yes, then what all will need to be done?

我已经看到一个问题,即标准库函数仍为英文.

I can already see one issue where the standard library functions would still be in English.

更新:这是否应该完成当然是一个非常有趣的辩论话题,我很想谈谈.然而,这真的可能吗?如何实现?

Update: Whether this should be done or not is certainly a very interesting debate topic, which I'd love to talk about. However, is it actually possible and how?

我喜欢 Python,我认识很多聪明的人,他们可能永远不会正确地教过英语,只有乌尔都语,因此有这个想法.

I love Python and I know a lot of intelligent people that might never be taught English properly, only Urdu, hence the thought.

推荐答案

中文 Python 用于让程序员完全用中文编写源代码,包括翻译后的模块名称、函数名称和所有关键字.这是他们网站上的代码示例:

Chinese Python used to allow programmers to write source code entirely in Chinese, including translated module names, function names, and all keywords. Here's a code example from their website:

載入 系統               # import sys
文件名 = 系統.參數[1:]   # filenames = sys.argv[1:]

定義 修正行尾(文件):     # def fixline(file):
    內文 = 打開(文件).讀入()  # text = open(file).read()
    內文 = 內文.替換('\n\r','\n') # text = text.replace('\n\r', '\n')
    傳回 內文          # return text

取 文件 自 文件名:     # for file in filenames:
    寫 修正行尾(文件)  # print fixline(file)

遗憾的是,它不再是一个活跃的项目,但您可以获取源代码并找出他们更改的内容,以便为您自己的实现提供一个想法.(了解他们失败的原因还可以帮助您了解使这样的系统成功将面临哪些挑战).

Sadly, it is no longer an active project, but you can get the source and find out what they changed to get an idea for your own implementation. (Learning why they failed may also help you understand what challenges you will have in making such a system successful).

这篇关于使用非英语语言进行关键字和变量的 Python 编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆