Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Jongskie M.

    REXX Get last two digits of the year

    mikrom (Programmer) use substr(ystrday,3) hi mikrom, how about this format 08022024 <--DDMMYYYY
  2. Jongskie M.

    REXX Get last two digits of the year

    Hi mikrom, thank you so much.
  3. Jongskie M.

    REXX Get last two digits of the year

    Hi, I would like to display the last two digits of the year from the code below, please amend, thx ystrday = date('s',(date('b')-1,'b') CALL ZocSend "RE"||ystrday"||" ^M" RE20240208 Am expecting a result of RE240208
  4. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Thank you mikrom for your suggestion, I segregated the path code, they are now opening using os.startfile() function, but the result of the os.startfile() is only in D:\tmp0\2024 & D:\tmp1\2024, the requirements will be pointed out directly inside the newly created folder, how's that? See snip...
  5. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi, from the highlighted function below am expecting an result of U:\tmp\2024\Feb 2024\2024-02-01\ & V:\tmp\2024\Feb 2024\2024-02-01\ but the output are only pointing in U:\tmp\ and V:\tmp\ folder separately , how do you declare? print("Executing to create two folder directory namely :\n\n" +...
  6. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    am trying to reencode with print function to show the two folders, but it will display only the V:\tmp folder, & another thing the os.startfile() function should open both folder after it was been successfully created, is that possible? >>> paths = ["U:\\tmp\\", "V:\\tmp\\"] >>> for path in...
  7. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    what I mean is that, it will create a folder with different location/path, not in a subdirectory. my_path0 = "U:\\tmp\\" my_path1 = "V:\\tmp\\" U:\tmp\2024\"Feb 2024"\2024-02-01 V:\tmp\2024\"Feb 2024"\2024-02-01 regards,
  8. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, From the code below, how to create same folder name in different path. >>> from datetime import date, timedelta >>> yesterday = date.today() - timedelta(days=1) >>> current_time = yesterday.strftime('%Y\\"%b %Y\"\%Y-%m-%d') >>> print(current_time) 2024\"Feb 2024"\2024-02-01 >>>...
  9. Jongskie M.

    REXX Loop conditional statement not working

    Hi mikrom, Indeed, its ok now. Thanks.
  10. Jongskie M.

    REXX Loop conditional statement not working

    Hi mikrom, Yes the code is working so far, but the requirements doesn't met. Scenario: From the ZocRequest(Highlighted in Red) once the user pressed "Yes", the code exited instead it will loop again to login = ZocAsk("What is your name:?"), kindly add what am I missing. Thanks.
  11. Jongskie M.

    REXX Loop conditional statement not working

    Hi am neophyte here, can you check the script below on how to declare loops in the conditional statement which start from the highlighted below. Call ZocCls login = ZocAsk(" What is your name:? ") IF login = "##CANCEL##" THEN DO answer = ZocRequest(" Command Cancelled , Retry?"...
  12. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, Great thanks for this code. you help a lot. regards,
  13. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi micron, Highlighted below should automate the date everyday as a variable. import os def check_path(the_path): if os.path.isdir(the_path): print("path", the_path, "is a directory") else: print("path", the_path, "is not a directory !") [highlight #FCE94F]my_path =...
  14. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi micron, Are there any way to automate the date completely from my_path = "2024\\Jan_2024\\2024-01-11" not a string. Example : Today - 2024\Jan_2024\\2024-01-11 Tomorrow - 2024\Jan_2024\\2024-01-12 I appreciate your efforts.
  15. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, os.path.isdir(path) os.path.exists(path) how to insert/ declare that function on below code. >>> current_time = yesterday.strftime('%Y\%b_%Y\%Y-%m-%d') >>> print(current_time) 2024\Jan_2024\2024-01-11 >>> command = "mkdir {0}".format(current_time) >>> print(command) mkdir...
  16. Jongskie M.

    How to open a folder in Python command after it was been created automatically?

    Dear Gents, Below script creates a previous folder based on the date. 1. The question is how to go or open that folder automatically after it was been created. 2. How to create two folders with different drive or path based on the script below. path = "G:" "H:" current_time =...
  17. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi mikrom, How to encode the if.. else statement(say "Folder Created" else Folder Already Exist! on the last subfolder creation(2024-01-11).
  18. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi Mikrom, Indeed, you got it[thumbsup2] >>> [highlight #FCE94F]current_time = yesterday.strftime('%Y\\"%b %Y\"\%Y-%m-%d')[/highlight] Thank you so much
  19. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Thanks for the input mikrom, i will use to integrate this script soon in my securecrt emulator, are there any options on how to declare that function. By the way how to declare -> mkdir 2024\"Jan 2024"\2024-01-11 Regards...
  20. Jongskie M.

    How to create previous date folder, declaring strftime with space between %b and %Y

    Hi am a newbie in phyton, anybody could help me because am declaring strftime on how to put blank spaces between the dates without hypenations, as of now I'm making a script that creates a folder based on previous time. Please check my code. from datetime import datetime, date oneday =...

Part and Inventory Search

Back
Top