Java has a method that opens a text box and pulls the answer:
JOptionPane.showInputDialog(frame, "What's your name?");
Is there a similar easy solution for pulling input text?
Edit: I understand that packages exist and what they are, I'm asking if you know of a package that has a one line solution
In python if you are using Tkinter then you can use
Entry()
Check this link out for more clear guidelines
Vanilla python has no methods for UI interfaces (I believe as any other programming language - Java, C#, C++, %any_other_language% use separate libraries or frameworks to create UI). There is number of libraries for python which are used to draw different user interfaces and which would allow you to do this. You could check this list, pick up the one you like more and read how you could do it there:
https://wiki.python.org/moin/GuiProgramming
On the other hand, the most commonly used one is tkinter. For tkinter, you could check examples here (there is example of creating whole python program - a loan calculator - with a UI)
http://www.python-course.eu/tkinter_entry_widgets.php
Related
i'm new to c++ and need a way for detecting the language of the text.
i searched for any plugin to do that and only found the chromum open source code.
https://code.google.com/p/cld2/
there is many pages talking about using it at python, java or stand alone but i cant find any tutorial about using it in a c++ code.
so i need a declaration for how to use it or any other good library for detecting the text language using c++.
the language text will be added by user and i want to detect if it is English , French or Arabic .. etc to apply nlp according to that.
Thanks,
Although its not a library, one option you have is to simply use Google translates API to detect the language. This is done using REST. The obvious downside is that you need to be connected to the internet to make the call. The docs explain how you can do this here
I have a C++ GUI, it load a DLL when running. I use SIP to import the DLL in python. I need to embed the python part in the GUI, and some data are needed to exchange between python and C++.
For example, in the C++ GUI, I can enter command from a panel, such as "drawSomething()", it will call corresponding function in python, and the result will be shown in the GUI.
Can I use SIP to
extract a C++ object from python object (just like the way boost.python does), or is there a better way to share data between python and c++ seamlessly?
thanks.
It turns out that I do not need to do anything complicated...
In my case, there is no difference to call functions in DLL from C++ or from python code embedded in C++.
I am totally over-thinked.
Please take a look at this Library
http://www.swig.org/Doc1.3/Python.html
There are a lot of questions and answers on how to parse/create config files in python and C++ individually. In my case, I have one single config file and need to be processed (read/write) by both python and C++.
In python world, ConfigParser is popular; while in C++, libconfig looks nice. But they are using different formats. What I am looking for is a stone being able to kill two birds at the same time. :)
An obvious solution that comes to mind is to go with something along the lines of YAML or JSON which you should find support for across many languages.
What does it take to build a Native Client app from scratch? I have looked into the documentation, and fiddled with several apps, however, I am now moving onto making my own app and I don't see anything related to creating the foundation of a native client app.
Depending on the version of the SDK you want to use, you have a couple of options.
Pepper 16 and 17: use init_project.py or use an example as a starting point
If you are using pepper_16 or pepper_17, you will find a Python script init_project.py in the project_templates in the SDK. It will setup up a complete set of files (.cc, .html, .nmf) with comments indicating where you need to add code. Run python init_project.py -h to see what options it accepts. Additional documentation can be found at https://developers.google.com/native-client/pepper17/devguide/tutorial.
Pepper 18 and newer: use an example as the starting point
If you are using pepper_18 or newer, init_project.py is no longer included. Instead you can copy a very small example from the examples directory (e.g., hello_world_glibc or hello_world_newlib for C or hello_world_interactive for C++) and use that as a starting point.
Writing completely from scratch
If you want to write your app completely from scratch, first ensure that the SDK is working by compiling and running a few of the examples. Then a good next step is to look at the classes pp::Module and pp:Instance, which your app will need to implement.
On the HTML side, write a simple page with the EMBED element for the Native Client module. Then add the JavaScript event handlers for loadstart, progress, error, abort, load, loadend, and message and have the handlers write the event data to, e.g., the JavaScript console, so that it's possible to tell what went wrong if the Native Client module didn't load. The load_progress example shows how to do this.
Next, create the manifest file (.nmf). From pepper_18 and onwards you can use the generate_nmf.py script found in the tools/ directory for this. If you want to write it from scratch, the examples provide examples both for using newlib and glibc (the two Standard C librares currently supported). See hello_world_newlib/ and hello_world_glibc/, respectively.
If you haven't used a gcc-family compiler before, it is also a good idea to look at the Makefile for some of the examples to see what compiler and linker flags to use. Compiling both for 32-bit and 64-bit right from the beginning is recommended.
Easiest way is to follow the quick start doc at https://developers.google.com/native-client/pepper18/quick-start, in particular steps 5-7 of the tutorial ( https://developers.google.com/native-client/pepper18/devguide/tutorial ) which seems to be what you are asking about.
I need to write a program that displays a PDF which a third-party supplies. I need to insert text data in to the form before displaying it to the user. I do have the option to convert the PDF in to another format, but it has to look exactly like the original PDF. C++ is the preferred language of choice, but other languages can be investigated (e.g. C#). It need to work on a Windows desktop machine.
What libraries, tools, strategies, or other programming languages do you suggest investigate to accomplish this task? Are there any online examples you could direct me to.
Thank-you in advance.
What about PoDoFo:
The PoDoFo library is a free, portable
C++ library which includes classes to
parse PDF files and modify their
contents into memory. The changes can
be written back to disk easily. The
parser can also be used to extract
information from a PDF file (for
example the parser could be used in a
PDF viewer). Besides parsing PoDoFo
includes also very simple classes to
create your own PDF files. All classes
are documented so it is easy to start
writing your own application using
PoDoFo.
iTextSharp is a free library that you can use in .Net applications. Take a look at the iText page - that is for the iText project, which is a Java library. iTextSharp is part of that project, and is a port to C# and .Net.
Consider Python It have a lot PDF librarys (both creating and extracting) eg:
http://pypi.python.org/pypi/pdfsplit/0.4.2
http://pypi.python.org/pypi/JagPDF/1.4.0
http://pypi.python.org/pypi/pdfminer/20091129
http://pypi.python.org/pypi/podofo/0.0.1
http://pypi.python.org/pypi/pyFPDF/1.52
There are also good tools for using C/C++ code in Python and to create .exe form Python scripts. If you decide to use different language consider Python as prototyping language!