473,395 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Parsing python dictionary in Java using JPython

Dear All,

I have a python dictionary file. I want to create a map of that dictionary and want to use the same in my Java Program.
Can anybody please tell me how to use the same python dictionary in Java aswell as in Python.

Thanks in advance...

Regards,
Sandip

--
India.com free e-mail - www.india.com.
Check out our value-added Premium features, such as an extra 20MB for mail storage, POP3, e-mail forwarding, and ads-free mailboxes!
May 26 '06 #1
3 2707
Ant
It really depends on how you are trying to pass the dictionary across
to Java, what sort of objects are in the dictionary etc. Could you
provide some more background?

BTW the Java implementation of Python is now called Jython (and has
been for some years!).

May 26 '06 #2
> I have a python dictionary file. I want to create a map of that dictionary and want to use the same in my Java Program.
Can anybody please tell me how to use the same python dictionary in Java as well as in Python.


Try a JSON parser for Java

http://www.json.org/

http://www.json.org/java/simple.txt
http://developer.berlios.de/projects/jsontools/
http://www.json.org/java/index.html

May 26 '06 #3
Ant
This will work fine in simple cases and if the dictionaries are passed
around in repr() form.

If they are being passed pickled in some way, or the values in the
dictionary are anything other than strings, lists, dictionaries or
combinations of these then you will need something like Jython.

May 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Ajay | last post by:
hi! can you call a Python application from a Java program? does this require any additional package to be installed? thanks cheers
28
by: liorm | last post by:
Hi everyone, I need to write a web app, that will support millions of user accounts, template-based user pages and files upload. The client is going to be written in Flash. I wondered if I coudl...
6
by: JKPeck | last post by:
Suppose you have an application written in Java, and you want to enable other applications or processes written in Python to communicate with it, i.e., to use Python as a scripting language for the...
8
by: Aravind | last post by:
hi, some of my friends told that python and java are similar in the idea of platform independency. Can anyone give me an idea as i'm a newbie to java and python but used to C++. My idea is to...
31
by: David Cramer | last post by:
If you had an application that you were about to begin development on which you wanted to be cross platform (at least Mac and Windows), would you suggest using c++ and Python? I'm asking because...
34
by: Anthony Irwin | last post by:
Hi All, I am currently trying to decide between using python or java and have a few quick questions about python that you may be able to help with. #1 Does python have something like javas...
3
by: galadhad | last post by:
Okay, here goes. I'm new to Python (and relatively new to programming/scripting in general - I understand basics, but complex concepts are still beyond my limited knowledge). I am working on a...
1
by: datulaida | last post by:
Hi.. How to connect Python with Java. This is my Python program. i use jpype to connect Python with Java. Code: ( text ) 1. from jpype import * 2. startJVM("d:/Program...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.