python javar send
# -*- coding: utf-8 -*-
import jpype
import os.path
jarpath = os.path.join(os.path.abspath('.'), 'axja')
print("=====>jarpath: " , jarpath)
# jpype=startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % ('D:/pyspace/pyChapter1/test/axja/TesCrypt.jar'))
# startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM("D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll", "-ea")
# startJVM(getDefaultJVMPath(),"-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM(getDefaultJVMPath(),"-ea", "-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# JDClass = JClass("jpype.com.azx.crypt.JpypeDemo")
# jvmPath = jpype.getDefaultJVMPath() # 默认的JVM路径
# jvmPath ="D:/envs/jdk/jdk32/jdk7/jdk1.7.0_79/jre/bin/client/jvm.dll" # 默认的JVM路径
jvmPath ="D:/devsoft/ultimate/env/jdk/jdk7/Java17017/jre7/bin/server/jvm.dll" # 默认的JVM路径
print(jvmPath)
# jpype.startJVM(jvmPath,"-ea","-Djava.class.path=%s" % (jarpath + 'TesCrypt.jar'))
# startJVM("C:/Java/jdk1.6.0_10/jre/bin/client/jvm.dll","-ea", "-Djava.class.path=%s" % (jarpath + 'jpypedemo.jar'))
ext_classpath = r'D:\pyspace\pyChapter1\test\axja\TesCrypt.jar'
#jarpath = os.path.join(os.path.abspath('.'), 'F:/sample_Py/') #os not found
jvmArg = '-Djava.class.path=%s'%ext_classpath
print("=====>jvmArg: " , jvmArg)
jpype.startJVM(jvmPath,'-ea',jvmArg)
# JDClass = JClass("jpype.com.azx.crypt.JpypeDemo")
JDClass = jpype.JClass("com.azx.crypt.JpypeDemo")
jd = JDClass()
jd.sayHello("wxxxxxxaw")
#jd = JPackage("jpype").JpypeDemo() #两种创建jd的方法
jpype.java.lang.System.out.println("hello world!")
# jd = JPackage("jpype.com.azx.crypt.").JpypeDemo() #两种创建jd的方法
# jd = JDClass()
# jd.sayHello("hello world")
jpype.shutdownJVM()
# _*_ coding:utf-8 _*_
import jpype
jvmPath = jpype.getDefaultJVMPath() # 默认的JVM路径
print(jvmPath)
jpype.startJVM(jvmPath)
jpype.java.lang.System.out.println("hello world!")
jpype.java.lang.System.out.println("I hate you!")
jpype.shutdownJVM()
python javar send的更多相关文章
- python auto send email
/*************************************************************************** * python auto send emai ...
- Python中send()和sendall()的区别
Python中send()和sendall()的区别 估计每个学习Python网络编程的人,都会遇到过这样的问题: send()和sendall()到底有什么区别? send()和sendall()原 ...
- python email ==> send 发送邮件 :) [smtplib, email 模块]
关于Email的预备知识: 原贴地址:http://www.cnblogs.com/lonelycatcher/archive/2012/02/09/2343480.html ############ ...
- python trojan development 1st —— use python to send mail and caputre the screen then combine them
import smtplib from email.mime.text import MIMEText msg_from='1@qq.com' #发送方邮箱 passwd='bd' #填入发送方邮箱的 ...
- python trojan development 2nd —— use python to send mail and listen to the key board then combine them
请勿用于非法用途!!!!!本人概不负责!!!原创作品,转载说明出处!!!!! from pynput.keyboard import Key,Listener import logging impor ...
- python yield: send, close, throw
send 1. yield可以产出值,可以接收值 2. 在调用send发送非none值之前,我们必须启动一次生成器, 方式有两种 a. gen.send(None) b. next(gen) def ...
- Python中send和sendall的区别
官方文档对socket模式下的socket.send() 和 socket.sendall()解释如下: sock.sendall(string[, flags]) Send data to the ...
- python莫名其妙的yield, yield from, yield.send
练了几行代码, 慢慢找感觉. TASK,多线程,异步,很多地方都用到的呢. #!/usr/bin/env python # -*- coding: utf-8 -*- import time from ...
- python之网络编程
本地的进程间通信(IPC)有很多种方式,但可以总结为下面4类: 消息传递(管道.FIFO.消息队列) 同步(互斥量.条件变量.读写锁.文件和写记录锁.信号量) 共享内存(匿名的和具名的) 远程过程调用 ...
随机推荐
- libxml2的xpath检索中文
ZC: xmlXPathEvalExpression(...) 当 xpath的字符串中 包含中文的时候,返回NULL,暂时不知道该怎么处理了... ZC: 下面是测试的一些代码/文件,留着以后再研究 ...
- 力扣(LeetCode) 66. 加一
给定一个由整数组成的非空数组所表示的非负整数,在该数的基础上加一. 最高位数字存放在数组的首位, 数组中每个元素只存储一个数字. 你可以假设除了整数 0 之外,这个整数不会以零开头. 示例 1: 输入 ...
- QT---事件系统
1 QT事件系统 1.1 事件的定义 QT中事件是有专门的类QEvent,常见的有键盘事件QKeyEvent.鼠标事件QMouseEvent和定时器事件QTimerEvent.例如用 ...
- centos 安装 FLEXPART
师哥做了个课题,用FLEXPART分析大气伴飞轨迹,提前先安装这个软件吧.我使用的环境是centos7,看官慢慢看,结尾有彩蛋~ 准备工作,flexpart是用Fortran语言写的,以.90结尾的文 ...
- slf4j/logback: logging日志的配置
slf4j/logback: logging日志的配置 import依赖: import org.slf4j.Logger;import org.slf4j.LoggerFactory;private ...
- Bash Shell 注释多行的几种方法(转)
很实用的小技巧. 我们shell脚本写好了,但是想一行一行测试,怎么办. 笨方法:每行前面加一个 #,有时候我们原脚本里面本来就有注释,所以想再恢复的时候就麻烦了. Bash Shell 注释多行的几 ...
- mat 使用 分析 oom 使用 Eclipse Memory Analyzer 进行堆转储文件分析
概述 对于大型 JAVA 应用程序来说,再精细的测试也难以堵住所有的漏洞,即便我们在测试阶段进行了大量卓有成效的工作,很多问题还是会在生产环境下暴露出来,并且很难在测试环境中进行重现.JVM 能够记录 ...
- 【模板/经典题型】FWT
FWT在三种位运算下都满足FWT(a×b)=FWT(a)*FWT(b) 其中or卷积和and卷积还可以通过FMT实现(本质上就是个高维前缀和) #include<bits/stdc++.h> ...
- cmd下可以启动java,输入javac提示 不“存在”
方法:手动把JDK安装目录的bin目录配置到PATH环境变量里
- drozer安装出现的问题
首先先检查你的手机或者模拟器是否开启了drozer agent 安装出现的问题: (1)找不到java路径: 解决方法:新建一个TXT文件,在文件中写如下内容: [executables] java ...