Here is my working python code that Im trying to replicate in nim. Getting an
error.
Working python code -
#Collect information from user input.
old_file_name = input("Enter the path and name of the file name to change >")
new_file_name = input("Enter the new file name >")
#Create an fstring and save the values to these variables. Use @ to separte
them. change_file_name = (f"{old_file_name}@{new_file_name}")
#Extract the values from the fstring and put them into new variable names.
oldname, newname = archive_file.split("@")
#Display their values. print("Old file name:", oldname) print("New File name:",
newname)
nim code -
import os, strutils
echo "Enter a file's path > " let file_path = readLine(stdin)
let filesize = "fast" let filename = "image
let mydata = filename & "@" & filesize
let (newname, newsize) = mydata.split("@", 2)
echo "filename: ", newname, " filesize: ", newsize
Compiler error:
C:UsersuserDocumentsnimcodefstring.nim(11, 5) Error: 'tuple' expected