Search Results

Search found 14344 results on 574 pages for 'path'.

Page 97/574 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • accessing files after setup.py install

    - by Matthew
    I'm developing a python application and have a question regarding coding it so that it still works after an user has installed it on his or her machine via setup.py install or similar. In one of my files, I use the following: file = "TestParser/View/MainWindow.ui" cwd = os.getcwd() argv_path = os.path.dirname(sys.argv[0]) file_path = os.path.join(cwd, argv_path, file) in order to get the path to MainWindow.ui, when I only know the path relative to the main script's location. This works regardless of from where I call the main script. The issue is that after an user installs the application on his or her machine, the relative path is different, so this doesn't work. I could use __file__, but according to this, py2exe doesn't have __file__. Is there a standard way of achieving this? Or a better way?

    Read the article

  • How to get the file name for <input type="file" in jsp

    - by deepthinker121
    I want to read the file path from html input type="file" (the entry selected in the file dialog by the user) <script> function OpenFileDialog(form) { var a = document.getElementById("inputfile").click(); SampleForm.filePath.value = //set the path here document.SampleForm.submit(); } </script> <form name="SampleForm" action="TestServlet" method="get"> <input type="file" style="display:none;" id="inputfile"/> <a href="javascript:OpenFileDialog(this.form);">Open here</a> <input type="hidden" name="filePath" value=""/> </form> I want the path of the selected file to be read in my Servlet class How do I get the file path? Can I read it from var a? Or is there any way to directly access the file path from the input type="file" from my servlet?

    Read the article

  • How to make the yuicompressor jar file a singleton, or globally accessible?

    - by Erik Vold
    I'd like to put the yuicompressor jar file in a single folder so that I can call java -jar yuicompressor-2.4.2.jar ... from anywhere on my system, with cygwin. For bash files I use I simply put them in a common folder, and added the folder's path to my windows user's PATH environment variable and the bash commands were found in cygwin. when I echo $PATH I see the folder I put the yuicompressor jar into listed in the $PATH.. But when I try java -jar yuicompressor-2.4.2.jar ... I get the following error message: Unable to access jarfile yuicompressor-2.4.2.jar Even when I try providing an absolute path to the jarfile I get the same error message.. How can I do this?

    Read the article

  • How to convert raw_input() into a directory?

    - by Azeworai
    Hi everyone, I just picked up IronPython and I've been trying to get this IronPython script going but I'm stuck at trying to get a Path input from raw_input to be a directory path. The first block of code is the broken one that I'm working on. import System from System import * from System.IO import * from System.Diagnostics import * inputDirectory = raw_input("Enter Input Directory's full path [eg. c:\\vid\\]: ") print ("In: "+inputDirectory) outputDirectory = inputDirectory +"ipod\\" print ("Out: "+outputDirectory) #create the default output directory for s in DirectoryInfo(inputDirectory).GetFiles("*.avi"): print s.FullName arg = String.Format('-i "{0}" -t 1 -c 1 -o "{1}" --preset="iPod"' , s.FullName, outputDirectory + s.Name.Replace(".avi", ".mp4")) print arg proc = Process.Start("C:\\Program Files\\Handbrake\\HandBrakeCLI.exe", arg) #path to handbrake goes here proc.WaitForExit() The following code block is what I have working at the moment. import System from System import * from System.IO import * from System.Diagnostics import * for s in DirectoryInfo("F:\\Tomorrow\\").GetFiles("*.avi"): arg = String.Format('-i "{0}" -t 1 -c 1 -o "{1}" --preset="iPod"' , s.FullName, "F:\\Tomorrow\\ipod\\" + s.Name.Replace(".avi", ".mp4")) print arg proc = Process.Start("C:\\Program Files\\Handbrake\\HandBrakeCLI.exe", arg) #path to handbrake goes here proc.WaitForExit() PS: Credit for the above working code goes to Joseph at jcooney.net

    Read the article

  • How to add external jar...through URL..using .classpath??

    - by Rahul
    **In any javaProject in eclipse there we always get .classpath file...like <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry path="ABC/junit" kind="src"/> <classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/> <classpathentry path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4" kind="con"/> <classpathentry path="targets" kind="output"/> </classpath> Here when we import any external jar it is giving path of that jar in classpathentry...i want that classpathentry should be from any URL which will provide that external jar...can anyone plz tell me how to do that..actually i want to add external jar automatically from URL(any) when user will import that project in eclipse..i don't want user will manually add external jars..i want to make change .classpath accordingly. Or anyother way to do this automatically. Please help me...Waiting for reply.**

    Read the article

  • Jquery: syntax for inserting a function

    - by kelly
    I'm trying to integrate an animation by using the bezier path plug-in and I can't seem to implement it right. Stripped down, here's what I have: $('#next2btn').live('click', function(){ $(this).attr('id','next3btn'); $('#content2').show(300, function() { $('#account').fadeTo(500,1.0) var arc_params = { center: [278,120], radius: 186, start: -90, end: 90, dir: -1 }; }); $("#account").animate({path : new $.path.arc(arc_params)},1000); }); So, I'm trying to add this piece of code into what I have: var arc_params = { center: [278,120], radius: 186, start: -90, end: 90, dir: -1 }; }); $("#account").animate({path : new $.path.arc(arc_params)},1000) which works on its own as does the other. I'm thinking it's something about declaring that variable and where I do that. I'm essentially chaining a few different animations/actions upon a button click. Thanks for any insight- kj

    Read the article

  • Multilingual in Drupal: Can't have a node and it's translations as frontpage. How to?

    - by takpar
    hi, i built a page in Persian. set it's path to front set drupal frontpage to /front everything is O.K. in mysite.com/fa i translate the page to en problem arises. now the path of Persian page changes to default node/33. now in language's frontpage drupal says Can't find the page. i tried to set path front to the translated english page. but it did not helped. i alse tried to assign path fa/front to my Persian page. nothing helped. translating brakes path in other nodes. how can i have these pages /front and /fa/front translated of each other as the same time?

    Read the article

  • Exporting Eclipse project with a reference to native library

    - by TacB0sS
    I have an Eclipse project, that uses JMF, I found out I could skip the JMF installation process and still to use the CaptureDeviceManager of the JMF, and to receive the list of devices if I could point my project to the native lib of the JMF. I've managed to add the native lib to the IDE run/debug, but once I export the application to an external runnable Jar, the application cannot find the native lib. the files are located in c:\JMF*.dll I tried to add the folder path to the environment variable in windows - didn't work. I tried to add them into another Jar and add it to the project - didn't work. I tried to add the files into the project - didn't work. I tried to add the path to the class path - didn't work. I tried to add the path to the library path - didn't work. does someone have any sort of a solution? Thanks in advance, Adam Zehavi.

    Read the article

  • how to get files from one PC to another using c#.net?

    - by shruti
    im using c#.net..i want to get the files that are on the server PC to my PC..both the PCs are connected through network.. i have given IP address of that PC in the path...but its not copying the files to my folder. im using the following code ...but its not working..kindly help me out.. File.Copy(Path.GetFileName(sourceFile), Path.GetDirectoryName(targetpath)); in sourceFile i have given IP address + folder path of the server PC and in the targetpath i have given the path of the folder of my PC to which i want to copy the files..

    Read the article

  • Remove polyline

    - by Fran Rod
    I have the next code which show a path using a polyline. How can I remove it? downloadUrl("myfile.asp", function(data) { var xml = xmlParse(data); var markers = xml.documentElement.getElementsByTagName("marker"); var path = []; for (var i = 0; i < markers.length; i++) { var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new google.maps.LatLng(lat,lng); path.push(point); }//finish loop var polyline = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2 }); polyline.setMap(map); }); //end download url I have tried it using the next function but I m not able to make it work. function removePath() { polyline.setMap(null) }

    Read the article

  • How to retrieve files/documents that are not found on the web server machine.

    - by jhorton
    I am trying to create an export feature for a user to be able to download documents into a zip file. I have the feature working when the files are located on my local and I can use an absolute path on my local. But after talking to the infrastructure team, I found out that the documents are not stored on the same machine as the web server but located at a server farm located off site. I can query the database which gives me a file path. But the path is more of a relative path. So can anyone help me understand how to use FileInfo with getting files from another machine. I believe the infrastructure team said there is a virtual drive set up to the outside server. Am I able to use a virtual path some how? Thanks.

    Read the article

  • Content alignment for Gridviewcolumn in the listview

    - by Pankaj Upadhyay
    Please see the picture below Following is the code for this :: <Grid> <ListView Style="{StaticResource listViewStyle}" Name="transactionListView" HorizontalAlignment="Stretch" VerticalAlignment="Top" ItemsSource="{Binding}" MouseDoubleClick="transactionListView_MouseDoubleClick" IsSynchronizedWithCurrentItem="True" > <ListView.View> <GridView ColumnHeaderContainerStyle="{StaticResource gridViewHeaderColumnStyle}"> <GridView.Columns> <GridViewColumn Width="70" Header="Serial" DisplayMemberBinding="{Binding Path=Serial}" /> <GridViewColumn Width="100" Header="Date" DisplayMemberBinding="{Binding Path=Date, StringFormat={}{0:dd-MM-yyyy}}" /> <GridViewColumn Width="200" Header="Seller" DisplayMemberBinding="{Binding Path=Seller}" /> <GridViewColumn Width="200" Header="Buyer" DisplayMemberBinding="{Binding Path=Buyer}" /> <GridViewColumn Width="70" Header="Bales" DisplayMemberBinding="{Binding Path=Bales}" /> </GridView.Columns> </GridView> </ListView.View> </ListView> </Grid>

    Read the article

  • ASP.NET/IIS: Tell IIS do not check for file existence

    - by AgileMeansDoAsLittleAsPossible
    In my Global.asax.cs, I have: routes.MapRoute("AssetCss", "css/{*path}", new { controller = "Asset", action = "Index" }); I also have this in a view: <link href="/css/Root/index.css" rel="stylesheet" type="text/css" /> The problem is that the AssetController does not invoke Index when /css/Root/index.css is requested. This is because a file actually exists at the path /css/Root/index.css. If I recall correctly, there's a checkbox setting in IIS that basically says "Do not check that a file actually exists at the request path [instead, let the RouteTable handle it]." (At least there is in IIS 6.) Is there something I can put in my Web.config that sets this IIS setting to true? How do I tell IIS to let my MVC routes handle the path even if a file exists at the path?

    Read the article

  • Python: NameError: 'self' is not defined

    - by Rosarch
    I must be doing something stupid. I'm running this in Google App Engine: def render(self, template_name, template_data): path = os.path.join(os.path.dirname(__file__), 'static/templates/%s.html' % template_name) self.response.out.write(template.render(path, template_data)) This gives an error: Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3192, in _HandleRequest self._Dispatch(dispatcher, self.rfile, outfile, env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3135, in _Dispatch base_env_dict=env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 516, in Dispatch base_env_dict=base_env_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2394, in Dispatch self._module_dict) File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2304, in ExecuteCGI reset_modules = exec_script(handler_path, cgi_path, hook) File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2200, in ExecuteOrImportScript exec module_code in script_module.__dict__ File "main.py", line 22, in <module> class MainHandler(webapp.RequestHandler): File "main.py", line 38, in MainHandler self.writeOut(template.render(path, template_data)) NameError: name 'self' is not defined What am I doing wrong?

    Read the article

  • Sed substitution not doing what I want and think it should do

    - by nategoose
    I have am trying to use sed to get some info that is encoded within the path of a file which is passed as a parameter to my script (Bourne sh, if it matters). From this example path, I'd like the result to be 8 PATH=/foo/bar/baz/1-1.8/sing/song I first got the regex close by using sed as grep: echo $PATH | sed -n -e "/^.*\/1-1\.\([0-9][0-9]*\).*/p" This properly recognized the string, so I edited it to make a substitution out of it: echo $PATH | sed -n -e "s/^.*\/1-1\.\([0-9][0-9]*\).*/\1/" But this doesn't produce any output. I know I'm just not seeing something simple, but would really appreciate any ideas about what I'm doing wrong or about other ways to debug sed regular expressions.

    Read the article

  • compiling QGIS Plugin using make

    - by user1675014
    On a fresh mac os x 10.8 install, i've Quantum GIS Installed from Kingchaos binaries and running fine. I'm trying to develop a plugin for QGIS, and using Plugin Builder. The skel that Plugin Builder, produces, should work off-the-shelf, but it does not compile using the makefile. Somewhere python can't find (pyuic.py), and it searches for (/Users/kyngchaos/...), path. This user does not exist on my system:( Here are my ENVS on .profile: export PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH export PYTHONPATH=/Applications/QGIS.app/Contents/Resources/python export DYLD_LIBRARY_PATH="/Applications/QGIS.app/Contents/MacOS/lib:/Applications/Qgis.app/Contents/Frameworks" export PATH="/Applications/QGIS.app/Contents/MacOS/bin:$PATH" Here is the ouptput of make: Arthur@teste:make pyuic4 -o ui_teste.py ui_teste.ui /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file '/Users/kyngchaos/Applications/qgis-python27/Applications/QGIS.app/Contents/MacOS/../Resources/python/PyQt4/uic/pyuic.py': [Errno 2] No such file or directory make: *** [ui_teste.py] Error 2 thanks for reading.

    Read the article

  • File System Types in .Net

    - by Avi
    I don't get the abstractions and the terminology :-( For example, DirectoryInfo.FullName is defined as the full path of the directory or file, but it's a string! So is DirectoryInfo.Name, FileInfo.FullName, Path.GetDirectoyName and so on. This means that in .Net there is no "depth" (or "meat" - my English isn't so good) for the file system objects. There's no protection from a type system. I can't, for example, define two Path objects and ask if one of them is "above" the other - I have to manipulate the strings. I can't differentiate between a Path that identifies a directory and a path that identifies a file. I can't do anything!-( Just manipulate strings. Is this correct (or am I simply missing something). If correct, are there any alternatives?

    Read the article

  • escaping query string with special characters with python

    - by that_guy
    I got some pretty messy urls that i got via scraping here, problem is that they contain spaces or other special characters in the path and query string, here is some example http://www.example.com/some path/to the/file.html http://www.example.com/some path/?file=path to/file name.png&name=name.me so, is there an easy and robust way to escape the urls so that i can pass them to urlopen? i tried urlib.quote, but it seems to escape the '?', '&', and '=' in the query string as well, and it seems to escape the protocol as well, currently, what i am trying to do is use regex to separate the protocol, path name, and query string and escape them separately, but there are cases where they arent separated properly any advice is appreciated

    Read the article

  • Help in fpdf imade display.

    - by Talat
    Hello every one i m using fpdf libray to creat pdf files from html form. i m using $pdf->Image('C:/DOCUME%7E1/mypic.PNG',60,140,120,0,'',''); to display image on pdf. in its first parameter it asks for exact path.it doesn't accept anyaddress variable here. but i want to make dynamic.i have able to get a complete path in an variable. i have printed this variable. ////////////////////////////// echo "$path"; output //////////////////// C:/DOCUME%7E1/mypic.PNG ///////////////////////////////////////////////////// but how i put that path from variable in this parameter.? when i use this variable as in this function.it give error. $pdf->Image('$path',60,140,120,0,'',''); plz help me for this.

    Read the article

  • Multiple Apps Possible via Launch Services, want to Specify Particular One

    - by Andrew
    Here's the issue: I have a list of App names that I want to launch. They do not include a path (e.g. {"VLC","Microsoft Word"}. I have two different copies of VLC in different directories. I would like Launch Services to ONLY open the one from /Applications/ and not EVER launch from /Applications/AnotherDirectory I want to get the path of these, and test to see what Launch Services wants to launch (via bash with "open" or applescript via "tell _ to launch" or [NSWorkspace launch...]) The only way that I have come up with to test the path of a file about to be launched by launch services is: Applescript: tell application "Finder" to return the (posix path of (path to application "VLC" as alias)) That works fine, but launches the app (which I don't want at all). Suggestions?

    Read the article

  • transform file/directory structure into 'tree' in javascript

    - by dave
    I have an array of objects that looks like this: [{ name: 'test', size: 0, type: 'directory', path: '/storage/test' }, { name: 'asdf', size: 170, type: 'directory', path: '/storage/test/asdf' }, { name: '2.txt', size: 0, type: 'file', path: '/storage/test/asdf/2.txt' }] There could be any number of arbitrary path's, this is the result of iterating through files and folders within a directory. What I'm trying to do is determine the 'root' node of these. Ultimately, this will be stored in mongodb and use materialized path to determine it's relationships. In this example, /storage/test is a root with no parent. /storage/test/asdf has the parent of /storage/test which is the parent to /storage/test/asdf/2.txt. My question is, how would you go about iterating through this array, to determine the parent's and associated children? Any help in the right direction would be great! Thank you

    Read the article

  • Shell scripting and test expressions

    - by Paul
    Hi, I'm trying to test whether a directory path exists when a file is passed to my script. I use dirname to strip and save the path. I want my script to run only if the path exists. This is my attempt below. FILE=$1 DIRNAME=dirname $FILE if [ -z $DIRNAME ] ; then echo "Error no file path" exit 1 fi But this doesn't work. Actual when there is no file path dirname $FILE still returns "." to DIRNAME, i.e. this directory. So how do i distinguish between "." and "/bla/bla/bla". Thanks.

    Read the article

  • Strange PYTHONPATH problem

    - by DoxaLogos
    I recently updated my python installation to 2.7 (previously 2.5), and I've noticed a strange problem where I cannot import certain modules that I created. I had no problem before. Normally, I edit the PYTHONPATH and add the directory I want to import modules. For some strange reason, I can no longer import. I checked my path in PYTHONPATH, and it looked correct. When I display the sys.path in an interpreter, I see the current directory prepended to every PYTHONPATH entry(i.e. 'c:\blah\blah c:\path\to\module') If I edit the sys.path by appending the directory that I want at the end of the list,everything works fine(i.e. 'c:\path\to\module\'). I never had to do this before. I'm on Windows 7 on two computers. Has anyone else had similar trouble?

    Read the article

  • rails eval code

    - by xpepermint
    Hey. I have to do a coll inside my model like this: import = Import.find(id) status = User.find(import.user_id).{XXX}.import(import.file.path) Notice a {XXX} which should be replaced by a dinamic variable of a submodel. Model User has_many groups, clients and products. In translation this would be status = User.find(import.user_id).groups.import(import.file.path) status = User.find(import.user_id).clients.import(import.file.path) status = User.find(import.user_id).products.import(import.file.path) I was thinking of import = Import.find(id) status = eval("User.find(#{import.user_id}).#{import.model}").import(import.file.path) but this gives me an error 'TypeError: can't convert nil into String'. Please tell me how would you fix that. Thx!

    Read the article

  • How to select random image of specific size using Django / Python?

    - by Jonathan
    I've been using this little snippet to select random images. However I would like to change it to select only images of a certain size. I'm running into trouble checking against image size. If I use get_image_dimensions() I need to use a conditional statement, which then requires that I allow exceptions. So, I guess I need some pointers on just limiting by image dimensions. Thanks. import os import random import posixpath from django import template from django.conf import settings register = template.Library() def is_image_file(filename): """Does `filename` appear to be an image file?""" img_types = [".jpg", ".jpeg", ".png", ".gif"] ext = os.path.splitext(filename)[1] return ext in img_types @register.simple_tag def random_image(path): """ Select a random image file from the provided directory and return its href. `path` should be relative to MEDIA_ROOT. Usage: <img src='{% random_image "images/whatever/" %}'> """ fullpath = os.path.join(settings.MEDIA_ROOT, path) filenames = [f for f in os.listdir(fullpath) if is_image_file(f)] pick = random.choice(filenames) return posixpath.join(settings.MEDIA_URL, path, pick)

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >