Python Forum
a project i am thinking about
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a project i am thinking about
#1
i like to have things that figure out what to do where it makes sense. this project is one of those. what i want to do is process a string looking for all substrings (or maybe a limited number of them or just those fitting certain conditions such as safety) that can be evaluated successfully as arithmetic expressions and substituting them with the arithmetic result of that evaluation as a string of decimal digits. the idea is that the original string probably does not have some kind of enclosure to identify it, such as "$(" and ")" as used in bash, and is not formed like python source code ready for eval(). we humans can usually see an arithmetic expression in a string even if not bounded by spaces and can understand the value for simple expressions, such as "4*2+1", in many cases. more complex expressions might be harder, such as "2**(1+16/9)" (6.857951862824582).
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What WERE They Thinking : Python 3.9x millpond 8 3,799 Jun-28-2021, 01:20 AM
Last Post: millpond
  a script i am thinking about creating Skaperen 2 2,685 Feb-28-2018, 02:18 AM
Last Post: Skaperen
  a program i have been thinking about Skaperen 0 2,568 Jun-25-2017, 04:44 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020