output

Python PSS/E get output as variable

↘锁芯ラ 提交于 2019-12-02 06:14:43
I am power engineer and I often use python in PSS/E program. I am stacked and I want your help as programmers. I have this small code: import os,sys PSSE_LOCATION = r"C:\Program Files\PTI\PSSE33\PSSBIN" sys.path.append(PSSE_LOCATION) os.environ['PATH'] = os.environ['PATH'] + ';' + PSSE_LOCATION import psspy import redirect redirect.psse2py() #-------------------------------- # PSS/E Saved case CASE = r"""D:\xxx\Desktop\TESTING\SUMMAX.sav""" if __name__ == '__main__': psspy.psseinit(2000) psspy.case(CASE) psspy.fnsl( options1=0, # disable tap stepping adjustment. options5=0, # disable switched

convert MultiLabelDataset<String, String> to Guava Multimap for printing / examining

允我心安 提交于 2019-12-02 06:00:57
I'm working with the following program: public static void main(String[] args) throws Exception { String input = args[0]; InputStream is = new BufferedInputStream( new FileInputStream( input ) ); toMultiLabelDataset(is); is.close(); } public static MultiLabelDataset<String, String> toMultiLabelDataset(InputStream is) throws IOException { List<RelationAndMentions> relations = toRelations(is, true); MultiLabelDataset<String, String> dataset = toDataset(relations); return dataset; } As you can see it utilizes a data structure of the form MultiLabelDataset<String, String> , I want to print the

Redirecting the shell output to a file [duplicate]

我是研究僧i 提交于 2019-12-02 05:12:32
This question already has an answer here: Redirect all output to file [duplicate] 10 answers I am working on AIX 6 where I am running a java command on a Korn Shell and I am trying to debug the class loading issue. I put -verbose:class to print the class loaded and then >>/home/user/log.log to get the console out put in a file. The log.log file is got created but its of zero size. File is not containing any information and all the verbose details are ripping through the screen in a flash. /usr/IBM/WebSphere/AppServer/java/bin/java -verbose:class -cp "XXXXX" com.ibm.XXXX >>/home/user/log.log

Displaying only single most recent line of a command's output

烈酒焚心 提交于 2019-12-02 05:12:20
How can I print a command output like one from rm -rv * in a single line ? I think it would need \r but I can't figure out how. I would need to have something like this : From: removed /path/file1 removed /path/file2 removed /path/file3 To : Line 1 : removed /path/file1 Then : Line 1 : removed /path/file2 Then : Line 1 : removed /path/file3 EDIT : I may have been misunderstood, I want to have the whole process beeing printing in a single same line, changing as the command outputs an another line (like removed /path/file123 ) EDIT2 : The output is sometimes too long to be display in on line

What is the Ada command line redirector that is analogous to “>”?

坚强是说给别人听的谎言 提交于 2019-12-02 04:34:19
Ada noob here (and also not so hot with the command line in general). I am looking for the Ada command line redirector that would be analogous to ">" in DOS. I am running an Ada application in a command line shell. (William Whitaker's WORDS, if that is helpful). I use the "@" command to get the WORDS application to read the list of terms from a text file. I want the output to be written to a file, not to just appear in the command shell. I did look at http://www.ada-auth.org/standards/12rm/html/RM-A-15.html but didn't see anything for redirect*. Also helpful to know would be whether the ADA

How to redirect Matlab output of a command to a file? [duplicate]

旧时模样 提交于 2019-12-02 04:30:30
This question already has an answer here: Print A Matlab Struct to a Text File 3 answers I want to redirect or copy the output of a Matlab command to a file. How can I do that? In my case, I have two large structs that I want to compare using the UNIX tool diff . Example: I can do this in Matlab: >> s1 s1 = a: 32 abc: 'example' >> and want a file containing approx: s1 = a: 32 abc: 'example' These solutions are not viable: Copy-pase: can't automate (comfortably). save -ascii : does not work with structs. Have a look at the diary function . E.g. diary my_file.txt s1 diary off The file my_file

Output VBA Array Elements to One Cell in Excel

≯℡__Kan透↙ 提交于 2019-12-02 04:25:54
So i have a vba code that creates an array with multiple elements. I would like to output those elements into one cell in excel. Im able to output its elements to multiple cells but prefer it in one cell. Can this be done? If the array is declared as a String or Variant then you can use Join : Sub AllIntoOne() Dim arr(1 To 3) As Variant arr(1) = 4 arr(2) = 54 arr(3) = 3 Range("A1") = Join(arr, ",") End Sub The delimiter "," defaults to a space if not supplied, but can be an empty string "" if no separation is required. 来源: https://stackoverflow.com/questions/18543517/output-vba-array-elements

Is it possible to output a variable with zero value as blank in Fortran?

你。 提交于 2019-12-02 03:39:21
I would like to output real variables in a formatted file. If the variables are non-zero, format statements are used. But if variables are zero, then only blank spaces are outputted, similar to what Iw.0 does. Is it possible to do this in the format statements? Thank you. No, not with a format statement, but this is reasonably easy to do by writing the values to a string and processing. Below is a demo. Probably better to put into a subroutine. program demo real, dimension (6) :: values = [ 1.0, 2.0, 0.0, 4.0, 0.0, 6.0 ] character (len=100) :: string integer :: pos write (string,'( 6 (1X, F4.1

Updating text displayed on the terminal

别等时光非礼了梦想. 提交于 2019-12-02 03:31:26
问题 I'm attempting to create a game of life program in C, but i'm not very familiar with a process to update the output displayed on the terminal. So, for example, I will have a 2d char array, where each element will contain either a '#' or a '-'. I will print this array onto the screen, but rather than printing a new 2d array every time there is a state change, I want to overwrite the old array in the terminal with the new state. I have looked for ways to do this, but haven't had much luck. The

How to clean up masscan output (-oL)

こ雲淡風輕ζ 提交于 2019-12-02 03:21:24
I have a problem with the output produced by the masscan utility with the -oL options ("grep-able" output); for instance, it outputs this: Host: 143.137.155.7 () Ports: 80/open/tcp//// Host: 177.105.21.41 () Ports: 8080/open/tcp//// Host: 187.78.236.98 () Ports: 80/open/tcp//// Host: 177.137.76.220 () Ports: 8080/open/tcp//// Host: 177.105.10.112 () Ports: 9000/open/tcp//// Host: 191.232.34.9 () Ports: 80/open/tcp//// Host: 179.55.65.144 () Ports: 80/open/tcp//// Host: 177.83.203.147 () Ports: 8080/open/tcp//// Host: 177.182.50.124 () Ports: 8000/open/tcp//// The above is neither very readable