본문 바로가기

input5

Flutter 플러터 - 플러터에서 숫자 키보드에 완료 버튼을 추가하는 방법, Flutter - how to add done button in number keyboard in flutter 질문 나는 TextFormField에서 숫자 형식 입력에 done 버튼을 추가하려고 시도하고 있지만, 그렇게 할 수 없었습니다. TextFormField( key: Key(keyValue), initialValue: valueBuilder, onSaved: (text) { fieldsController.text = text.trim(); }, inputFormatters: [inputFormatters], keyboardType: TextInputType.phoneNumber,) 아래와 같은 키보드를 입력 텍스트 폼 필드에 생성하고 싶습니다. 답변 Change keyboardType: TextInputType.number to keyboardType: TextInputType.numberWithOptio.. 2023. 12. 11.
Python 문자열.replace에 정규식을 입력하는 방법은 무엇인가요?, How to input a regex in string.replace? 질문 정규식 선언에 도움이 필요합니다. 입력은 다음과 같습니다: this is a paragraph with in between and then there are cases ... where the number ranges from 1-100. and there are many other lines in the txt files with such tags 필요한 출력은 다음과 같습니다: this is a paragraph with in between and then there are cases ... where the number ranges from 1-100. and there are many other lines in the txt files with such tags 다음을 시도해 보았습니다: #.. 2023. 10. 24.
Python 여러 개의 루프에서 탈출하는 방법은 무엇인가요?, How can I break out of multiple loops? 질문 다음 코드를 주어진 상태에서 (작동하지 않는 코드): while True: # Snip: 현재 상태를 출력 while True: ok = get_input("이 괜찮습니까? (y/n)") if ok.lower() == "y": break 2 # 이 부분이 작동하지 않습니다 :( if ok.lower() == "n": break # 메뉴와 다른 작업을 더 처리 이 작동하도록 만들 수 있는 방법이 있을까요? 아니면 입력 루프에서 빠져나오기 위해 체크를 하나 더 해야하고, 사용자가 만족하면 완전히 빠져나오기 위해 외부 루프에서 더 제한된 체크를 해야 할까요? 답변 내 첫 번째 직감은 중첩된 루프를 함수로 리팩토링하고 return을 사용하여 탈출하는 것입니다. 2023. 7. 20.
Python 파이썬에서 두 변수의 논리적 XOR을 어떻게 얻을 수 있나요?, How do you get the logical xor of two variables in Python? 질문 Python에서 두 변수의 논리적 XOR을 어떻게 얻을 수 있나요? 예를 들어, True 값(빈 문자열 또는 None이 아님)을 포함하는 변수 둘 중 하나만 테스트하려고 합니다. str1 = raw_input("Enter string one:") str2 = raw_input("Enter string two:") if logical_xor(str1, str2): print "ok" else: print "bad" ^ 연산자는 비트 연산자로, 모든 객체에서 정의되지 않습니다: >>> 1 ^ 1 0 >>> 2 ^ 1 3 >>> "abc" ^ "" Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand ty.. 2023. 6. 7.