You are not logged in.

#1 2021-03-16 23:31:57

portaro
Member
Registered: 2020-01-03
Posts: 25

Roman2Arabic program conversor

Hello friends, thanks to receive me here.

At this moment I use Bunsenlabs Lithium, the system goes well I think but I recently move from Ubuntu to Bunsenlabs (I format my pc).

I am in the process of put programs, config my /home ... .

Now I try to use one simple program that I down from web years ago in my Ubuntu he works well but now in Bunsenlabs I cant find the way to make this work, is a simple executable, isn't a .deb package.

I search on web for the website where I down the package and I cant find it, but I have the .tar.gz file so I upload here to find if any can give me the way to install (run) it →https://easyupload.io/fc68c5

I also take a screenshot fo the problem when I try to execute the file →

Captura-de-ecr-2021-03-16-23-39-43.png

If anyone know some program that do the same work please put here the info, the program does conversions between roman and arabic numbers or arabic and roman numbers.

Thanks

Last edited by portaro (2021-03-18 15:28:07)

Offline

#2 2021-03-16 23:54:54

ahillio
Member
Registered: 2021-03-13
Posts: 18

Re: Roman2Arabic program conversor

Welcome to the BunsenLabs forum.  This question sounds like it's not particularly related to BunsenLabs, even though that's the operating system you're now using.

The "No such file or directory" part of the error message you posted suggests that your script has a missing dependency, like there was some software on your computer previously that's not on it now and that software is required for this script to work... and if that's the kind of trouble you're having then you'll want to learn more about how scripts work (a general issue unrelated to BunsenLabs).

If you're wondering "how to do conversions between roman and arabic numbers" searching the internet for that exact/similar phrase would probably yield better results than this forum.

Good luck!

Offline

#3 2021-03-17 00:21:09

portaro
Member
Registered: 2020-01-03
Posts: 25

Re: Roman2Arabic program conversor

Thanks for your answer I'll search on web, I already do some searches but I dont find a program to it but I'll search more.

Thanks.

Offline

#4 2021-03-17 01:19:18

damo
....moderator....
Registered: 2015-08-20
Posts: 6,572

Re: Roman2Arabic program conversor

That executable doesn't run on my system either. If you just want a "Roman to Number" converter then search on github - there are lots to choose from here: https://github.com/search?q=roman+to+number&type=


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#5 2021-03-17 02:06:51

portaro
Member
Registered: 2020-01-03
Posts: 25

Re: Roman2Arabic program conversor

damo wrote:

That executable doesn't run on my system either. If you just want a "Roman to Number" converter then search on github - there are lots to choose from here: https://github.com/search?q=roman+to+number&type=

Thanks I already down some of files but cant make them works (run), for the java files I use
$ java -jar command / path and dont work in any case I will test with other files type.

Thanks for your help.

Offline

#6 2021-03-17 09:42:56

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,258
Website

Re: Roman2Arabic program conversor

I. This bash/sed seems to work
https://gist.github.com/pysysops/7596f1 … 87a2fb95e5

chmod +x rom2num         
❯ rom2num IIII    
IIII is 4
❯ rom2num IV  
IV is 4
❯ rom2num MXXX
MXXX is 1030

II. Python solution (goes both ways) https://pypi.org/project/roman/

❯ ./roman 1030
MXXX

~/.local/bin 
❯ ./roman MXXX
Traceback (most recent call last):
  File "/home/b/.local/bin/./roman", line 8, in <module>
    sys.exit(main())
  File "/home/b/.local/lib/python3.9/site-packages/roman.py", line 137, in main
    i = int(args.number)
ValueError: invalid literal for int() with base 10: 'MXXX'

~/.local/bin 
❯ ./roman -r MXXX
1030

