jsup.GEN - working on image-to-image generation with AI

Image
by joviansummer original STEEMIT post: https://steemit.com/blog/@joviansummer/jsup-gen-working-on-image-to-image-generation-with-ai Hello, this is @joviansummer(witness: @jswit). I'd like to share what I'm working on regarding my experintal jsup.GEN project, which tries to connect image generation AI with Steemit. Currently, jsup.GEN provide function to generate image from test prompt(txt2img). This function is interesting, but it's not easy to generate exactly what you want because you need to explain the image in detail with multiple keywords in English. Thus, I think it's more useful to have a function to generate image from existing reference image. I'm working on this image-to-image function, and thinking about two methods to implement it. The first method is to provide 2 commands as follows: !gen_t : This command focuses more on text prompt than reference image. The result may be quite different from reference because text prompt will have much more in...

파이썬에서 문자열의 일부를 가져오기

by joviansummer
original STEEMIT post: https://steemit.com/blog/@joviansummer/1tuzx


파이썬에서 문자열을 사용할 때 특정 위치의 글자들을 편리하게 가져올 수 있습니다.

x = 'hello world'

위와 같이 x에 문자열 'hello world'를 할당해 주었습니다. 첫번째 글자, 두번째 글자 등 특정 위치의 글자 하나를 가져오려면 아래의 예시처럼 할 수 있습니다.

# 문자열 x의 첫번째 글자 출력
print(x[0])

h

x[0]이 첫번째 글자인 'h', x[1]이 두번째 글자인 'e'가 됩니다.

범위를 지정할 수도 있습니다. 만약 첫번째부터 세번째 글자까지 가져오고 싶다면 x[0:3] 이렇게 설정합니다.

# 문자열 x의 첫번째부터 세번째 글자까지 출력
print(x[0:3])

hel

유의할 점은, 위치가 0부터 시작하고, 콜론(:) 다음에 지정되는 인덱스값은 출력값에 포함되지 않는다는 점입니다. x[0:3]이면 x[0]부터 x[2]까지 가져오는 것입니다.

특정 위치부터 마지막까지 가져올 수도 있습니다. 끝나는 위치를 지정하지 않으면 됩니다.

# 2번째 글자부터 끝까지 출력
print(x[1:])

ello world

Comments

Popular posts from this blog

스티미언의 영향력 지수 계산

jsup/avle code update - you don't have to write post everyday

jsup/avle 보팅 코드 갱신 - 1일1포스팅 강박에서 벗어나기