Forums

python help

hey guy, i have a python, that imports, threadpool.py and threadpoool.pyc and a .txt to make it work, on my own pc it works perfectly, but on the pythonanywhere, it messes up somehow, i have no clue, is this way of using a py possible on pythonanywhere? i wonder or am i doing something wrong. lets put the stuff in a row

  • a python that imports, threadpool
  • a python that imports, information, from a .txt
  • works fine on my pc, not here

tyvm

How does it not work? What error do you get?

let me try to firstly re-explain-

the main python script in the folder, imports, information from a .txt in the same folder, to work, it also imports threadpool.

the main python itself, also copy/paste information back, into another .txt in the same folder, on my pc it works fine, on here it doesnt, the error is

Preparing execution environment... OK Installing Flux capacitors... OK Loading Python2.7 interpreter...

and nothing more

Does it clear the screen after that output?

Can I suggest you open a bash console, navigate to the correct directory, and then try "python yourfile.py"

can you give me an example of a directory, cuz i tried few different ways it cant find the file hm /home/fatih03/pm/proset.py didnt work hm what do i exactly type while using the bash

pm is the folder the py is in. tyvm

also it does not, clear, it just stays like that loading... etc

very strange

01:40 ~ $ /home/fatih03/pm/ bash: /home/fatih03/pm/: Is a directory 01:40 ~ $ /home/fatih03/pm/proset.py bash: /home/fatih03/pm/proset.py: No such file or directory 01:40 ~ $

its clearly called ProSet.py hm and its there hm wierd

tried a different py, through bash hm

01:42 ~ $ /home/fatih03/pm/trusteer.py bash: /home/fatih03/pm/trusteer.py: Permission denied 01:46 ~ $

but this one works fine, without bash.

That's because linux is case sensitive. so you needed to call ProSet.py instead of proset.py

Also, you may need to use chmod to give the correct permissions. (eg: chmod 777 trusteer.py) before running it.

Even when you Chmod it the script still needs a shebang ( #!/bin/python ). Save yourself the trouble and just run python ./ProSet.py. Path of least resistance.