Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Temp folder creation
#1
Hi,

I am completely new to python and I want to replicate something that I am using in Excel. I want to create a .xlsx file call it test1 and do some work within the spreadsheet. Once this is done I would then like to save it in a temp folder (there may be two users using the file in the future) and save it using two variables - JobId and the other is environment. Once saved I will then push this to another destination.

How best to proceed with this?

I have seen this code and it creates a folder in the same place that my script is saved but I would prefer it to be a temp folder which would be deleted when I am finished.

mport os


def createFolder(directory):
    try:
        if not os.path.exists(directory):
            os.makedirs(directory)
    except OSError:
        print ('Error: Creating directory. ' + directory)


# Example
createFolder('./test/')
# Creates a folder in the current directory called data
Reply


Messages In This Thread
Temp folder creation - by ste1605 - Oct-02-2018, 02:29 PM
RE: Temp folder creation - by micseydel - Oct-02-2018, 04:21 PM
RE: Temp folder creation - by ste1605 - Oct-02-2018, 04:32 PM
RE: Temp folder creation - by buran - Oct-02-2018, 06:00 PM
RE: Temp folder creation - by ste1605 - Oct-03-2018, 08:20 AM
RE: Temp folder creation - by buran - Oct-03-2018, 09:41 AM
RE: Temp folder creation - by ste1605 - Oct-03-2018, 09:53 AM
RE: Temp folder creation - by buran - Oct-03-2018, 10:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Deleting Windows temp folder Raysz 7 460 Apr-02-2024, 12:36 PM
Last Post: Raysz
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 567 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,510 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  pyspark creating temp files in /tmp folder aliyesami 1 5,027 Oct-16-2021, 05:15 PM
Last Post: aliyesami
  Help with storing temp data for each day then recording min/max in app. trthskr4 3 2,431 Sep-10-2021, 10:51 PM
Last Post: trthskr4
  How to save Matplot chart to temp file? Morkus 2 4,543 Jun-12-2021, 10:52 AM
Last Post: Morkus
  Move file from one folder to another folder with timestamp added end of file shantanu97 0 2,486 Mar-22-2021, 10:59 AM
Last Post: shantanu97
  Python Cut/Copy paste file from folder to another folder rdDrp 4 5,081 Aug-19-2020, 12:40 PM
Last Post: rdDrp
  Get system info from PI (cpu load and temp) korenron 2 2,106 Aug-04-2019, 08:45 AM
Last Post: korenron
  folder PyQt5 created during creation exe atlass218 0 1,556 Apr-26-2019, 06:25 PM
Last Post: atlass218

Forum Jump:

User Panel Messages

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