Re: Undeclared Identifier Error on Raspberry Pi. Code works on Nim Playground

2019-07-28 Thread madra
@Stefan_Salewski That might be it. I installed via apt-get on my RPI and it's version 0,19,4. @shashlick Ta. I'll try a Nightly

Undeclared Identifier Error on Raspberry Pi. Code works on Nim Playground

2019-07-28 Thread madra
This should be a pretty simple bit of code. I'm trying to pass a dynamic date & time based filename to the camera module on my RaspberryPi. I've got the following code: import times let timestamp = (now().format("-MM-dd-hh-mm-ss") & ".jpg") echo(timestamp)

Re: Passing a Variable as Part of Args to execProcess

2019-07-17 Thread madra
Aha. That worked a treat I'd thought the TaintedString error was telling me I was creating a "tainted string" when building the command. And the reason I'd omitted the let outp = was that it looked like that was assigning the result of the command to a varible so it could be used later on –and

Passing a Variable as Part of Args to execProcess

2019-07-17 Thread madra
Another day, another bit of tinkering with some of my old Python scripts to try and get my head round Nim. This is an old script I had which takes a list of [IMHO] junk processes and kills them on my OSX laptop. [For the purposes of testing I'm just using Finder and Dock as placeholders, as the

Re: Hyphens Not Allowed in Nim Filenames? [Invalid Module Name]

2019-07-17 Thread madra
Thanks all. > Neither Python, C or C++ allow hyphens in filenames AFAIK. Python certainly does. The project in question was one of my old Python scripts I'm trying to rewrite, while learning Nim. And the original project-wee.py file runs fine.

Hyphens Not Allowed in Nim Filenames? [Invalid Module Name]

2019-07-17 Thread madra
I've just been working on a standalone file. Let's call it project.nim. Compiles and runs no problem. However, when I adapted the code to make it a bit more compact and saved the leaner version as project-wee.nim it refuses to compile with: $ nim c -r project-wee.nim Hint: use

Re: Nim Equivalent of Python Range [with Step]

2019-07-16 Thread madra
Thanks. I just came back to red-facedly say I'd sussed it out. But you beat me to it. I shall award myself the "RTFM Badge of Shame" immediately [although, in my defence, I searched the docs for "range" and "step". Didn't think of "countup"]

Nim Equivalent of Python Range [with Step]

2019-07-16 Thread madra
Probably one to file under "Newbie Questions", but here goes... I'm trying to iterate over a string and get the characters in it 3 at a time. In Python, I can use the fact that range has a step attribute to do something like: text = "Hello there How are you This is a string Blah Bl