Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebook %form widget maker #137

Closed
boothby opened this issue Oct 18, 2006 · 1 comment
Closed

notebook %form widget maker #137

boothby opened this issue Oct 18, 2006 · 1 comment

Comments

@boothby
Copy link

boothby commented Oct 18, 2006

Example:

%form

Enter an integer n=300
Enter a prime p=2
Show prime factors only primes=False
Operate on primes op=
  * sum
  * product

{{{
  v = factor(n%p)
  if primes:
    for i in v:
      print i[0]
  else:
    for i in v:
      print "%d**%d"%i
  if op == "sum"
    print "Sum of prime factors"
    s = 0
    for i in v:
      s += i[0]*i[1]
    print s
  if op == "product"
    print "Product of distinct prime factors"
    s = 1
    for i in v:
      s *= i[0]
    print s
}}}

The above would make an interactive widget which would make an input form for the variables used in the code block. A submit button would read the input fields and display output from the code.

Component: notebook

Issue created by migration from https://trac.sagemath.org/ticket/137

@boothby boothby self-assigned this Oct 18, 2006
@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-2.10 milestone Sep 11, 2007
@jasongrout
Copy link
Member

comment:2

This will be easily possible with William's "manipulate" or "interact" patch on #1322.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants