René's URL Explorer Experiment


Title: j2py not converting · Issue #69 · natural/java2python · GitHub

Open Graph Title: j2py not converting · Issue #69 · natural/java2python

X Title: j2py not converting · Issue #69 · natural/java2python

Description: Hi, I was attempting to use j2py to convert a simple Java program I made into python, but i got an error. This is the Java code: import java.util.Scanner; public class areaCalculator { public static void main(String[] args) { Scanner inp...

Open Graph Description: Hi, I was attempting to use j2py to convert a simple Java program I made into python, but i got an error. This is the Java code: import java.util.Scanner; public class areaCalculator { public stati...

X Description: Hi, I was attempting to use j2py to convert a simple Java program I made into python, but i got an error. This is the Java code: import java.util.Scanner; public class areaCalculator { public stati...

Opengraph URL: https://github.com/natural/java2python/issues/69

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"j2py not converting","articleBody":"Hi,\r\n\r\nI was attempting to use j2py to convert a simple Java program I made into python, but i got an error.\r\n\r\nThis is the Java code:\r\n\r\n```java\r\nimport java.util.Scanner;\r\n\r\npublic class areaCalculator {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tSystem.out.println(\r\n\t\t\t\t\"Hello. I am a calculator that can calculate the area of shapes. All I need is for you to input what shape's area\\nyou would like to convert from the following list: \\n\");\r\n\t\tSystem.out.println(\"•triangle\\n•circle\\n•rectangle\\n•square\\n•trapezoid\\n\");\r\n\t\tString shapeName = input.nextLine();\r\n\t\tif (shapeName.equals(\"triangle\")) {\r\n\t\t\tSystem.out.println(\"What is the base of the triangle? \");\r\n\t\t\tdouble triangleBase = input.nextDouble();\r\n\t\t\tSystem.out.println(\"What is the height of the triangle? \");\r\n\t\t\tdouble triangleHeight = input.nextDouble();\r\n\t\t\tSystem.out.println(\"The area of the triangle is: \" + (triangleBase * triangleHeight) / 2);\r\n\r\n\t\t} else if (shapeName.equals(\"circle\")) {\r\n\t\t\tSystem.out.println(\"What is the radius of the circle? \");\r\n\t\t\tdouble radius = input.nextDouble();\r\n\t\t\tSystem.out.println(\"The area of the circle is: \" + Math.PI * Math.pow(radius, 2));\r\n\t\t} else if (shapeName.equals(\"rectangle\")) {\r\n\t\t\tSystem.out.println(\"What is the height of the rectangle? \");\r\n\t\t\tdouble rectangleHeight = input.nextDouble();\r\n\t\t\tSystem.out.println(\"What is the width of the rectangle? \");\r\n\t\t\tdouble rectangleWidth = input.nextDouble();\r\n\t\t\tSystem.out.print(\"The area of the rectangle is: \" + rectangleHeight * rectangleWidth);\r\n\r\n\t\t} else if (shapeName.equals(\"square\")) {\r\n\t\t\tSystem.out.println(\"What is the length of one side of the square? \");\r\n\t\t\tdouble squareSide = input.nextDouble();\r\n\t\t\tSystem.out.println(\"The area if the square is: \" + Math.pow(squareSide, 2));\r\n\t\t} else if (shapeName.equals(\"trapezoid\")) {\r\n\t\t\tSystem.out.println(\"What is one of the bases of the trapezoid? \");\r\n\t\t\tdouble tBase1 = input.nextDouble();\r\n\t\t\tSystem.out.println(\"What is another of the bases of the trapezoid? \");\r\n\t\t\tdouble tBase2 = input.nextDouble();\r\n\t\t\tSystem.out.println(\"What is the height of the trapezoid? \");\r\n\t\t\tdouble tHeight = input.nextDouble();\r\n\t\t\tSystem.out.println(\"The area of the trapezoid is: \" + (tBase1 + tBase2) / 2 * tHeight);\r\n\r\n\t\t} else {\r\n\t\t\tSystem.out.println(\"Sorry. An error occured. Please try again\");\r\n\t\t}\r\n\t}\r\n\r\n}\r\n```\r\nWhen I try to run `j2py areaCalculator.py`, it returns this error:\r\n\r\n```\r\n# ERROR runTransform: exception while parsing\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/j2py\", line 120, in runTransform\r\n    tree = buildAST(source)\r\n  File \"/Users/vasan/Library/Python/2.7/lib/python/site-packages/java2python/compiler/__init__.py\", line 15, in buildAST\r\n    lexer = Lexer(StringStream(source))\r\n  File \"/Library/Python/2.7/site-packages/antlr_python_runtime-3.1.3-py2.7.egg/antlr3/streams.py\", line 336, in __init__\r\n    self.strdata = unicode(data)\r\nUnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 362: ordinal not in range(128)\r\n```\r\n\r\nCan someone please help me figure out what the issue is? Thank you!","author":{"url":"https://github.com/MrKomodoDragon","@type":"Person","name":"MrKomodoDragon"},"datePublished":"2020-11-16T22:45:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/69/java2python/issues/69"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0dab8cec-a061-c203-bac2-aeddb5011ca6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idED72:70D32:1B86A08:2622D26:6973B4EF
html-safe-nonced04b5c70e7c40b531a96e2d7ffdec25223f7427ffb501d4e4fa3d7df9edf3ecc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDcyOjcwRDMyOjFCODZBMDg6MjYyMkQyNjo2OTczQjRFRiIsInZpc2l0b3JfaWQiOiI0MjMzMTQ4ODMyNzUwNDgyNjcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac9f4801783e7d5e2cfef7f444b6b66ab96dac3723de076d035edc5497368177ff
hovercard-subject-tagissue:744260019
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/natural/java2python/69/issue_layout
twitter:imagehttps://opengraph.githubassets.com/fda60c578d0633d6975da4ea3b28564dad4eae69ef54a316f34e4dc97c4bd77b/natural/java2python/issues/69
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/fda60c578d0633d6975da4ea3b28564dad4eae69ef54a316f34e4dc97c4bd77b/natural/java2python/issues/69
og:image:altHi, I was attempting to use j2py to convert a simple Java program I made into python, but i got an error. This is the Java code: import java.util.Scanner; public class areaCalculator { public stati...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMrKomodoDragon
hostnamegithub.com
expected-hostnamegithub.com
Nonec583cf2a26ee9c2cb1cb0fab5c726ed6719c2c4c87fc0c7c38069132f28faf12
turbo-cache-controlno-preview
go-importgithub.com/natural/java2python git https://github.com/natural/java2python.git
octolytics-dimension-user_id146692
octolytics-dimension-user_loginnatural
octolytics-dimension-repository_id3298542
octolytics-dimension-repository_nwonatural/java2python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3298542
octolytics-dimension-repository_network_root_nwonatural/java2python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release53344dea98f729e752d2fa6a8cba0f99032ced49
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/natural/java2python/issues/69#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnatural%2Fjava2python%2Fissues%2F69
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnatural%2Fjava2python%2Fissues%2F69
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=natural%2Fjava2python
Reloadhttps://patch-diff.githubusercontent.com/natural/java2python/issues/69
Reloadhttps://patch-diff.githubusercontent.com/natural/java2python/issues/69
Reloadhttps://patch-diff.githubusercontent.com/natural/java2python/issues/69
natural https://patch-diff.githubusercontent.com/natural
java2pythonhttps://patch-diff.githubusercontent.com/natural/java2python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fnatural%2Fjava2python
Fork 247 https://patch-diff.githubusercontent.com/login?return_to=%2Fnatural%2Fjava2python
Star 579 https://patch-diff.githubusercontent.com/login?return_to=%2Fnatural%2Fjava2python
Code https://patch-diff.githubusercontent.com/natural/java2python
Issues 41 https://patch-diff.githubusercontent.com/natural/java2python/issues
Pull requests 10 https://patch-diff.githubusercontent.com/natural/java2python/pulls
Actions https://patch-diff.githubusercontent.com/natural/java2python/actions
Projects 0 https://patch-diff.githubusercontent.com/natural/java2python/projects
Security 0 https://patch-diff.githubusercontent.com/natural/java2python/security
Insights https://patch-diff.githubusercontent.com/natural/java2python/pulse
Code https://patch-diff.githubusercontent.com/natural/java2python
Issues https://patch-diff.githubusercontent.com/natural/java2python/issues
Pull requests https://patch-diff.githubusercontent.com/natural/java2python/pulls
Actions https://patch-diff.githubusercontent.com/natural/java2python/actions
Projects https://patch-diff.githubusercontent.com/natural/java2python/projects
Security https://patch-diff.githubusercontent.com/natural/java2python/security
Insights https://patch-diff.githubusercontent.com/natural/java2python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/natural/java2python/issues/69
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/natural/java2python/issues/69
j2py not convertinghttps://patch-diff.githubusercontent.com/natural/java2python/issues/69#top
https://github.com/MrKomodoDragon
https://github.com/MrKomodoDragon
MrKomodoDragonhttps://github.com/MrKomodoDragon
on Nov 16, 2020https://github.com/natural/java2python/issues/69#issue-744260019
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.