ok, so I’ve just started to learn python so very sorry for being a absolute dumbell. I’m doing some test stuff and noticed when I build and run my programs, they run yes, but they don’t actually do anything. I’ve made sure to set the right language in sublime editor. perhaps it’s something I’ve done wrong? when the console prints out the first question, i type in a number, but then nothing else happens. it seems to only print the first line and that’s it. it’s supposed to prompt the “second:” but it does nothing. I would really appreciate your help. thank you.

3 points

This will not fix the problem, but will give you more info: save the file to disk and try running it outside of Sublime. Open a command line and run ``python your_file.py`. If it works, that will tell you that the problem is related to Sublime. If it fails like in Sublime, then there is something weird happening… and I have no idea what that could be.

permalink
report
reply
2 points

it works!, oh but that must mean there is something wrong with sublime then.

permalink
report
parent
reply
1 point

that must mean there is something wrong with sublime then.

Yeah, sorry, I cannot help with that, never used Sublime.

But at least you can use the command line until you figure that out. Not ideal, but better than nothing ¯\_(ツ)_/¯.

permalink
report
parent
reply
2 points

ah thank you, i’d never figured it out! well, I guess i’ll just find some other software to view it then. but yeah thanks!

permalink
report
parent
reply
2 points

I can’t see anything wrong with your code other than a typo in line 3 (fist should be first), and the fact that you use sum (a predefined function) as a variable. The latter should not cause any issues, unless you want to use that function at a later point in time.

Forgive me for asking a basic question, but it does sound like you’re not pressing the enter key after entering your first number.

permalink
report
reply
1 point

I believe I press enter after inputting. but let me try again to make sure.

permalink
report
parent
reply
1 point

yeah i did, but still nothing.

permalink
report
parent
reply
2 points

That’s weird. Have tried running it without the help of sublime?

permalink
report
parent
reply
1 point
*
Deleted by creator
permalink
report
reply
1 point

Sublime does not support input via it’s integrated output.

It looks like a CLI, but it is not. There are probably ways to do this, but it’s just easier to use IDLE, be aware of getting flashbanged.

permalink
report
reply

Python

!python@programming.dev

Create post

Welcome to the Python community on the programming.dev Lemmy instance!

📅 Events
Past

November 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
💓 Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
  • Pythörhead: a Python library for interacting with Lemmy
  • Plemmy: a Python package for accessing the Lemmy API
  • pylemmy pylemmy enables simple access to Lemmy’s API with Python
  • mastodon.py, a Python wrapper for the Mastodon API
Feeds

Community stats

  • 733

    Monthly active users

  • 469

    Posts

  • 2.4K

    Comments