Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

How can i print a int or a str #2

Closed
iudf662 opened this issue Aug 22, 2021 · 5 comments
Closed

How can i print a int or a str #2

iudf662 opened this issue Aug 22, 2021 · 5 comments

Comments

@iudf662
Copy link

iudf662 commented Aug 22, 2021

How can i print a int or a str with y#

@RezSat
Copy link
Owner

RezSat commented Aug 24, 2021

Oh, just simply use print, that's all , for example:
print 10;
print "Hello, World!";

@RezSat
Copy link
Owner

RezSat commented Aug 24, 2021

look at my examples, I will add some more examples there.

@RezSat RezSat closed this as completed Aug 24, 2021
@RezSat RezSat reopened this Aug 24, 2021
@RezSat
Copy link
Owner

RezSat commented Aug 24, 2021

but there are some problems, when using variables, you can't print int variables but you can print str variables, :
str name = "Yehan Wasura"; print name;

The problem when trying to print INT variable is that it won't show the value in the result console and also it does not show any errors, it likely just skipping it or something, I didn't really looked deep into it and I really can't remember much of the things here, because it's being some time, but I will take look and try to fix it soon.

@RezSat
Copy link
Owner

RezSat commented Aug 24, 2021

alright buddy, I have found the problem and I have fixed it, The thing fixed was in the file Objects/builtinObjects.py, there your have code like this :
try: self.exec_string += ast['arguments'][0] + ")" and I just changed it to :
try: self.exec_string += str(ast['arguments'][0]) + ")". making any arguments passes through a string, this way you can print out variables that holds integers

@RezSat
Copy link
Owner

RezSat commented Aug 24, 2021

Try the new release Y# Version 1.0.1, it's all fixed there

@RezSat RezSat closed this as completed Aug 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants