score:1
i found the answer. i needed to test this remote debugger approach.
let me explain how i found out:
i have a local system with python 2.6.5. i created a new remote system (virtual machine in this case) with python 2.7.3. then i shared the following script:
import pydevd
print 'hello world'
# call debugger server to handle this breakpoint
pydevd.settrace('10.31.94.156', stdouttoserver=true, stderrtoserver=true)
# fron now on the host (debugger server) has control over breakpoints,
# variables, stepping through code etc.
print 'hi again'
import sys
print sys.version # 2.7.3 (default, sep 26 2013, 20:08:41)
# [gcc 4.6.3]
# now use a 2.7 feature:
x = {i : chr(65+i) for i in range(4)} # dict comprehension
print x # {0: 'a', 1: 'b', 2: 'c', 3: 'd'}
import socket
print socket.gethostname() # my virtual machine name
print 'done'
of course i added some breakpoints in eclipse on my hostmachine. it's funny to see that the local interpreter gives errors about the list comprehension, while it does actually run. and it also has variable x nicely displayed in the debuggers variables pane.
conclusion: the remote interpreter is used to run / evaluate code. the debugger server helps you ad
score:0
here are two ways to determine the current python version.
via code:
python -c 'import sys; print sys.version'
2.7.5+ (default, feb 27 2014, 19:37:08)
[gcc 4.8.1]
and via
direct command:
python -v
python 2.7.5+
also
hostname:
print socket.gethostname()
score:0
if you are using code and not sure if it is v2 or v3 you can use
import sys
try:
print sys.version
except:
print(sys.version)
Source: stackoverflow.com
Related Query
- Unclear which Python version is used with Remote Debugging (Eclipse Pydev)
- How to setup remote debugging with Eclipse and PyDev
- Can't get PyDev remote debugging to work with Eclipse
- Which version of pylint can be used with python 2.6.6?
- Remote debugging Tomcat with Eclipse
- How to set up the Eclipse for remote C debugging with gdbserver?
- Remote debugging C++ applications with Eclipse CDT/RSE/RDT
- How to do remote debugging with Eclipse CDT without gdbserver?
- Eclipse Remote debugging with jboss
- remote debugging a jnlp application with eclipse
- Remote debugging python project in eclipse
- Run External Python Programs with Eclipse PyDev
- Remote debugging C++ application with Eclipse GUI
- Remote Debugging with JPDA won't connect to Tomcat through eclipse when using Docker-Compose
- Which version of Eclipse to use with Android
- Which version of FindBugs works with Eclipse Luna?
- Can't hit breakpoints for user generated actions when debugging jython code with PyDev in Eclipse
- Eclipse 3.4 + Tomcat 6.0 + Remote Debugging with Console Output
- Remote C debugging with Eclipse
- Debugging a remote Java application with Eclipse as the server (Socket listen)
- Remote debugging on Tomcat with Eclipse
- Why do I get the failed to load with Java version 1.7.0_45 with Eclipse with JBoss modules used
- Django debugging with Eclipse and PyDev
- Debugging in Eclipse with remote GDB
- virtualenv python - using Pydev with Eclipse neon
- Eclipse Pydev autocomplete not working with error: java.lang.RuntimeException: The python client still hasn't connected back to the eclipse java vm
- Jython debugging in Eclipse with PyDev raises RuntimeError: cannot join current thread
- remote debugging with maven tomcat and eclipse
- Eclipse remote debugging doesn't work with hadoop in pseudo-distributed mode
- Which Eclipse version is compatible with Tomcat 10, or do I go back to Tomcat 9?
More Query from same tag
- How to create Android App with Cordova 3.4
- Java Annotation Processing, create a source file in the same package as the annotated class
- More Intelligent Eclipse "Open Call Hierarchy"?
- Maven downloads corrupted jar
- Google Cloud Tools for Eclipse ClassNotFoundException for GcsFilename
- working (compiling and running) on project with java 6 when java 8 installed
- Eclipse running old version of Java program
- Scala IDE doesn't show documentation during autocomplete hints
- Unresolved Inclusion: Eclipse Not Showing "Includes" tab under "Paths and Symbols":
- Singleton object destroy in jar but work in eclipse
- Android: java.lang.ClassNotFoundException
- IllegalAccessException when loading .jrxml
- How to use method of one class into other in TestNG
- org.eclipse.ui.popupMenus link is grayed out
- How to refresh src/main/resources folder while executing the code?
- What is the best open source common lisp implementation that works with Eclipse?
- src files are not showing in my Eclipse
- Retrieving COM class factory failed error: 80040154
- java.lang.NumberFormatException: For input string: “ ”
- Using Eclipse, something keeps adding src/test/java to the classpath
- Type Error generating final archive: java.io.FileNotFoundException:xx\bin\resources.ap_ does not exist
- Use a Kotlin jar library in Java project in Eclipse
- SDK Manager Invalid Argument: Connect
- How to wadl2java these days?
- Project documents managing
- Display inputted TextField's in a different TextArea
- How to use Mercurial, Maven and Eclipse together?
- Failed to connect to remote VM. Connection refused. when trying to debug remote java application in Flash Builder 4.7
- ia32lib installing Ubuntu studio
- iOS automation with appium on Simulator