Python equivalent of Java 'setchar'

so a user can enter something from standard in and echo back *'s or nothing at all instead of printing to the screen their actuall input. Like entering your password when you login.

Will the getpass module work for you?
>>> import getpass
>>> getpass.getpass()
Password:
'Secr3t'
>>> getpass.getpass("Enter your password : ")
Enter your password :
'Secr3t'
>>>

Similar Messages

  • Equivalent of java.sql.ResultSetMetaData

    Hi,
    I'm looking for something which is equivalent to java.sql.ResultSetMetaData in Toplink. Does anyone know how this can be done ?
    Thanks,
    -Prashant

    Hi,
    I have a similar problem. I want to find out the column names when i fire raw-sql. I use SQLCall to do this.
    Then I get a Vector<DatabaseRow>.
    Vector vDR = session.executeQuery( new SQLCall( "select * from table_name" ) )
    Now Is there a way to find out the column names dynamically. In the javadocs i see that objDatabaseRow.keys() returns an Enum<DatabaseField>... but i cant see javadocs on how to use DatabaseField.
    So is there any other way ?
    Thanks,
    Krishna

  • Can we define a complex type that is equivalent to java.util.List?

    hi everyone
    is it possible to define a complexType that is equivalent to java.util.List? all i know now is how to define an array of some type using either <xs:list> for simpleType or the minOccurs and maxOccurs of the element tag. i was wondering if there is way to define something equivalent to a List in java. thanks

    Define a sequence of list tems.
    <xs:element name="list">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="item"  maxOccurs="unbounded"  type="xs:string"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>

  • ReDim equivalent in Java

    Hello,
    What's the equivalent in Java of 'Redim '?
    e.g Redim RedBucket(0)(0)
    is it an ArrayList
    Thanks
    Paul

    ReDim is like ArrayList in the same way that a wheelbarrow is like a pickup truck.
    With ReDim, you have to specify the size of the array at the beginning, and then you have to decide when the size needs to be changed, and you have to decide what to change it to. With ArrayList, you don't have to do any of that. You just say "Gimme an ArrayList" and it figures out how much array space it needs by itself.
    But really, you're better off just learning Java. You won't want to speak Java with a VB accent.

  • APEX equivalent of Java Static Initialization Block

    Is there a APEX equivalent of Java static init block (i.e. execute once at class load time)? My use case is that I need to load some configuration values to an environment (i.e. APEX Workspace) specific variables and don't want to do per user session since the values remain the same for all user sessions. I believe SYS_CONTEXT is tied to user session and would not be useful for my usecase. Any advise would be appreciated.

    Hello,
    You should check the concept of User Preferences and see if it can help you:
    http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21678/aadm_mg_sessions.htm#BABHFEFD
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • $ENV perl equivalent in Java

    We are in our first steps in trying to convert some of our systems from Perl to Java.
    In a module we had (Database module) which was responsible for all DB activity, we had an area where, upon errors, we printed out $ENV{SCRIPT_NAME} environment variable, which is set by Apache and can be read by Perl. This helps us debug things by knowing which script was ran when a DB error occurred.
    As we are porting the Database module into a Database class, we are trying to think how we can achieve the same capability with Java.
    I don't know of the existence of $ENV equivalent in Java. Not one that contains the web-server executed script, in case its a script that is ran by a web server.
    Is there?
    Note that the Database module may be ran as part of a Servelet but may also be part of just a simple server script. In perl, is such case, the $ENV{SCRIPT_NAME} would come out empty.
    Any suggestions of how to do that?

    Pidgin wrote:
    As you indicated: Note that both are relatively slow and should only be used for exceptional or error conditions.
    The access to the SCRIPT_NAME is actually a web re,ated variable that we need for showing which HTTP resquest generated the specific SQL error.It's only a variable in perl (or in CGI scripts, to be more precise).
    It happens often enough, and doing a very low-level trace of the executed code migt not be the right option.SQLExceptions that need logging happen often? That shouldn't be the fact. How often?
    Stacktraces are not awfully slow. They are ok for handling errors & exceptions. But they should not be used for classical flow control.
    For example, it might be that the executing code is Script.class using Database.class, but Script.class can be initiated from www.whatever.com/script/ or www.whatever.com/premium/script/.. in each case, we want to know the full URL of the called "script'.With the stack trace you'd see the Servlet and/or Action that handles the request.
    So we do need access to the web "environment".
    What we do now, is store a static Servlet_Request variable (set on the first Database constructor, by passing the servlet request and response objects to the Database constructor). From that point on, we can access Servlet_Request.getRequestURI()That won't work as soon as more than one request is handled at the same time (which is very, very soon!).
    You might want to look into something like log4js MDC, where you can at one point in your application set a key in a map and have that appear in every log statement from that thread until it's removed again.
    This is quite different than the Perl logic, where we could access a "web enabled" System.getenv() and read from it SCRIPT_NAME or other web related parameters, if they existed (or returning null if they didn't)You should not try to apply the best practices learned by perl web programming 1:1 on Java. In the Java world pretty different concepts apply, especially when doing Web-Programming, as Perl web-applications are usually based on the rather antiquated CGI interface, while Java uses a central application server that handles each request as it wishes.

  • Forte Express Equivalent in Java

    Hi
    Can any body tell me Forte Express equivalent in Java?
    Thanks in advance

    Hi
    Can any body tell me Forte Express equivalent in Java?
    Thanks in advance

  • Struct equivalent for java array?

    What's the struct (c++) equivalent in Java?
    here's my im doing.
    class Text
    char character;
    int freq;
    public static void main(String[] args) throws IOException
    BufferedReader key = new BufferedReader(new InputStreamReader(System.in));
    Text[] letter = new Text[2];
    I want to assgined letter[0].character = 'a'; and letter[0].freq = '3' but it doesn't allow me to do that when I compile it?

    I've trying doing:
    for(i = 0; i < letter.length; i++)
                   letter.character = new Text();
                   letter[i].freq = new Text();
    and even
    for(i = 0; i < letter.length; i++)
                   letter= new Text();
    before doing
    letter[0].character = 'a';
              letter[0].freq = '3'; but got an error:
    non static varible this cannot be referenced from a static context

  • Foreach equivalent in java

    Hi all,
    I am doing some conversion process from C# to java. I am struck with c# foreach statement.
    Here I give the coding,
    foreach (MapFieldInfo item in Fields)
    if (item == null)
    continue;
    if (item.Field.Equals(fieldInfo))
    exp = item.NewExpression;
    break;
    Here the MapFieldInfo in another class. I need the equivalent java for loop for this statement.
    Pls could anyone help me.
    Thanks in advance.
    Uma

    for (Iterator it = aCollection.getIterator(); it.hasNext();){
      MyClass myObj = (MyClass)it.next();
      // .. do stuff with myObj
    }I understand that the J2SE 1.5 spec is going to add something similar to foreach to the Java language - it's really just syntactic sugar to make the code a little less verbose, though.
    Also, you just know that there are going to be people using the new nomenclature that forget what an iterator is altogether and make silly programming decisions...
    - K

  • Python code in Java

    Hello,
    I have a python script that accesses to a serial device to read/write data. Now I would like to build a JAVA application that extend this script. I can call this script as a program java? I should create a Java application that interact with the user and writes on this device using python script already in my possess. I do not wish rewrite the script python in Java.
    I have used JEPP e Jython.........other ?

    XmaverickX wrote:
    duffymo wrote:
    Or Jython.
    http://www.jython.org/Project/index.html
    %When i recompile (is right recompile ?) communication.py with jython get this error:
    0 Note: Some input files use or override a deprecated API.
    Note: Recompile with -deprecation for details.Did you recompile with -deprecation turned on to see what the details were? (I'd recommend that you do.)
    After when i include Communication.class in my java project i get this error:
    Exception in thread "main" Traceback (innermost last):
    File "/home/maverick/prova/Communication.py", line 0, in main
    File "/usr/lib/serial/__init__.py", line 9, in ?
    AttributeError: class 'string' has no attribute 'split'Looks like the Jython string class does not have an attribute 'split' that you require. Maybe it was deprecated and removed.
    Is this why you asked for something other than Jython? Better to understand and fix this problem.
    %

  • Trying to execute a python script through java

    I would like to make a command line call from java to execute a python script. The command line call would look like this:
    tilemaker.py -s 128 -Q 0 -b FFFFFF AlternateExample.png
    Also this has to be platform independent.
    I am aware of Jython but I can't use it at this point due to technical restrictions.

    you can use the jep (Java Embedded Python) package...it's very simple and u just need to call a method.....
    see the following links....
    http://jepp.sourceforge.net/javadoc/jep/Jep.html
    http://jepp.sourceforge.net/

  • Python classes in Java

    Hi everyone,
    Does anyone know how to call python classes and use them in a Java program. I know that Java has its own regex classes but I am not sure if it uses NLTK (Natural Language Toolkit ). Python uses NLTK so I have the classes written in python but I am not sure how to use them and pass and receive variable values from them.
    Any help appreciated.
    thanks

    Hi,
    Yes I already looked into jython the thing about that is that I have a program written in Java using JBuilder and so now i want to probably just include the python library and then use it since jython doesn't seem to use the NLTK. I need the NLTK for the overall project but its not working with jython.

  • Invoking python program from java

    I want to execute a parser program(which is in python) that parses log file from java interface.The design of Java user interface has to be such that the log file is obtained from the user into a text field.The file name has to be read from the text field and this has to be taken by the python log parser program.How can this be implemented?

    You can invoke an external program using:
    Runtime.getRuntime().exec("bla.exe");
    See: http://java.sun.com/j2se/1.4.1/docs/api/

  • Hash() in coldfusion equivalent in java

    Hi,
    I have a hash function in coldfusion which i want to implement in java. The coldfusion hash function in my case DOES NOT take any algorithm as a parameter. In java I have seen that to use message digest we have to specify an algorithm. Can it be done without any algorithm specified ?
    Here is the documentation of the coldfusion hash() function:
    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000503.htm#1105551
    Thanks

    theLeonidas wrote:
    I have a hash function in coldfusion which i want to implement in java. The coldfusion hash function in my case DOES NOT take any algorithm as a parameter. Then you need to find out which algorithm is used for your function.
    In java I have seen that to use message digest we have to specify an algorithm.
    Can it be done without any algorithm specified ?Just because you don't need to specify one in 'cold fusion' does not mean that one of the standard algorithms is not being used. It should be easy enough to find out which one is being used - in Java, just try all those listed in the document you referenced below and compare the result with your coldfusion result.
    >
    Here is the documentation of the coldfusion hash() function:
    http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000503.htm#1105551
    P.S. I bet your function uses the MD5 hash.

  • Realtime equivalent to Java's Thread.sleep()?

    I have an application that I want to guarantee that when I call Java's Thread.sleep(n) the thread will sleep for precisely that amount of time, or close to it at least. What we recently encountered though was that if the "wall clock" time is changed in one thread while a sleep is occurring in another thread, this clock change will impact when the sleeping thread will wake up.
    In our case, we had a simple Thread.sleep(1000), and during that one second period another thread set the clock back two minutes. The sleeping thread ended up sleeping roughly two minutes and a second instead of just a second. Apparently this is a "feature" of Thread.sleep(), and I can see in some cases (e.g. a task scheduler based on wall clock times) where this is exactly the behavior you'd want. However, in our case, we want the sleep function to sleep by the amount we specify, regardless of changes to the wall clock time. Is there a way to do this in Java? We are using JDK 1.5.

    You can use methods which rely on the nanoTime() (based on the number of clock cycles since the processor last reset)
    Classes such as LockSupport.parkUntil(someObject, nanoTime) may give you the accuracy/consistency you want. In this case you always wait the full delay.(and not unpack it)

Maybe you are looking for

  • Form doesn't work in IE, need help...

    If you visit my site http://www.firetree.us and click on the quote navigation element (it's at the bottom on the left) and attempt to fill out the form you'll find it doesn't work. But only in IE. I can't figure out why I'm using PHP to send it. PHP

  • PSE 11 won't open CR2 files from Canon PowerShot G15.

    I was interested in PSE 11 so I could use ACR 7.x to open the raw (CR2) files from my new Canon PowerShot G15 camera--but even after updating the files, PSE 11 won't recognize my camera!  It's still not listed in the group of supported cameras on the

  • Calling Apex Application using a php script

    Hi guys,how can i directly call my Apex Application using a php script.i have apex 2.1 intalled on my system.i created an application and i want my application users to connect directly to the applications login page.I mean somthing like this (http:/

  • Can't get iPod touch to appear in iTunes 10.1.1 ?

    We have followed the trouble shooting pages suggestions - uninstalling & reinstalling iTunes 10.1.1 but still no joy getting new iPod touch 64GB version to appear in iTunes ? If you can help with any advice please

  • Can I recover iWeb sites after a complete HD crash?

    Ok, here´s my case. Last Sunday my MacBook died. Trust me. It died. No one could save the information and the hard drive had to be formatted. And there was the Murphy´s Law factor. I was preparing my files to back up and then, CRASH! After 3 days at