w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

Why does this work in the Python IDLE shell but not when I run it as a Python script from the command prompt?
As @Sukrit Kalra says, don't use datetime.py as your file name. Python is getting confused with which datetime is which (and is importing itself!). Maybe; $ mv datetime.py my_datetime.py

Categories : Python

Using the subprocess or Command module of python for Windows command prompt
Documentation says: cmd is actually run as: { cmd ; } 2>&1 And the function getstatusoutput() is available on UNIX not on Windows.

Categories : Python

Python: Kill (terminate) a process from command prompt using Python
If you use subprocess, you don't need to call any external utilities. subprocess.Popen class provides terminate method. In order to use it, you'll need to replace subprocess.call(...) with subprocess.Popen(...), which returns a Popen instance. For example, task = subprocess.Popen('launcher.exe localhost filename.dut', shell=True) # some time later task.terminate() Note that, unlike call, plain Popen doesn't wait for process to complete. Consult the manual for more details: http://docs.python.org/2/library/subprocess.html

Categories : Python

adb filter by tag does not work in Windows command prompt
Have you tried -s is the switch for setting filtering spec to silent by default? logcat -s <tag>:<level> There are lot's of questions like this one on SO already. Filter output in logcat by tagname

Categories : Android

How is interacting with a prompt of a third party command line program different from a Windows Command prompt?
Most likely the program starts its own shell and does no longer interact with the original one. (You would notice this if the program opens a new window) Or the program needs some specific library to be present to be able to interact with a shell (readline seems to be the case here) and that is not present in your Java Environment. As a quick hack you might try to start bash (or cmd) that then starts the tool. bash and cmd have readline library. I don't have a windows ready here but as a guess just try to call your program like cmd urjtag.exe instead of just urjtag.exe that way you start a cmd process (with that you can interact) and that cmd starts the urjtag.exe where you already know that it can interact with. Either way the problem lies in the way the program you want to call intera

Categories : Java

how to input a respond to prompt of a command by python?
If you're running on some UNIX variant, you can do yes N | <program> which feeds a never-ending stream of "N"s to the program. If you want to control a console-driven program from Python, consider using pexpect. This library enables very simple interaction: import pexpect pexpect.spawn("<cmd>") while 1: child.expect(r'[y/N]') child.sendline('N')

Categories : Python

Command prompt messed up after running a Python program
If there is an error/exception your program is supposed to undo the changes to the terminal which were done during the initialization of curses. If you don't want to do that, there is a wrapper function provided. Please check the documentation. In your case, instead of calling main directly you can call through the wrapper. curses.wrapper(main)

Categories : Python

Dot-slash not recognized in command prompt - Trying to install Python module
try to do configure if you are in the directory where that file is located. If you aren't in the same folder do this C:usersmynamepath ameconfigure If it isn't an exe, change the filetype and windows will run it

Categories : Python

How do I accept user input on command line for python script instead of prompt
Replace src = input('Enter Path to src: ') with: import sys src = sys.argv[1] Ref: http://docs.python.org/2/library/sys.html If your needs are more complex than you admit, you could use an argument-parsing library like optparse (deprecated since 2.7), argparse (new in 2.7 and 3.2) or getopt. Ref: Command Line Arguments In Python Here is an example of using argparse with required source and destination parameters: #! /usr/bin/python import argparse import shutil parser = argparse.ArgumentParser(description="Copy a file") parser.add_argument('src', metavar="SOURCE", help="Source filename") parser.add_argument('dst', metavar="DESTINATION", help="Destination filename") args = parser.parse_args() shutil.copyfile(args.src, args.dst) Run this program with -h to see the help message.

Categories : Python

Python: Catch Ctrl-C command. Prompt "really want to quit (y/n)", resume execution if no
The python signal handlers do not seem to be real signal handlers; that is they happen after the fact, in the normal flow and after the C handler has already returned. Thus you'd try to put your quit logic within the signal handler. As the signal handler runs in the main thread, it will block execution there too. Something like this seems to work nicely. import signal import time import sys def run_program(): while True: time.sleep(1) print("a") def exit_gracefully(signum, frame): # restore the original signal handler as otherwise evil things will happen # in raw_input when CTRL+C is pressed, and our signal handler is not re-entrant signal.signal(signal.SIGINT, original_sigint) try: if raw_input(" Really quit? (y/n)> ").lower().startswith

Categories : Python

find out if a python script is running in idle or terminal/command prompt
This seems to work on Python3/Linux import sys print("idlelib" in sys.modules) If will return True if the script is run from Idle, False otherwise. Please test for other combination of Python/OS !

Categories : Python

