Hi, this is Takumi.
I'm an engineer living in Osaka. (Strictly from 3/15) I'm currently studying Laravel / React. I will write Qiita for the first time this time, please be kind to me w
Shohei, who is indebted to me, is making an app for learning English, so it's a private matter, but from my experience of studying English in the Philippines and teaching English at an elementary school, here We are happy to help you create English content for your app.
Click here for the app ↓
・ IOS https://apps.apple.com/jp/app/id1493691416
・ Android https://play.google.com/store/apps/details?id=com.gmail.hukusuke1007.lala
A little promotion w
My role is to enter English and Japanese into a JSON file, which is a very simple task, but I'm distracted and I always get the wrong place to write English and Japanese.
When I was wondering how to solve it, why not write a script? I got advice and decided to challenge.
script_check.py
import json
json_open = open('script.json', 'r', )
json_load = json.load(json_open)
checkWord1 = (json_load['title']['english'])
print(checkWord1)
print(checkWord1[0] .isupper())
checkWord2 = (json_load['description']['english'])
print(checkWord2)
print(checkWord2[0] .isupper())
sentences_check.py
import json
json_open = open('sentences.json', 'r', )
json_load = json.load(json_open)
num = 0
while (num < 10):
print (json_load["sentences"][num]["text"]['english'])
checkWord = (json_load["sentences"][num]["text"]['english'])
print checkWord[0].isupper()
num += 1
First of all, I wanted to take the JSON value with Python and judge it, so I referred to this article to get the value. Read JSON with Python
What is JSON in the first place! ?? I was in a state, so I studied from there w This site was easy to understand. Introduction to JSON
While I was investigating, I was told that JSON Schema could be used, but I stopped because it seemed to be difficult.
I found an article that summarizes functions that could be used, and decided to use isupper (). Alphanumeric judgment python
Like this, if Japanese is included, False will be returned.
With this, you can check only one file, so it would be nice if you could create something to check if you specify a directory. After that, I want to color True and False in the terminal.
I will continue to study hard. We are holding a cloud meeting for scholars in Kansai, so please follow us if you like. Twitter
Recommended Posts