Python Forum
How to import a file from outside the directory
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to import a file from outside the directory
#1
Hi all! I am in the directory kudoSudoku and in the file "solver.py". I want to import numbers.csv whose path is: Users\Sylas\numbers.csv. What do i write at the top of my solver.py file ? is it: "from Users.Sylas import numbers" ?? Thanks in advance.
Reply


Messages In This Thread
How to import a file from outside the directory - by sylas - May-09-2018, 10:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write variable in a python file then import it in another python file? tatahuft 4 1,117 Jan-01-2025, 12:18 AM
Last Post: Skaperen
  FileNotFoundError: [Errno 2] No such file or directory although the file exists Arnibandyo 0 1,296 Aug-12-2024, 09:11 AM
Last Post: Arnibandyo
  import a function from another file using relative path paul18fr 6 3,840 Aug-01-2024, 06:40 AM
Last Post: paul18fr
  "[Errno 2] No such file or directory" (.py file) IbrahimBennani 13 7,274 Jun-17-2024, 12:26 AM
Last Post: AdamHensley
  Using pyinstaller with .ui GUI files - No such file or directory error diver999 3 8,566 Jun-27-2023, 01:17 PM
Last Post: diver999
Video doing data treatment on a file import-parsing a variable EmBeck87 15 6,089 Apr-17-2023, 06:54 PM
Last Post: EmBeck87
  Import XML file directly into Excel spreadsheet demdej 0 1,674 Jan-24-2023, 02:48 PM
Last Post: demdej
  Extract file only (without a directory it is in) from ZIPIP tester_V 1 4,529 Jan-23-2023, 04:56 AM
Last Post: deanhystad
Thumbs Up Need to compare the Excel file name with a directory text file. veeran1991 1 2,150 Dec-15-2022, 04:32 PM
Last Post: Larz60+
  no such file or directory in SFTP saisankalpj 2 2,797 Nov-25-2022, 11:07 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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