How to open Command Prompt, change directory and execute a command using Java code (Windows)
If you just want to run an application with a specific working directory, the easiest way is to use a ProcessBuilder: ProcessBuilder pb = new ProcessBuilder(executable, arguments, if, any); pb.directory(theWorkingDirectory); pb.start();

Categories : Java

Running unit test from command prompt fails
I encountered a similar error message a while back. If I remember correctly, the following was the crux of the issue: (it may not be 100% relevant for the OP, but it might be useful to somebody who hits this down the line). The problem was that my unit tests all failed in Release mode with an exception complaining about the availability (or lack thereof) of the SQLite.Interop.dll. I realised that when built in Debug mode, the binDebug folder had 2 sub folders (x64 and x86) each with a copy of SQLite.Interop.dll but, in Release mode these files/folders did not exist. To resolve it, I created the x64 and x86 folders in my project and added the appropriate version of SQLite.Interop.dll too them, setting the Copy to ouput setting to Copy if newer. (I had originally used 'Copy always' but it

Categories : C#

How Can Be Used the Command Line of Developer Command Prompt in Vim on Windows?
You need to setup your PATH, INCLUDE and LIB environment variables. You could do that by running D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat (or wherever it is located on your installation) in the same prompt you're running vim, or even manually setting these environment variables (here is a list of all values for VS2008 and Windows SDK: Using Visual Studio's 'cl' from a normal command line). However, you just can't run the bat file from vim directly, because it will open another Prompt, so the environment variables will be set only for that new prompt. The other option is just to create bat file which you can put it inside your PATH, for example cvim: call "D:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat" "C:Program Files (x86)Vimvim74g

Categories : C++

Python's os.walk() fails in Windows when there are long filenames
In Windows file names (including path) can not be greater than 255 characters, so the error you're seeing comes from Windows, not from Python - because somehow you managed to create such big file names, but now you can't read them. See this post for more details.

Categories : Python

How to run a command on command prompt startup in Windows
Sorry for the noob type of question. I should have given it a li'l more thought. I found my answer. I should use /K switch using which I can enter a new command on the opened command prompt. e.g. cmd /K cls will open a command prompt for me and clear it. (Answer for question 1) and cmd /K MyBatchFile.bat will start command prompt, execute the batch file and stay on the command prompt and will not exit. (Answer for question 2).

Categories : Windows

Different Command prompt windows does not executing the same command
You say that you checked the %PATH% variable, but you didn't say anything about how you checked it and what the result was. What do you get when you run echo %PATH% in the 2nd command window? Given the error message it's almost certain that the path to the svn executable is missing from your %PATH%. Try the following: set PATH=%PATH%;C:path osvndir svn update

Categories : Svn

Burp and jar files usage for python files in command prompt
According to their documentation you can't directly use it with Python. However, you can use Jython (Python for the Java platform). Things you will have to do if you use Eclipse IDE: Go to Eclipse Marketplace (Help > Eclipse Marketplace) and look for PyDev plugin. Install it. You will download Jython-standalone jar file and configure Jython interpreter: Window > Preferences > PyDev > Interpreter-Jython. Click New. Type for interpreter name: Jython. For Interpreter executable, click browse and browse to Jython-standalone jar file. (Click OK, NEXT...) To create a Jython project: New > PyDevProject. Enter name of project. Under "Chose project type" select Jython. Under "Interpreter" choose Jython. Click OK. Now, how to add burp.jar to buildpath. Right click on your project > Properties >

Categories : Python

