gatech-csl / jes

The Jython Environment for Students allows students to write Jython programs that can manipulate pictures, sounds, and videos.
http://mediacomputation.org/
60 stars 38 forks source link

JES functon error #113

Open johnsonblaze opened 6 years ago

johnsonblaze commented 6 years ago

Hello and good day, I am in a course and have been trying to write some programs. I am trying to use the "def" to name a program then execute it. I am consistently receiving "function" error. I have tried to tab once and then twice, space many different amounts up to five, Does anyone here have insight as to what I may be doing wrong? I have tried it on a Windows 7 and a Windows 10 machine. I am trying to use JES 5.020, thank you --Blaze

the program I have reduced it to

def blaze(): print 3+2

I receive the following:

======= Loading Program ======= print

blaze <function blaze at 0x21>

======= Loading Program ======= blaze <function blaze at 0x22>

======= Loading Program ======= blaze <function blaze at 0x23> print 3+2 5

======= Loading Program ======= blaze <function blaze at 0x24>

======= Loading Program ======= blaze <function blaze at 0x25>

======= Loading Program ======= blaze <function blaze at 0x26> blaze <function blaze at 0x26>

mjguzdial commented 6 years ago

Indent the body of your function:

def blaze():

print 3 +2

Like that.

This isn't a bug with JES -- this is just how Python works.


