Python Forum
What do you think of this procedure to create a path to a folder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What do you think of this procedure to create a path to a folder
#1
Hi; here is a sample of the code of my application being created:

import os
from os import path
import pathlib
import sys

scriptDirectory=os.path.dirname(os.path.realpath(__file__)) 
path_directory=scriptDirectory + '\\data_base' 
os.makedirs(path_directory, exist_ok=True) 

connexion = sqlite3.connect(path_directory + '\\ils35R.db')

curseur = connexion.cursor()

curseur.execute('''CREATE TABLE IF NOT EXISTS loc35R (date_loc35R text, time_loc35R text,mon_loc35R text )  ''') 
               
curseur.execute('''INSERT INTO loc35R VALUES (?,?,?) ''', (lecture_date_loc35R,lecture_time_loc35R, lecture_mon_loc35R))           
            
connexion.commit()

curseur.close()

connexion.close()
the code works well, but during the conversion of the python file to an executable file: there is a path error with pyinstaller
Reply


Messages In This Thread
What do you think of this procedure to create a path to a folder - by atlass218 - Sep-01-2019, 07:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to capture the result set from a stored procedure? dee 5 315 May-25-2024, 01:03 AM
Last Post: deanhystad
  Create dual folder on different path/drive based on the date agmoraojr 2 562 Jan-21-2024, 10:02 AM
Last Post: snippsat
  python script is hanging while calling a procedure in database prasanthi417 4 675 Jan-17-2024, 02:33 PM
Last Post: deanhystad
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 681 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  create a default path with idle to a specific directory greybill 0 922 Apr-23-2023, 04:32 AM
Last Post: greybill
  python call stored procedure mg24 2 1,165 Oct-18-2022, 02:19 AM
Last Post: mg24
  python call stored procedure with two parameter mg24 4 1,730 Sep-27-2022, 05:02 AM
Last Post: deanhystad
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,668 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,280 Sep-09-2021, 01:25 PM
Last Post: Yoriz
  Move file from one folder to another folder with timestamp added end of file shantanu97 0 2,564 Mar-22-2021, 10:59 AM
Last Post: shantanu97

Forum Jump:

User Panel Messages

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