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
#3
Changing the current working dir feels wrong.
Instead you can convert all paths into absolute paths.
# Path.home() is already absolute
Path.home() / 'testdir' / 'testfile.py'
If you have a relative path, you can convert it to an absolute path:

p = Path('.')
print(p.absolute())
  • Using the method glob on relative paths, results into relative paths of matching files.
  • Using the method glob on absolute paths, results into absolute paths of matching files.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Making a generalised CSV COPY script in Python - by DeaD_EyE - Jul-05-2019, 10:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 312 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 3,406 Jun-29-2023, 11:57 AM
Last Post: gologica
  making variables in my columns and rows in python kronhamilton 2 1,654 Oct-31-2021, 10:38 AM
Last Post: snippsat
Question Making a copy list in a function RuyCab 1 1,823 Jul-11-2021, 02:06 PM
Last Post: Yoriz
  Copy documents to Teams using python SallySmith 0 2,418 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,989 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,783 Jun-26-2020, 03:50 AM
Last Post: Larz60+
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 2,336 May-28-2020, 05:27 PM
Last Post: micseydel
  To Copy text values to Excel using Python ksasi2k3 16 16,001 Dec-26-2019, 11:59 AM
Last Post: ashutoshdeodhar
  Copy data from different workbooks into Master sheet with Python Fatman003 0 2,251 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