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

When pyjs.py tests/algorithms/fib.py -o fib.js is run via command prompt, pyjs.py opens #83

Open
derpasaurs opened this issue Feb 20, 2014 · 9 comments

Comments

@derpasaurs
Copy link

When I run pyjs.py tests/algorithms/fib.py -o fib.js, via command prompt, pyjs.py opens in my IDE. The javascript file does not get written. how can I fix this?

@Neppord
Copy link
Collaborator

Neppord commented Feb 20, 2014

What OS do you run?

2014-02-20 5:01 GMT+01:00 derpasaurs notifications@github.com:

When I run pyjs.py tests/algorithms/fib.py -o fib.js, via command prompt,
pyjs.py opens in my IDE. The javascript file does not get written. how can
I fix this?


Reply to this email directly or view it on GitHubhttps://github.com//issues/83
.

Samuel Ytterbrink

@derpasaurs
Copy link
Author

windows

@Neppord
Copy link
Collaborator

Neppord commented Feb 20, 2014

try to prefix pyjs,py with python
$ python pyjs.py tests/algorithms/fib.py -o fib.js

2014-02-20 19:23 GMT+01:00 derpasaurs notifications@github.com:

windows


Reply to this email directly or view it on GitHubhttps://github.com//issues/83#issuecomment-35652435
.

Samuel Ytterbrink

@derpasaurs
Copy link
Author

yes, this works, but when i open it in note pad:
var fib = function() { var __kwargs = __kwargs_get(arguments); var __varargs = __varargs_get(arguments); var $v1 = Array.prototype.slice.call(arguments).concat(js(__varargs)); var x = ('x' in __kwargs) ? __kwargs['x'] : $v1[0]; delete __kwargs.x if (x === undefined) { py_builtins.print('fib() did not get parameter x'); }; if (bool(x.PY$__eq__($c1)) === True) { return x; } else { return x.PY$__mul__(fib(x.PY$__sub__($c1))); } return None; } py_builtins.print(fib($c4));

This is not js. Also how do i put it in my browser

@derpasaurs
Copy link
Author

how can i make it JS

@Neppord
Copy link
Collaborator

Neppord commented Feb 21, 2014

That is JavaScript.

Can someone elese help me out here (ping CI), and explain this?

fredagen den 21:e februari 2014 skrev derpasaurs notifications@github.com:

how can i make it JS


Reply to this email directly or view it on GitHubhttps://github.com//issues/83#issuecomment-35683392
.

Samuel Ytterbrink

@derpasaurs
Copy link
Author

whats the : py_builtins.print??

@Neppord
Copy link
Collaborator

Neppord commented Feb 21, 2014

Its pythons print function, its located in the builtins javascript library
that are shipped with pyjaco.

2014-02-21 2:51 GMT+01:00 derpasaurs notifications@github.com:

whats the : py_builtins.print??


Reply to this email directly or view it on GitHubhttps://github.com//issues/83#issuecomment-35691495
.

Samuel Ytterbrink

@derpasaurs
Copy link
Author

so: how can I run a python script that will count up to 50 in my web browser?

number = 0
for i in range(51):
    print (number)
    number = number + 1

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

No branches or pull requests

2 participants