From: johnsonblaze notifications@github.com Sent: Tuesday, May 1, 2018 1:09:18 PM To: gatech-csl/jes Cc: Subscribed Subject: [gatech-csl/jes] JES functon error (#113)

Hello and good day, I am in a course and have been trying to write some programs. I am trying to use the "def" to name a program then execute it. I am consistently receiving "function" error. I have tried to tab once and then twice, space many different amounts up to five, Does anyone here have insight as to what I may be doing wrong? I have tried it on a Windows 7 and a Windows 10 machine. I am trying to use JES 5.020, thank you --Blaze

the program I have reduced it to

def blaze(): print 3+2

I receive the following:

======= Loading Program =======

print

blaze <function blaze at 0x21>

======= Loading Program =======

blaze <function blaze at 0x22>

======= Loading Program =======

blaze <function blaze at 0x23> print 3+2 5

======= Loading Program =======

blaze <function blaze at 0x24>

======= Loading Program =======

blaze <function blaze at 0x25>

======= Loading Program =======

blaze <function blaze at 0x26> blaze <function blaze at 0x26>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/gatech-csl/jes/issues/113, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AELfpow85_NDgAgbpFNJQWdoRCUmOHtZks5tuJa-gaJpZM4TuNOQ.

johnsonblaze commented 6 years ago

OK, thank you. that is what i have tried.

It seems to be lost in the translation in the email.

It looks like this:

def blaze(): (1tab)print 3+2

When I do that, I get a function error.

I have tried 1-5 spaces and I have tried 1-4 tabs (on the second line) preceding the instruction in the programming box. When I load the program (after saving) and type "blaze" I then get a function error with the program name and memory location.

Is there a specific "indent" option? Does it not interpret spaces and tabs?

Thank you for your response,

Blaze On May 1, 2018 3:06 PM, "mjguzdial" notifications@github.com wrote:

Indent the body of your function:

def blaze():

print 3 +2

Like that.

This isn't a bug with JES -- this is just how Python works.

  • Mark

From: johnsonblaze notifications@github.com Sent: Tuesday, May 1, 2018 1:09:18 PM To: gatech-csl/jes Cc: Subscribed Subject: [gatech-csl/jes] JES functon error (#113)

Hello and good day, I am in a course and have been trying to write some programs. I am trying to use the "def" to name a program then execute it. I am consistently receiving "function" error. I have tried to tab once and then twice, space many different amounts up to five, Does anyone here have insight as to what I may be doing wrong? I have tried it on a Windows 7 and a Windows 10 machine. I am trying to use JES 5.020, thank you --Blaze

the program I have reduced it to

def blaze(): print 3+2

I receive the following:

======= Loading Program =======

print

blaze <function blaze at 0x21>

======= Loading Program =======

blaze <function blaze at 0x22>

======= Loading Program =======

blaze <function blaze at 0x23> print 3+2 5

======= Loading Program =======

blaze <function blaze at 0x24>

======= Loading Program =======

blaze <function blaze at 0x25>

======= Loading Program =======

blaze <function blaze at 0x26> blaze <function blaze at 0x26>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ gatech-csl/jes/issues/113, or mute the threadhttps://github.com/ notifications/unsubscribe-auth/AELfpow85_NDgAgbpFNJQWdoRCUmOHtZks5tuJa- gaJpZM4TuNOQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gatech-csl/jes/issues/113#issuecomment-385759537, or mute the thread https://github.com/notifications/unsubscribe-auth/AlFpOZGqoSb9s4QHtq9sZeueJzH7Ufh4ks5tuLIqgaJpZM4TuNOQ .

mjguzdial commented 6 years ago

Call your function with parentheses:

blaze()

Just typing "blaze" is asking for the value of the name "blaze" which is a function.


From: johnsonblaze notifications@github.com Sent: Tuesday, May 1, 2018 3:40:43 PM To: gatech-csl/jes Cc: Guzdial, Mark; Comment Subject: Re: [gatech-csl/jes] JES functon error (#113)

OK, thank you. that is what i have tried.

It seems to be lost in the translation in the email.

It looks like this:

def blaze(): (1tab)print 3+2

When I do that, I get a function error.

I have tried 1-5 spaces and I have tried 1-4 tabs (on the second line) preceding the instruction in the programming box. When I load the program (after saving) and type "blaze" I then get a function error with the program name and memory location.

Is there a specific "indent" option? Does it not interpret spaces and tabs?

Thank you for your response,

Blaze On May 1, 2018 3:06 PM, "mjguzdial" notifications@github.com wrote:

Indent the body of your function:

def blaze():

print 3 +2

Like that.

This isn't a bug with JES -- this is just how Python works.

  • Mark

From: johnsonblaze notifications@github.com Sent: Tuesday, May 1, 2018 1:09:18 PM To: gatech-csl/jes Cc: Subscribed Subject: [gatech-csl/jes] JES functon error (#113)

Hello and good day, I am in a course and have been trying to write some programs. I am trying to use the "def" to name a program then execute it. I am consistently receiving "function" error. I have tried to tab once and then twice, space many different amounts up to five, Does anyone here have insight as to what I may be doing wrong? I have tried it on a Windows 7 and a Windows 10 machine. I am trying to use JES 5.020, thank you --Blaze

the program I have reduced it to

def blaze(): print 3+2

I receive the following:

======= Loading Program =======

print

blaze <function blaze at 0x21>

======= Loading Program =======

blaze <function blaze at 0x22>

======= Loading Program =======

blaze <function blaze at 0x23> print 3+2 5

======= Loading Program =======

blaze <function blaze at 0x24>

======= Loading Program =======

blaze <function blaze at 0x25>

======= Loading Program =======

blaze <function blaze at 0x26> blaze <function blaze at 0x26>

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ gatech-csl/jes/issues/113, or mute the threadhttps://github.com/ notifications/unsubscribe-auth/AELfpow85_NDgAgbpFNJQWdoRCUmOHtZks5tuJa- gaJpZM4TuNOQ.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gatech-csl/jes/issues/113#issuecomment-385759537, or mute the thread https://github.com/notifications/unsubscribe-auth/AlFpOZGqoSb9s4QHtq9sZeueJzH7Ufh4ks5tuLIqgaJpZM4TuNOQ .

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/gatech-csl/jes/issues/113#issuecomment-385767964, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AELfpq1fFELpEwiDFAtzMWuB_AeRFKjFks5tuLo7gaJpZM4TuNOQ.