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
#4
Well,

I can't figure it out. Tried 2 machines. Python scripts will work just fine in the CMD window as far as calculations and printing to screen, etc...
However, when I try to do anything with files in the CMD window, the script appears to parse fine - but won't produce files - like text files - even when I use *with*. But the scripts will work fully and make .txt files if I run them from the Shell.

I wonder....is this the problem?

In CMD

Quote:>>> sys.path
['', 'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages']
>>>

In Python Shell
Quote:>>> sys.path
['C:\\Users\\Chris\\Desktop\\GELOE\\Excel Test',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\Lib\\idlelib',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\python37.zip',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\DLLs',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\lib',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32',
'C:\\Users\\Chris\\AppData\\Local\\Programs\\Python\\Python37-32\\lib\\site-packages']
>>>

There are missing paths in the CMD and an empty path. That's odd. And How would I fix that? path has always vexed me.
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-12-2019, 05:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why can I not see the code correctly in Python IDLE.? Trump 8 739 Apr-04-2024, 07:47 AM
Last Post: jonesphedra
  Produce One file Per PurchaseOrder jland47 1 353 Jan-26-2024, 11:38 AM
Last Post: Larz60+
  hi need help to make this code work correctly atulkul1985 5 813 Nov-20-2023, 04:38 PM
Last Post: deanhystad
  My code works on Jupyter Lab/Notebook, but NOT on Visual Code Editor jst 4 1,073 Nov-15-2023, 06:56 PM
Last Post: jst
  newbie question - can't make code work tronic72 2 711 Oct-22-2023, 09:08 PM
Last Post: tronic72
  Rename files in a folder named using windows explorer hitoxman 3 771 Aug-02-2023, 04:08 PM
Last Post: deanhystad
  Code works but doesn't give the right results colin_dent 2 734 Jun-22-2023, 06:04 PM
Last Post: jefsummers
  Beginner: Code not work when longer list raiviscoding 2 839 May-19-2023, 11:19 AM
Last Post: deanhystad
  Phyton Opening files on windows C: pc EddieG 3 1,001 Mar-29-2023, 03:19 PM
Last Post: buran
  Why doesn't this code work? What is wrong with path? Melcu54 7 1,859 Jan-29-2023, 06:24 PM
Last Post: Melcu54

Forum Jump:

User Panel Messages

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