Python, Command Line, Windows
After modifying your path, did you start up a new instance of the command prompt (this has caused me much grief in the past)? To check if your path change was successful: echo %PATH% and check to see if C:Python2.7.5 was appended to it. If not then run: set PATH=%PATH%;C:Python2.7.5 To call a python script with a command line argument (assuming that your script is in the current working directory): python letter_counts.py "Your Text Goes Here" OR if you just want to be overly verbose (or your PATH still isn't right): C:Python2.7.5python.exe .letter_counts.py "Your text still goes here" EDIT: Make sure you are doing this from the command prompt and not the python interpreter. To access the command prompt you can hit: 1. Windows Key + R 2. type "cmd" (without quotes) and hit

Categories : Python

The .write command won't work on python
You probably need to close after writing : test= open("bla/bla/bla/" + text + ".txt", 'a') test.write("bla bla bla") test.close() This is always a good practice, if you don't the result can be quite randomized...

Categories : Python

How To Run A Python File From Windows Command Line
If you want to know How do I run a .py file from the Python interpreter? this will work import sys sys.path.append("C:\Users\Myname\Desktop\Python") import Python-Test But your question says from the command line, which has been answered in the comments.

Categories : Python

Run Hello world from node.js command prompt in windows 7
You are trying to execute the program from the node prompt. You don't do that. You just run the node terminal. It sets up a bunch of variables for you. Just run it like you do in the ordinary windows shell.

Categories : Windows

How to use passive FTP mode in Windows command prompt?
Windows does not actually support passive mode. You can send the command to the server in three different ways but that will not enable passive mode on the Windows client end. Those arguments are for sending various commands and pasv is not something that Microsoft thought of when they wrote it. You will have to find a 3rd party software like WinSCP that supports command line usage and use that instead of the Windows native one.

Categories : Windows

Javac isn't working in windows command prompt
For a beginner programmer that doesn't have admin rights on his/her computer, I'd recommend the Eclipse IDE. Since you already have the JDK the only installation step needed requires no admin rights. From here you must download the "Eclipse Standard" option, and you will get a very large zip archive. You can extract it onto the desktop or my documents. Windows comes with a utility to do this via drag-and-drop right from the explorer or your machine may have another program such as WinRAR installed to do this. You can then run eclipse.exe from the place where you extracted it by browsing to, and double-clicking this file. The IDE is very powerful and self-explanatory. You can create projects, run, and debug code, and it's nice for beginners. It's truly worth the long wait in downloadin

Categories : Java

ssh authenticated git access at windows command prompt?
ssh access works fine from a regular DOS session. You only need to define C:UsersYourAccount.ssh and add your id_rsa and id_rsa.pub there. Launch your git session through git-cmd.bat, which will define %HOME% to your C:UsersYourAccount: that is what will make ssh work. This should put your msysgit/bin installation in your PATH. I really recommend not installing through a msi (Microsoft Installer), but through a simple unzip of an archive (portable version "PortableGit-x.y.z-preview201ymmdd.7z") And the OP GreenAsJade's comment points out the fact that GIT_SSH must point to plink.exe.

Categories : Windows

Maven 3.0.5 installed in Windows 7 but not able to run through command prompt
Your path configuration has a M2_Home instead of M2_HOME. It should be all uppercase %M2_HOME% Also notice, you are specifying bin twice, should M2_HOME=C:Program Filesapache-maven-3.0.5-binapache-maven-3.0.5

Categories : Maven

Setting Classpath using command prompt in Windows 7
Understanding class path wildcards Class path entries can contain the basename wildcard character , which is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR. For example, the class path entry foo/ specifies all JAR files in the directory named foo. A classpath entry consisting simply of * expands to a list of all the jar files in the current directory. A class path entry that contains * will not match class files. To match both classes and JAR files in a single directory foo, use either foo;foo/* or foo/*;foo. The order chosen determines whether the classes and resources in foo are loaded before JAR files in foo, or vice versa. Subdirectories are not searched recursively. For example, foo/* looks

Categories : Java

Execute process from the windows command line in Python
By trying your code it prints out PreprocessedTufts8199PLAIN.txt.xml file name. I'm not sure if the .txt.xml extension was the desired result. If your file has only .xml extension, then you're not stripping away the original .txt header. Try to change this line: outFile = file(inFile[(str(inFile).rfind('\'))+1:] + '.xml') Into this code: fnameext = inFile[(str(inFile).rfind('\'))+1:] fname,fext = os.path.splitext(fnameext) xmlfname = fname + '.xml' xmlfpath = os.path.join(".", xmlfname) print "xmlfname:", xmlfname, " xmlfpath:", xmlfpath print "current working directory:", os.getcwd() outFile = open(xmlfpath, "r") Answer for extension stripping.

Categories : Python

How do I run Python script using arguments in windows command line
To execute your program from the command line, you have to call the python interpreter, like this : C:Python27>python hello.py 1 1 If you code resides in another directory, you will have to set the python binary path in your PATH environment variable, to be able to run it, too. You can find detailed instructions here.

Categories : Python

Setting javacc to work with command prompt
In the version 6.0 the bin directory is missing the scripts which run javacc. That is why you are getting the error from the windows command prompt. What you have is a jar file javacc.jar located in the lib directory. All you need is to add that jar file to your classpath and run the java.exe and pass the main class which runs javacc, the later happens to be named javacc too, so to run javacc just proceed like this: cmd> java -cp C:javacc-6.0inlibjavacc.jar javacc In the latest version they seem to have forgotten to add the scripts in the bin folder of the package. You can download version 5.0, it containes all the script files you need, among others a file with the name javacc.bat, this is the one the window commad prompt is looking for and not finding in your case. Of course, y

Categories : Java

Rscript does not work when invoked in PHP but does from Command Prompt
I would define a launcher.bat where I deal will all R-paths problem: PATH PATH_TO_R/R-version/bin;%path% cd PATH_TO_R_SCRIPT Rscript myscript.R arg1 arg2 Then in the php side you can use exec: <?php exec('c:WINDOWSsystem32cmd.exe /c START PATH_TO_LAUNCHERLAUNCHER.bat'); ?>

Categories : PHP

taskkill windows command prompt not killing all processes php
Found a solution [though open for better suggestions] First needs to check and kill if php tasks exists, then command prompt will kill : // It will first list out all `php.exe` tasks running $output = shell_exec('tasklist /svc /fi "imagename eq php.exe"'); print_r($output); echo "<br> ------------------------------------ <br>"; // It will first list out all `cmd.exe` tasks running $output = shell_exec('tasklist /svc /fi "imagename eq cmd.exe"'); print_r($output); echo "<br> ------------------------------------ <br>"; // kills php.exe tasks $php_output = shell_exec('taskkill /F /IM "php.exe"'); print_r($output); echo "<br> ------------------------------------ <br>"; // kills cmd.exe tasks $cmd_output = shell_exec('taskkill /F /IM "cmd.exe"'); print_r

Categories : PHP

How to search for a folder in all the available windows drive using the command prompt?
See if this works for you: it will report the last match found. @echo off for %%a in (c d e f g h i j k l m n o p q u r s t u v w x y z) do ( if exist "%%a:" dir %%a: /ad /b /s >>"%userprofile%desktopfolderlist.txt" ) find /i "opencvuildin" < "%userprofile%desktopfolderlist.txt" >"%userprofile%desktopfolderlistfound.txt" if exist "%userprofile%desktopfolderlistfound.txt" ( for /f "usebackq delims=" %%a in ("%userprofile%desktopfolderlistfound.txt") do ( set "foundfolder=%%a" echo found at "%%a" ) ) if defined foundfolder ( echo last folder matched at "%foundfolder%" ) else ( echo didn't find the "opencvuildin" )

Categories : Windows

How can I keep open the command prompt in my windows form application in c++?
Have you tried the following? system("cmd /k dir c:\"); /k keeps the cmd prompt window open after the executing process has terminated. But, to be honest, it may be better to use the Windows Terminal Services API for finer control, if you so desire. But, depending on what you want to do - that might be overkill. And, regarding your second question: don't forget to escape your backslashes in: const char program[] = "C:\Windows\System32\cmd.exe"; WinExec((LPCSTR)program, SW_SHOWMINIMIZED); References: http://superuser.com/questions/306167/how-to-prevent-the-command-prompt-from-closing-after-execution

Categories : C++

Executing 3 commands using one start command on the Windows prompt
I believe you are looking for the /B flag -- which tells Start to not open a new window but instead run the command in the background of the same window. Remember though: You are still starting a new instance of start each time. I'm assuming this is what you intend, however.

Categories : Windows

"git pull" returns error in Windows command prompt
Make sure this isn't a path issue, as explained in this link (for windows, but valid for other OS too). Check also if you don't have any active git alias which might prevent a git pull to work properly. Regarding the path issue, the OP aladine confirms in the comments: I discover that after I reinstall git, it works as normal.

Categories : GIT

How to set file permissions in windows through the command prompt mode?
>attrib /? Displays or changes file attributes. ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]] + Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. [drive:][path][filename] Specifies a file or files for attrib to process. /S Processes matching files in the current folder and all subfolders. /D Processes folders as well.

Categories : Windows

How can you zip or unzip from the command prompt using ONLY Windows' built-in capabilities?
Back in 2013, that was not possible. MS provided no executable for this. See this link for some VBS way to do this. http://superuser.com/questions/201371/create-zip-folder-from-the-command-line-windows From Windows 8 on, .Net Framework 4.5 is installed by default, with System.IO.Compression.ZipArchive and PowerShell available, one can write scripts to achieve this, see http://stackoverflow.com/a/26843122/71312

Categories : Windows

Why does python's recursive copy not work the same as on the command line?
Seems os.system changes the shell it executes in to sh: mike@mike-VirtualBox:~/head$ echo $0 bash mike@mike-VirtualBox:~/head$ python Python 2.7.3 (default, Apr 10 2013, 06:20:15) >>> import os >>> os.system("echo $0") sh When the copy command is executed via Popen with a bash shell, it works as expected: >>> import subprocess >>> sp.Popen("cp -rf ./applications/icom_app_template ./applications/my_dir", shell=True, executable="/bin/bash") >>> exit() mike@mike-VirtualBox:~/head$ tree ./applications/my_dir/ ./applications/my_dir/ ├── cdl │ ├── include │ ├── Makefile │ ... │ └── other ├── cds │ ├── include ... The only oddity that I do not have an answer for is that if I

Categories : Python



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.