interpreter

Using WinPython as Interpreter for PyCharm

邮差的信 提交于 2019-12-01 19:05:13
sorry for a simple question! I want to use WinPython (recently installed) as a interpreter for PyCharm Community Edition but am getting an error "The selected file is not a valid home for Python SDK" (see image) Does anybody have any idea of what the issue may be? Do I have to do any other steps (with the path, etc.)? cricket_007 You need to select the folder where a python.exe (and possibly pythonw.exe ) exists, which looks like maybe the python-3.4.4.amd64 folder And, according to this answer open PyCharm and add a new python interpreter giving the path of where you installed Winpython to

How programs written in interpreted languages are executed if they are never translated into machine language?

久未见 提交于 2019-12-01 18:59:19
Computers can only understand machine language. Then how come interepreters execute a program directly without translating it into machine language? For example: <?php echo "Hello, World!" ; It's a simple Hello World program written in PHP. How does it execute in machine while the machine has no idea what echo is? How does it output what's expected, in this case, the string Hello, World!? Many interpreters, including the official PHP interpreter, actually translate the code to a byte code format before executing it for performance (and I suppose flexibility) reasons, but at its simplest, an

How come when I press the Up or Down Arrow keys in the Python interpreter I get ^[[A or ^[[B instead of history? [duplicate]

你。 提交于 2019-12-01 13:42:52
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Python shell: Arrow keys do not work on remote machine I have no idea why history won't work in the Python 2.7.2 interpreter. I get strange character groups for each of the arrow keys. This doesn't happen in Terminal. BTW I am on Ubuntu 10.04. Here is a screen shot of this hell: How do I get back the ability to get my command history by pressing the Up and Down Arrow keys? 回答1: It looks as if you're using a

PHP interpreter gets undefined constant OCI_COMMIT_ON_SUCCESS with ADODB

假装没事ソ 提交于 2019-12-01 06:34:15
I wrote a php script that must be run on the php interpreter (Without Apache), which uses the adodb library with an Oracle database, but when I try to run it, I'm getting the following error: PHP Notice: Use of undefined constant OCI_COMMIT_ON_SUCCESS - assumed 'OCI_COMMIT_ON_SUCCESS' in c:\proyect\backend\libraries\adodb\adodb.inc.php on line 4248 I've checked, and have both the php_oci8 and php_oci8_11g enabled, so the constant SHOULD be defined. Also, when I run this script WITH Apache, it works without any problems. Thanks in advance! After a quick search I found this page . If you don't

Difference between “inspect” and “interactive” command line flags in Python

亡梦爱人 提交于 2019-12-01 05:11:17
What is the difference between "inspect" and "interactive" flags? The sys.flags function prints both of them. How can they both have "-i" flag according to the documentation of sys.flags? How can I set them separately? If I use "python -i", both of them will be set to 1. Related: tell whether python is in -i mode According to pythonrun.c corresponding Py_InspectFlag and Py_InteractiveFlag are used as follows: int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */ /* snip */ static void handle_system_exit(void) { PyObject *exception, *value, *tb; int exitcode = 0; if (Py

Will PHP be slower if we add too many comments in code files? [duplicate]

十年热恋 提交于 2019-12-01 03:17:36
Possible Duplicate: Commenting interpreted code and performance Does comments affect when including files in PHP? Let's say we have 100 class files and everytime when a page is requested, all these classes must be parsed by PHP. Will PHP be slower if almost 1 half of the source code lines are the comments? Because usually I add a lot of comments & descriptions to code. This doesn't matter to compilers coz comments are not compiled, but PHP is interpreter, any bad thing may happen? Yes, but it's minimal, and this can (and should) be addressed entirely by using APC or another opcode cache. As a

Difference between “inspect” and “interactive” command line flags in Python

折月煮酒 提交于 2019-12-01 02:19:25
问题 What is the difference between "inspect" and "interactive" flags? The sys.flags function prints both of them. How can they both have "-i" flag according to the documentation of sys.flags? How can I set them separately? If I use "python -i", both of them will be set to 1. Related: tell whether python is in -i mode 回答1: According to pythonrun.c corresponding Py_InspectFlag and Py_InteractiveFlag are used as follows: int Py_InspectFlag; /* Needed to determine whether to exit at SystemError */ /*

IS there a way to turn off JIT compiler and is there a performance impact by doing so?

那年仲夏 提交于 2019-12-01 01:10:25
问题 What does it mean for a java program to be JIT'ed and does it make the execution a lot more faster or are there bytecodes which are not JIT'ed? 回答1: There is two ways to disable the JIT -Djava.compiler=NONE or this will almost never compile anything -XX:CompileThreshold=2000000000 or on IBM JVM -nojit Disabling the JIT can slow down your code a lot e.g. 50x but not always. If you spend most of your time doing IO or GUI updates you might find it makes little difference. 回答2: For IBM the

Clarification regarding traditional interpreter, compiler and JIT compiler/interpreter

前提是你 提交于 2019-11-30 22:39:04
I'm learning Java and the following things are a bit confusing for me. What I understood is: Java Compiler → The Java compiler just converts .java programs into .class files, which means converting our source code into bytecode (it is a list of op codes for the virtual machine (JVM) which makes Java platform-independent). Java Interpreter → merely "interprets" the code and does not transform it into native machine code. It executes each and every instruction of the byte code one-by-one as a command and carries it out, regardless how many time the same instruction occurs. That's why it's slow

what does the '~' mean in python? [duplicate]

孤者浪人 提交于 2019-11-30 18:26:20
This question already has an answer here: bit-wise operation unary ~ (invert) 5 answers what does the '~' mean in python? i found this BF interpreter in python a while ago. import sys #c,i,r,p=0,0,[0]*255,raw_input() c=0 i=0 p=raw_input() r=[0]*255 while c<len(p): m,n,u=p[c],0,r[i] if m==">":i+=1 if m=="<":i-=1 if m=="+":r[i]+=1 if m=="-":r[i]-=1 if m==".":sys.stdout.write(chr(u)) if m=="[": if ~u: while 1: m=p[c] if m=="]":n-=1 if m=="[":n+=1 if ~n:break c+=1 if m=="]": if u: while 1: m=p[c] if m=="]":n-=1 if m=="[":n+=1 if ~n:break c-=1 c+=1 and i want to know what it does because i want to