III. numconv in repos (I don't know how to use it exactly)

echo MXXX | numconv -f all -t Western_Lower
1030
echo 1030 | numconv -f all -t Roman
Number system Roman is not suitable for string generation.

but for roman to numeral you could add a function like this

# roman 2 number
woot () {
    echo "$1" | numconv -f all -t Western_Lower
}

to your .bashrc (or .zshrc), so

woot MXXX
1030

Last edited by brontosaurusrex (2021-03-17 10:32:24)

Offline

#7 2021-03-17 12:27:00

portaro
Member
Registered: 2020-01-03
Posts: 25

Re: Roman2Arabic program conversor

brontosaurusrex wrote:

I. This bash/sed seems to work
https://gist.github.com/pysysops/7596f1 … 87a2fb95e5

chmod +x rom2num         
❯ rom2num IIII    
IIII is 4
❯ rom2num IV  
IV is 4
❯ rom2num MXXX
MXXX is 1030

II. Python solution (goes both ways) https://pypi.org/project/roman/

❯ ./roman 1030
MXXX

~/.local/bin 
❯ ./roman MXXX
Traceback (most recent call last):
  File "/home/b/.local/bin/./roman", line 8, in <module>
    sys.exit(main())
  File "/home/b/.local/lib/python3.9/site-packages/roman.py", line 137, in main
    i = int(args.number)
ValueError: invalid literal for int() with base 10: 'MXXX'

~/.local/bin 
❯ ./roman -r MXXX
1030

III. numconv in repos (I don't know how to use it exactly)

echo MXXX | numconv -f all -t Western_Lower
1030
echo 1030 | numconv -f all -t Roman
Number system Roman is not suitable for string generation.

but for roman to numeral you could add a function like this

# roman 2 number
woot () {
    echo "$1" | numconv -f all -t Western_Lower
}

to your .bashrc (or .zshrc), so

woot MXXX
1030

Nyce the numconv method work the script of github above in my bunsenlabs dont run well I I mark as executable, when I click simple opens with geany or "bl editor text", If I try to run it by terminal also no work :

joao@debian-asus:~/programas-varios$ sh rom2num.sh
rom2num.sh: 2: set: Illegal option -o pipefail
joao@debian-asus:~/programas-varios$ bash rom2num.sh
rom2num.sh: linha 4: $1: variável desassociada
joao@debian-asus:~/programas-varios$


But!
Numonv works I only needs to do the inverse also convert roman to arabic and also can convert arabic to roman.

Thanks.

Offline

#8 2021-03-17 14:10:08

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,258
Website

Re: Roman2Arabic program conversor

That python thing is bidirectional as it seems, that is how I made it work:

sudo apt remove python3-roman
# sudo apt install pip3
# edit:  
sudo apt install python3-pip
pip3 install --user roman
cd .local/bin
./roman -r XXX
30
./roman 30
XXX

Then you would add .local/bin to $PATH or just make some nice aliases. For example in .bash_aliases add

alias a2r="~/.local/bin/roman"
alias r2a="~/.local/bin/roman -r"

Last edited by brontosaurusrex (2021-03-17 17:51:13)

Offline

#9 2021-03-17 17:31:16

portaro
Member
Registered: 2020-01-03
Posts: 25

Re: Roman2Arabic program conversor

In my case my system dont have any target to install pip3

sudo apt install pip3
[sudo] senha para joao:
A ler as listas de pacotes... Pronto
A construir árvore de dependências       
A ler a informação de estado... Pronto
E: Não foi possível encontrar o pacote pip3

Offline

#10 2021-03-17 17:46:25

ahillio
Member
Registered: 2021-03-13
Posts: 18

Re: Roman2Arabic program conversor

Do this instead

sudo apt-get install python3-pip

that should give you pip3 smile

Offline

#11 2021-03-17 17:50:26

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,258
Website

Re: Roman2Arabic program conversor

^That.

Offline

#12 2021-03-17 20:18:16

portaro
Member
Registered: 2020-01-03
Posts: 25

Re: Roman2Arabic program conversor

Ok I install and works well, but I allways need move my user to path

cd ~/.local/bin/

And then execute orders to the script like your model, Am I right ?

Thanks.

Last edited by portaro (2021-03-17 20:22:31)

Offline

#13 2021-03-18 07:04:35

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,258
Website

Re: Roman2Arabic program conversor

brontosaurusrex wrote:

you would add .local/bin to $PATH or/and just make some nice aliases. For example in .bash_aliases add

alias a2r="~/.local/bin/roman"
alias r2a="~/.local/bin/roman -r"

Some reading about $PATH
https://linuxize.com/post/how-to-add-di … -in-linux/

You could also do some conditional scripting in your .bashrc (or .zshrc), like

# add to path
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

edit: btw, This problem has really little to do with Bunsen, perhaps change topic to 'Roman2Arabic' or similar.

Last edited by brontosaurusrex (2021-03-18 10:36:04)

Offline

Board footer

Powered by FluxBB