w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
getSaveFileName , getOpenFileName shows me the file to save or open, but cannot save the file or open the file in python QT
These functions only allow the user to select files, they don't actually open or save the files. In PySide, they return a tuple, so for example, saving the file would look like this: fileName, selectedFilter = QtGui.QFileDialog.getSaveFileName(self, "Save", "F:/python/bc_new_latest/bcForecasting.csv", "Excel (*.csv *.xls )") if fileName: with open(fileName, "w") as file: file.write(theCSVContent)

Categories : Python

Open xml file, find url within, open link and search for value - python lxml
If you want to get the text of all a-nodes, you can do it using Beautifulsoup: soup = BeautifulSoup(html_page) for link in soup.findAll('a'): print link.text Does this answer your question?

Categories : Python

Why does this code write a "corrupt file" that Word cannot open (not even "Open and Repair")?
It looks like you're not calling .Seek() properly on the main memory stream, also you seem to be using that single memory stream for both input and output possibly at the same time. (Maybe it's correct, but it's just very confusing to me when it's mixed mode) I'm assuming you can't access raw filenames and the filesystem: using(Stream t = template.OpenBinaryStream()) { using (WordprocessingDocument myDoc = WordprocessingDocument.Open(t, true)) { using (XmlWriter writer = XmlWriter.Create(resp.OutputStream)) { // TODO re-add merge logic here once it works HttpResponse resp = HttpContext.Current.Response; resp.ClearContent(); resp.ClearHeaders(); resp.AddHeader("Content-Disposition", "att

Categories : C#

Trying to open a file with Eclipe - eclipse.exe isn't added to the Open With: window
You should not use the .project file to start Eclipse. Start eclipse from the main start menu shortcut or eclipse.exe. Then select the workspace (browse to it) you want to work in (and that contains your project). If your project is not in a workspace, import it with the eclipse import menu.

Categories : Java

How Can i open an cmd prompt and set an path to open an .bat file in Vb Script..?
Here you go Set WshShell = wscript.CreateObject("wscript.Shell") WshShell.Run "cmd" WScript.Sleep 100 WshShell.AppActivate "C:Windowssystem32cmd.exe" WScript.Sleep 100 wshshell.sendkeys "c:path" wshshell.sendkeys "{ENTER}" wshshell.sendkeys "SET PATH=%PATH%;c: mp" wshshell.sendkeys "{ENTER}" wshshell.sendkeys "batch.cmd" wshshell.sendkeys "{ENTER}"

Categories : Shell

Open only local drives in open file dialog
I don't think this is possible with the built-in OpenfileDialog. Changing the CustomPlaces is just the list of "custom" places you want pinned on the top left. It doesn't limit the places they can go. I think you'll have to either write a custom dialog (ick!) or do something to validate their selection after they've hit ok.

Categories : C#

checking to see if a workbook is open vba, crashing if file is open
This was originally a comment that was found to be the correct solution to this question, so I am adding it as an answer: Maybe an option in your VBA Editor. Open the VBA Editor and go to Tools -> Options -> General -> and in the "Error Trapping" section select "Break on Unhandled Errors" -> OK. Yours might be set to "Break on All Errors".

Categories : Excel

Python - exec(open('file.py').read()) reports error - No such file or directory. 'file.py'
open('xyz') does not search the various python import paths. If you give a relative path name, it starts with the current working directory, appends your path and looks there. If you give an absolute path, it ignores the current directory.

Categories : Python

Check if a specific Excel file is open when several Excel files are open and activate it
So you want to detect if a workbook with a given name is opened? That can be done like this in VBScript: ExcelFileName = "some.xlsx" On Error Resume Next Set xl = GetObject(, "Excel.Application") 'attach to running Excel instance If Err Then If Err.Number = 429 Then WScript.Echo "Workbook not open (Excel is not running)." Else WScript.Echo Err.Description & " (0x" & Hex(Err.Number) & ")" End If WScript.Quit 1 End If On Error Goto 0 Set wb = Nothing For Each obj In xl.Workbooks If obj.Name = ExcelFileName Then 'use obj.FullName for full path Set wb = obj Exit For End If Next If wb Is Nothing Then WScript.Echo "Workbook not open." WScript.Quit 1 End If GetObject can only attach to the Excel instance that was launched first, though. You'd nee

Categories : Vbscript

Open txt file, create new txt file, save old text to new file
The line outfilename$.SaveAs =:"FileName"infilename.txt",False" looks quite wrong indeed. You coud try this instead to pop-up a dialog for saving file outfilename$ = Application.GetSaveAsFilename(infilename$, "Neutral Files (*.txt),*.txt", , "Save file", "SAVE") Update : The full code is Sub test() Dim outfilename as Variant Dim infilename as Variant Dim msg As Variant infilename = Application.GetOpenFilename("Neutral Files (*.txt),*.txt", , "Open Neutral File", "OPEN", False) If infilename = "False" Then msg = MsgBox("No input file selected. Press OK to retry or cancel to quit", vbOKCancel) If msg = vbOK Then Do While msg <> vbCancel 'loop until user presses cancel infilename = Application.GetOpenFilename("Neutral Files (*.r01),*.r01", , "Open

Categories : Vba

Android : error libGL.so: cannot open shared object file: No such file or directory
As I'm using 64-bit Ubuntu 12.04. So, I did this $ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386 $ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

Categories : Android

PHP include: failed to open stream: no such file in "/literally/the/exact/location/of/the/file"?
PHP executes only scripts found in directories specified in open_basedir. Your path is probably not allowed.

Categories : PHP

How does File paths on apache work (failed to open stream: No such file or directory)
I think that this require_once("../classes/admin.php"); Will be relative to where you are running the php command from. Try changing directory to the folder above classes and then running php database_setup.php You can change directory via the command line like this cd /var/www/httpdocs/classes

Categories : PHP

During apachectl start getting open shared object file: No such file or directory
Run find / -type f -name mod_authn_core.so or install updatedb ( mlocate, slocate, findutils or sth ) if needed and run updatedb and then ( or before ) locate mod_authn_core.so To find out if these files are somewere else than they should be, and possibly fix location with symbolic link or moving files where they're expected to be. If there is no file you need, you may need to comment it in httpd.conf ( if it's specific module ), or (re)install apache package(s). I believe mod_authn_core should be in basic package, not in separate module though. Possibly someone removed it blindly or accidentally, or some intruder messed up with system, or disk got broken or whatever else. PS. Modules usually are under "lib" e.g. /usr/local/lib/apache2 or /usr/lib/apache2, or /usr/lib/apache2/

Categories : Apache

Importing .dmp file from Oracle 11g to 10g returns error 'Unable to open log file'
The directory that your dumpdir database directory object points to needs to be a valid existing directory - at least by the time you use it, it won't check or complain when you create the object - and it needs to be readable and writable by the user that Oracle is running under, which is usually oracle. Your initial directory creation had 'usr/lib/oracle/... rather than '/usr/lib/oracle/..., but even with that corrected the directory might not be usable by the oracle account. Since you created the directory as root, it is probably still owned by root:root and with permissions 700 (if you do ls -ld /usr/lib/oracle/xe/app/oracle/admin/XE/dpdump that will show as drwx------). You need to change that to be owned by Oracle, using the correct owner and group - that's probably oracle:dba or or

Categories : Linux

How do i open a text file with openFileDialog when the content of the file is also with hebrew letters?
You need to change the encoding to the Windows-1255 code page (or another code page if you know it). Encoding enc = Encoding.GetEncoding("Windows-1255"); string s = File.ReadAllText(file1, enc);

Categories : C#

WIn764b: Cannot open include file: 'winsock2.h': No such file or directory when running npm install -g karma
binding.sln was built with Visual Studio 2010. I decided to install Visual Studio 2010. I selected "Or, download the previous: Visual C++ 2010 Express." from http://www.microsoft.com/visualstudio/eng/products/visual-studio-2010-express and npm install -g karma ran without errors.

Categories : Visual Studio

Unable to load library 'gs': libgs.so: cannot open shared object file: No such file or directory
I just had this issue on a linux VM. I was able to solve it by installing ghostscript on the system. I just used the command: sudo yum install ghostscript Hope that helps!

Categories : Java

how to streamWrite a .zip/epub file from response to isolatedStorage if that .zip/hpub file contains .jpg, .woff (web open font format)
using (IsolatedStorageFileStream fileStream = isf.OpenFile(fullFilePath, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)) { s.CopyTo(fileStream); } In my case it is the only way to save different extension's files into the isolated Storage, BinaryWriter will not work. so @KooKiz was right. Thanks Kookiz :)

Categories : Windows Phone 8

java.lang.UnsatisfiedLinkError /tmp/javacpp94368173067/ libopencv_core.so.2.4: cannot open shared object file: No such file or directory
What it simply means is that it s unable to find the native dependencies. JavaCV uses JNI calls internally to use OpenCV dll's. On windows the dependencies were on path (There can be multiple reasons behind, opencv might be on environment variables or in some resources). I would recommend going through this for linux: https://code.google.com/p/javacv/

Categories : Java

Basic image editor (open file, crop, save to new file) in a Java Tapestry web application
The Catalano Framework is a framework for scientific computing for Java and Android. Example: FastBitmap fb = new FastBitmap(bufferedImage); // Sepia effect. Sepia sepia = new Sepia(); sepia.applyInPlace(fb); // Crop int startX = 10; int startY = 10; int newWidth = 100; int newHeight = 100; Crop crop = new Crop(startX, startY, newWidth, newHeight); crop.applyInPlace(fb); ...and much more.

Categories : Java

Create hyperlink using XSLT which open xml file on the file system
I'm not sure what <a href="<H3>...</H3>"></a> is supposed to mean, so I assume you want something like this: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="Document"> <html> <head/> <body> <xsl:apply-templates select="racine" /> </body> </html> </xsl:template> <xsl:template match="racine"> <h3> <a href="{encode-for-uri(label)}"><xsl:value-of select="label" /></a> </h3> </xsl:template> </xsl:stylsheet> Note the use of template matching (<xsl:apply-templates> / <xsl:template>) over <xsl:f

Categories : Xml

Getting error "Can't open input file No such file or directory" and I can't figure out why
A few quick notes. Why use strict and warnings? Using this will help you catch typographical errors more quickly and then move on to being able to find more significant problems. Read: perldoc strict perldoc warnings Why use strict and warnings? Why three-arg and not two-arg form of open() ? Keep in mind that the two-arg form of open is broken. For example let's take a file called ' foo'. Now this file has a leading whitespace at the beginning. So however you go to open it.. open FILE, ' foo' || die $!; open FILE, '< foo' || die $!; open FILE, '< foo' || die $!; See anything wrong here? None of these will work. Note also that If you accidentally use a filename with special characters, your code likely will not behave as you would as expect. This approach is much clean

Categories : Perl

icui18n: cannot open shared object file: No such file or directory
You just need a copy of ICU installed on the system you are trying to run canopy on. You can do this by either installing it via the OS's package manager, or by getting a copy in your home directory, and telling canopy where to find it with LD_LIBRARY_PATH. You can get precompiled copies of ICU from their download page (http://site.icu-project.org/download/51), and once installed you would do something like: LD_LIBRARY_PATH="~/path/to/icu/lib" ./canopy

Categories : Python

General file open for Python which does not care about file compression
Yes. For example, place the example below in a file util.py. It implements a solution where you can simply open files (for reading or writing) as e.g. in f1 = util.anyOpen('data.txt') f2 = util.anyOpen('data.txt.gz') f3 = util.anyOpen('data.txt.bz2') f3 = util.anyOpen('data.txt.xz') This comes very handy when the filename is read from the command-line. With anyOpen() you do not have to do any case handling, just pass the filename along, with util.anyOpen(sys.argv[1]) as f: for line in f: ... Furthermore, you can control where the unzipping is done: with external=NORMAL python libraries are used, and with external=PROCESS external gzip, bzip2, or xz process is used; with external=PARALLEL, the parallel versions pigz and pbzip2 are used. If no external commands are found th

Categories : Python

file writing not working after call to open file dialog
Try CreateFile and WriteFile. string s = "file.dat"; HANDLE hFile = CreateFile(s.c_str(), // name of the write GENERIC_WRITE, // open for writing 0, // do not share NULL, // default security CREATE_ALWAYS, // Creates a new file, always FILE_ATTRIBUTE_NORMAL, // normal file NULL); // no attr. template DWORD writesBytes; bool writeok = WriteFile(hFile, &Current_Doc, sizeof(Current_Doc), &writesBytes, NULL); CloseHandle(hFile); Similar problem, and my answer is here: OPENFILENAME open dialog

Categories : C++

libopencv_gpu.so.2.4: cannot open shared object file: No such file or directory
Seems to be the same issue as here: openCV program compile error "libopencv_core.so.2.4: cannot open shared object file: No such file or directory" in ubuntu 12.04 , configure everything properly and it should run.

Categories : C++

PHP failed to open Stream no such file or directory when trying to execute a php file
change require_once 'modules/com_vtiger_workflow/VTWorkflowUtils.php'; to require_once (dirname(__FILE__) . '/modules/com_vtiger_workflow/VTWorkflowUtils.php'); if your include file path is relative to the script. dirname(__FILE__) return the full path of the file from where it is called. for the ScheduledReports.php you can use the following require_once (dirname(__FILE__) . '/modules/Reports/ScheduledReports.php');

Categories : PHP

load selected .txt file from datagridview and open the file in listview c#
Looks like you create incorrect path, or you are reading incorrect cell value. Use overloaded Path.Combine which accept list of path parts. Also instead of adding path to list you should add line. Following code will show you error message if file not exist with path where it tries to look for file. Also it will show error message if there is no file name in grid cell. private void gridProfiles_CellClick(object sender, DataGridViewCellEventArgs e) { object value = gridProfiles.Rows[e.RowIndex].Cells[0].Value; if (value == null) { MessageBox.Show("Cannot get file name from grid"); return; } var file = value.ToString(); var path = Path.Combine(rootDirectory, "Profiles", file); // create path if (!File.Exists(path)) { MessageBox.Sho

Categories : C#

ZMQ - libzmq.so.3: cannot open shared object file: No such file or directory
If you've successfully built libzmq and jzmq in that order, I would run: $ sudo ldconfig to update the system library cache. Then I would check to see if LD_LIBRARY_PATH is defined like Raffian mentioned, or set your library path explicitly to something like: $ java -Djava.library.path=/usr/lib:/usr/local/lib

Categories : Java

How to open a file using a string variable in path name in batch file
Why the artificial limitation of only one line? Anyway yes this is simple enough. Anyway this will process any number of lines in target.txt. Code off my head so test before real use. @echo off for /f %%i in (target.txt) do ( sort %%i /o %%i ) echo. > target.txt EDIT: Instead of echo. > target.txt you could use copy /y nul target.txt > nul that actually creates a totally empty file unlike echo. that makes a blank line. PS: a tip for future questions: Show that you actually tried something. This is not a do my program for you site.

Categories : File

Trouble in Setting Java Environment Path on Ubuntu (libjvm.so: cannot open shared object file: No such file or directory)
Put "-Djava.library.path=FULL_PATH_HERE/jre/lib/amd64" as a JVM option in your C code. Edit the full_path_here part. The path is allowed to be relative, but I don't think you can use $JAVA_HOME as a placeholder for the environment variable.

Categories : Java

use tcl script to open a txt file (to make a txt file pop out on the screen)
I assume by open, you meant open using an application/program. On Windows: exec notepad.exe /path/to/file.txt On Mac: exec open /path/to/file.txt ;# Open using default application or: exec open -a TextEdit /path/to/file.txt ;# Open using a specific application

Categories : File

Rspec -- need to stub File.open that gets called in another file
I'm not sure you need that .with(:file) part, try dropping it altogether. Also, I believe by specifying it that way you are literally telling it to expect someone to call that method and pass it a :file symbol rather than e.g. a string filename. Also consider preloading the test YAML file and just returning that: let(:file_like_object) { double("file like object") } File.stub(:open).and_return(file_like_object)

Categories : Ruby

only open output file if input file isn't empty
Try rewriting if (-e -s $genes1){ as if (-e $genes1 && -s $genes1){. The -e and -s file tests returns 1 for true and '' for false, or the undefined value if the file doesn't exist. The original code appeared to be equivalent to (eg) my $a=1; my $b=1; if($a $b) { which is probably not what was intended. Additionally, omitting an argument to -e or -s make it work on $_. Hence suggesting the rewrite in the top line of this answer. With the change made as above it would appear that $genes1 is undefined. But that looks unlikely given the open ... or die ... above. I would run the program in the Perl debugger, or alternatively, add a statement such as this just before the tests: print "genes1 is ", defined $genes1 ? "defined " : "not defined "; Update The code you provided seems t

Categories : Perl

Bat file to open webpage with parameters to local file
I tested this and got the same result. I'm not really sure, but I guess this belongs to the question mark. The local file system of Windows can never have file names with ?, because this is a "wildcard" like *. I think it is possible that the file name is truncated there. The following codes also doesn't work or produces only error messages: start "file:///C:/Users/d92495j/Desktop/OracleCDs/WebLogic/template.html?wbt=1" start file:///"C:/Users/d92495j/Desktop/OracleCDs/WebLogic/template.html?wbt=1"

Categories : Windows

VS8 can't handle file.close(); file.open();, why?
This was by design. In C++98, closing an fstream does not clear the error state and calling open() on an fstream does not reset the error state. See LWG Defect #409 for a discussion of the issue. The behavior was changed in C++11 such that the error state is cleared (via a call to clear()) if the open operation succeeds.

Categories : C++

can we write and open pdf file using file handling in php
You aren't creating a PDF file. You are creating a text file and putting .pdf as the extension which won't work. An easy solution is to use dompdf.

Categories : PHP

Getting a file folder from Open File Dialog
When GetOpenFileName() returns, the chosen file is stored in the buffer you provided via the lpstrFile member. This is the full path to the file (e.g. C:PathToFile.txt). To get the folder the file is in all you need to do is strip off the last component. You can do this manually by searching the string backwards for the last backslash character, or use one of the utility functions to do it for you: char chFolderPath[MAX_PATH]; StringCchCopy(chFolderPath, MAX_PATH, ofn.lpstrFile); PathRemoveFileSpec(chFolderPath); // chFolderPath now contains "C:PathTo" Note you'll need to #include <shlwapi.h> and link with shlwapi.lib to use the PathRemoveFileSpec function.

Categories : C++

(2, 'No such file or directory') when trying to open a csv file on Django
When Python wants to execute the file using the python command, it doesn't look for the file in the py-Location like the interpreter does, but in some other folder (don't know in which one exactly). So how to solve this problem: If you want to keep the independency of no fixed file path, use this code: import os workpath = os.path.dirname(os.path.abspath(__file__)) #Returns the Path your .py file is in c = open(os.path.join(workpath, 'file.csv'), 'rb') reader = csv.reader(c) rows = [] rownum = 0 for row in reader: # Skip header if rownum != 0: rows.append(row) rownum += 1 c.close() return rows Now just put (or keep) the .csv file in the same folder as the main .py-Script - and you're done! (Script is untested, tell me if I made it not work out of some stupidness)

Categories : Python



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