I know that I can implement a Java interface with Jython like this:
class MyListener (Listener):
def foo(self, event):
print(str(event))
Python has first-class functions so that seems like an overkill - especially for interfaces with one method. Is there a way to just pass a lambda or function which implements a single method i...
I have this insert command where iam trying to insert a number to be taken from loop
i=0
for line in column:
myStmt.executeQuery("INSERT INTO REVERSE_COL
( TABLE_NAME,COL_NAME,POS) values
(,'test','"+column[i]+"','"+i+"'")
i=i+1
POS IS NUMBER DATATYPE
but it works if i hard code as 1
i=0
for line in column:
myStmt.execut...
Hi everyone ,
count_record=file.readline()
count_prev=count_record[:-1] ,
i used this to read the previous line and it worked but now when i am using
count_next=count_record[:+1] i am not able to read the next line , is there is way to do so read the next time .
Thanks for your help
...
Hi everyone,
I have a written a loop for and if condition and I want to break to loop completely when if gets satisfied.
while count:
i=0
for line in read_record:
#print str.strip(count[1:28])
#print str.strip(read_record[i])
if string.find(str.strip(read_record[i]),str.strip(count[1:28]))>0:
...
Hi,
I have not a lot of knowledge of python and network programming. Currently I am trying to implement a simple application which can receive a text message sent by the user, fetch some information from the google search api, and return the results via text message to the user. This application will continue to listening to the users m...
Hi everyone,
can i call a jython file from another jython program and execute that .
Also i know os.system(cmd.exe)get the system prompt . is it possible that i can trigger cmd.exe and cmd.exe gets poped up into the screen.
Thanks
...
hi everyone
myRs=myStmt.executeQuery("select i_col,col_name from tab_col")
i=0
while (myRs.next()):
list= myRs.getString("I_COL")+','+myRs.getString("COL_NAME")
i have a jython code to run a sql statement i want to store all the row of the sql into a single variable. I used to list to store the value but its always storing only t...
Hi everyone,
how to display record of the list in different line
['0 , INDIVS08 , ODI_TEMP', '1 , C$_0EMPLOYEES , ODI_TEMP', '2 , C$_0PACS08 , ODI_TEMP']
i want to display as
'0 , INDIVS08 , ODI_TEMP' ,
'1 , C$_0EMPLOYEES , ODI_TEMP',
'2 , C$_0PACS08 , ODI_TEMP'
Thanks for all of your help
...
result=sqlstring.executeQuery("select distinct table_name,owner from all_tables ")
rs.append(str(i)+' , '+result.getString("table_name")+' , '+result.getString("owner"))
If i want to display the query select * from all_tables or ' select count(*) from all_tables'
how can i get the output to display . Please suggest thanks
...
I'm working on an application that intersperses a bunch of jython and java code. Due to the nature of the program (using wsadmin) we are really restricted to Python 2.1
We currently have a jar containing both java source and .py modules. The code is currently invoked using java, but I'd like to remove this in favor of migrating as muc...
Hi everyone,
how to do a select * from table in jython and get the result for each row into a list or string.
i know how to do for select counmn_name1 ,column_name2 from table1 but not able to figure out for select *
Please suggest .thanks
...
It looks like I'm missing something.
When using Jython to run my Python code in Java, Java bytecode files are generated (test.py -> [email protected]).
Can I run these classes directly using java?
In other words, I want to make this:
$ java test@py [additional cp args]
work.
The intent: writing Python code and not having to give away ...
Here's the situation. I have a jython 2.1 script in a shared account that needs to know who is calling it. In bash, I can simply use $(who -m) and it will give me the correct username.
By "shared account", I mean I log in as myself, then $(sudo su - shared_account) to get to the shared account.
I haven't been able to find anything in j...
I'm learning Jython.
I developed a simple Swing Application with Jython and it's ok.
Now I would to use the Swing Application Framework (JSR 296).
I did not find any example in Internet.
...
http://docs.djangoproject.com/en/dev/intro/tutorial03/
I was at the step Decoupling the URLconfs where the tutorial illustrates how to decouple urls.py. On doing exactly what it says, i get the following error-
error at /polls/1/
nothing to repeat
Request Method: GET
Request URL: http://localhost:8000/polls/1/
Exception Type: error
...
I'm trying to call Jython from a Java 6 application using javax.script:
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class jythonEx
{
public static void main (String args[]) throws ScriptException
{
ScriptEngineManager mgr = new ScriptEngineManage...
So the wonderful low down on this doozie of a problem:
short version:
We are building a distribution system for this item of software we're using. Basically we take out build artifact, store it on an ftp server which passes it to multiple clients which execute scripts to patch their servers.
Long version:
1 distribution server
mult...
I'm working with dicts in jython which are created from importing/parsing JSON. Working with certain sections I see the following message:
TypeError: str indices must be integers
This occurs when I do something like:
if jsondata['foo']['bar'].lower() == 'baz':
...
Where jsondata looks like:
{'foo': {'bar':'baz'} }
What does ...
Hi guys,
I come a across a tricky issue developing wsadmin code for websphere. No matter what file I choose, os.stat() seems always to give me back a uid = 0. See the following files:
-rw-r--r-- 1 tn58660 other 1625 Apr 26 15:03 search.py
-rw-r--r-- 1 wasapps wasapp 109 Mar 22 17:27 test.py
bash-3.00# /export/opt/W...
Quite-probably a silly question, as I don't know much about Java/Jython/JRuby/bytecode, but..
I stumbled across _why's unholy again today.. It allows you to output Python bytecode from Ruby code.. Basically allowing them to produce the same bytecode..
Jython outputs Java bytecode, as does JRuby.. Since these both compile to the same by...