Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another program runs
#1
I am JUST learning Python. In my learning, I wrote a Rock, Paper Scissors program. It worked great.

BUT... Now when I am trying to write other programs, when I press run, it runs the Rock, Paper, Scissors program. Why?

Here is a sample of a program that I am trying to get started (I know my code is likely awful, but I am just getting started on it)...

import openpyxl

print("Test!!!")
wb = load_workbook("Test.xlsx")
ws = wb.active

ws.rows(0).font=Font(bold=True)

wb.save("Test.xlsx")
When I try to run this, it prints "What is your choice? - rock®, paper(p), or scissors(s)?: "

I have tried uninstalling and reinstalling both Python and PyCharm with no luck. I am using Python 3.11.

Thank you.
Reply
#2
What does "try to run" mean? How are you running your programs?

Did you save changes to the file?
Reply
#3
Thank you for your reply.

I am attempting to run the programs through PyCharm's green play button.

I have save my program.

I did not mention this, but I also completely deleted the Rock, Paper, Scissors app.

Thank you.
Reply
#4
(Nov-08-2022, 05:07 PM)bho68 Wrote: Here is a sample of a program that I am trying to get started

I don't think a 'sample' is going to cut it, tbh.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#5
Pycharm has a "Run" button on top at the right side. But on the left of that button is a listbox showing the file it will run. Choose the right file in that listbox.
Or else right-click on the tab containing your code and choose: "run <name of the tab>".
Reply
#6
Yes ibreeden. I did always choose the correct file to run before I pressed the run button.
Reply
#7
I would use right click run. Less ways to mess up.

Kindof sounds like you have two folders with the same files. Changing code in one folder, running programs from the other.
Reply
#8
The problem is fixed! Not sure what the issue was, but I recently went from Python 3.10 to Python 3.11. I updated that in Pycharm just now, and now it is working fine.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to do 100 runs simulation based on the current codes? dududada 6 988 Sep-03-2023, 01:43 PM
Last Post: deanhystad
  UnicodeEncodeError caused by print when program runs from Popen SheeppOSU 5 2,929 Jan-13-2022, 08:11 AM
Last Post: SheeppOSU
  Importing a function from another file runs the old lines also dedesssse 6 2,559 Jul-06-2021, 07:04 PM
Last Post: deanhystad
  How to create an Excel app that runs Python? felipe0216 3 2,275 May-31-2020, 01:19 AM
Last Post: ibutun
  Python Program Runs in Pycharm but not in Terminal Vbhardwaj2383 2 3,296 Apr-06-2020, 04:41 PM
Last Post: Vbhardwaj2383
  How to execute code WHILE a function runs t4keheart 4 2,679 Jan-27-2020, 01:47 PM
Last Post: t4keheart
  scheduled job only runs once Stan2292 4 2,881 Aug-19-2019, 08:18 AM
Last Post: fishhook
  Scheduler runs but then fails marciokoko 2 4,108 Jan-19-2017, 12:02 AM
Last Post: marciokoko

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020