Python Forum
Code works in IDLE, appears to work in CMD, but won't produce files in CMD/Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code works in IDLE, appears to work in CMD, but won't produce files in CMD/Windows
#3
Thanks for the reply and time.

I had just fixed an issue with PIP, Commodo was hanging it. That should be fixed now.
I had just tried "with" - no help - but did it a bit different than you.
Per your comment - I removed the whole shebang.

So I copied your code. Your code works just like mine - meaning it will write and close the files - but only when run in IDLE.

To be clearer (I hope), there are four ways (possibly more) to start a script in Windows. 1) In IDLE. 2) Double click - which opens the CMD window and runs it. 3)In the CMD as a type of executable (i.e. C:\proper\path>file.py) or 4)C:\proper\path>py file.py, and likely some other way to pass it to the CMD window py prompt. All of these ways will run code that ask for input and has calculations or text output. However, only in IDLE (IDE) can I seem to get files to close.

It's late here though and I am tired - so I will try again tomorrow. I know I have done this before in 2.x - I probably misconfigured something when I had the pip problem. Or - maybe COmmodo is stopping the file closes?

Thank you again.
Reply


Messages In This Thread
RE: Code works in IDLE, appears to work in CMD, but won't produce files in CMD/Windows - by ChrisPy33 - Jun-11-2019, 05:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I'm trying to install python 3.11.11 on windows 10 - it doesn't work Petonique 2 1,721 Feb-04-2025, 05:42 PM
Last Post: snippsat
  Can't get graph code to work properly. KDDDC2DS 1 636 Sep-16-2024, 09:17 PM
Last Post: deanhystad
  Windows Disk Cleanup Code Help Needed nal2us2 3 1,036 Jul-19-2024, 04:03 AM
Last Post: deanhystad
  Executable file compiled by PyInstaller does not work on Windows 7 amusaber 1 1,708 Jul-11-2024, 02:59 PM
Last Post: DeaD_EyE
  I can't for the life of me get this basic If statement code to work CandleType1a 8 2,148 May-21-2024, 03:58 PM
Last Post: CandleType1a
  Why can I not see the code correctly in Python IDLE.? Trump 8 2,477 Apr-04-2024, 07:47 AM
Last Post: jonesphedra
  Produce One file Per PurchaseOrder jland47 1 1,051 Jan-26-2024, 11:38 AM
Last Post: Larz60+
  hi need help to make this code work correctly atulkul1985 5 1,887 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 4,182 Nov-15-2023, 06:56 PM
Last Post: jst
  newbie question - can't make code work tronic72 2 1,500 Oct-22-2023, 09:08 PM
Last Post: tronic72

Forum Jump:

User Panel Messages

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