Can't get [4]*(1<<30)] to work with sage: s = "1,2,3,4,100"
sage: [ZZ(x) for x in s.split(',')]
[1, 2, 3, 4, 100]
I am using a try/exception on the input from the field in the form.
If one puts any strange string it shows an error.
Robert did you see my post for help with my API?
On Sep 14, 7:5
On Sep 14, 2009, at 12:09 PM, Mikie wrote:
> Robert,
>
> Can I use your technique above to input this string? The "[5]*3"
> gives me a problem
>
> L1="[3,10,15,23,25,30,3,[5]*3]"
You can, but here you're getting to the point where you're allowing
arbitrary input, not just a list of integers.
Robert,
Can I use your technique above to input this string? The "[5]*3"
gives me a problem
L1="[3,10,15,23,25,30,3,[5]*3]"
On Sep 10, 1:56 pm, Robert Bradshaw
wrote:
> On Sep 10, 2009, at 12:24 PM, Robert Bradshaw wrote:
>
>
>
>
>
>
>
> > On Sep 9, 2009, at 9:01 AM, Tim Dumol wrote:
>
> >>
On Sep 10, 2009, at 12:24 PM, Robert Bradshaw wrote:
>
> On Sep 9, 2009, at 9:01 AM, Tim Dumol wrote:
>
>> `eval(the_string, globals = {"__builtins__":None}, locals = {})`
>> should do it. This removes access from all functions. Add any
>> functions that are needed by adding them to the "locals"
On Sep 9, 2009, at 9:01 AM, Tim Dumol wrote:
> `eval(the_string, globals = {"__builtins__":None}, locals = {})`
> should do it. This removes access from all functions. Add any
> functions that are needed by adding them to the "locals" dictionary.
>
> As stated in: http://stackoverflow.com/questio
`eval(the_string, globals = {"__builtins__":None}, locals = {})`
should do it. This removes access from all functions. Add any
functions that are needed by adding them to the "locals" dictionary.
As stated in:
http://stackoverflow.com/questions/661084/security-of-pythons-eval-on-untrusted-string
I need to be able to input a string like this ---
L1="[3,10,15,23,25,30,3,[5]*3]"
Need the repeated values for the 5. If I don't have repeated values
your code works.
I have done some error traping for "eval". Users can not put
something like "rm".
On Sep 8, 2:38 pm, Robert Bradshaw
wrote:
> O
On Sep 8, 2009, at 11:28 AM, Mikie wrote:
> Here is the function
> ---
> def BasicStats1a(exp1):
> v = exp1
> v1 = eval(v);Count_=len(v1)
> sort_v1=sorted(v1)
> M1 =stats.mode(v1); v3=eval(str(M1[0])); v4=eval(str(M1[1]))
> R1 = stats.mean(v1);R2 =
Here is the function
---
def BasicStats1a(exp1):
v = exp1
v1 = eval(v);Count_=len(v1)
sort_v1=sorted(v1)
M1 =stats.mode(v1); v3=eval(str(M1[0])); v4=eval(str(M1[1]))
R1 = stats.mean(v1);R2 = stats.median(v1)
R3 = stats.std(v1)
var_=R3**2
Can you please elaborate, what kind of list it is? Post an example,
tell us what web form it is (if necessary) and what do you want to do
with it? Besides eval, there is also sage_eval.
H
On Sep 8, 7:01 pm, Mikie wrote:
> I am taking a string that is a list. It is coming from a html form.
> Is
10 matches
Mail list logo