Python Forum
Making a generalised CSV COPY script in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a generalised CSV COPY script in Python
#4
Quote:Changing the current working dir feels wrong.

I have been anchoring my starting path to 'script resident' directory for years, and then using relative paths
for everything else with most all languages I have used, and never had a problem.
My reasoning is that I can then take a complete project, move it to any type of media, anywhere on the current machine, or anywhere within a network and still have access to to any file within the project without modification of code.
Perhaps you can also do this with absolute paths, but seems like whenever I did that, sooner or later it bit me, as code would have to changed to reflect the new physical environment.

Quote:Using the method glob on relative paths, results into relative paths of matching files.
I have to think about this a bit more, but if I always work with relative paths anyway, would this be an issue?
Reply


Messages In This Thread
RE: Making a generalised CSV COPY script in Python - by Larz60+ - Jul-05-2019, 11:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 287 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,286 Jun-29-2023, 11:57 AM
Last Post: gologica
  making variables in my columns and rows in python kronhamilton 2 1,630 Oct-31-2021, 10:38 AM
Last Post: snippsat
Question Making a copy list in a function RuyCab 1 1,805 Jul-11-2021, 02:06 PM
Last Post: Yoriz
  Copy documents to Teams using python SallySmith 0 2,390 Mar-23-2021, 04:27 AM
Last Post: SallySmith
  How to kill a bash script running as root from a python script? jc_lafleur 4 5,941 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  Looking for help on making a script [no idea where to start] Chietnemese 1 1,760 Jun-26-2020, 03:50 AM
Last Post: Larz60+
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,315 May-28-2020, 05:27 PM
Last Post: micseydel
  To Copy text values to Excel using Python ksasi2k3 16 15,891 Dec-26-2019, 11:59 AM
Last Post: ashutoshdeodhar
  Copy data from different workbooks into Master sheet with Python Fatman003 0 2,233 Aug-27-2019, 07:36 AM
Last Post: Fatman003

Forum Jump:

User Panel Messages

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