Because Microsoft will be removing vbScript in the next version of Windows, I have been busy converting my utility vbScripts into Python. Part of this is a library of functions that I keep in `D:\include`. I'd like to maintain this system in Python, but the import process is rather clumsy. I have to import sys sys.path.insert(0,r'D:\include') Only after that can I import a file. The documentation is somewhat obtuse but I gather my best option is to add the file `D:\include__init__.py`. As long as that folder is known to Python I could then do from include import myfile1 to include …

Member Avatar
Member Avatar
+0 forum 5

What is the best/easiest way to add a directory to 'Path' when starting a CMD (MS-DOS) window? It used to be possible to do this with an AUTOEXEC.BAT file in XP.

Member Avatar
Member Avatar
+1 forum 2

I need a boolean to be stored with a String (or possibly a Path, not sure which one I want to use yet). I thought about using a Map, so I did some looking around and found out that LinkedHashMaps are the only type of Map that stay in Order when you do something with them. I could use two arrays, but I'm sure theres something better to use. Usually I would just make a helper class that stores the String, or Path, and the boolean and make Objects of this class. I know I could do this, but what's …

Member Avatar
Member Avatar
+0 forum 12

Hello I am currently working on a "local" dev wordpress site, where I have a JS file stored with the path as e.g, http://www.devsite.com/websites/wordpress/mysite/wp-content/themes/mtheme/validations.js Currently, am using the relative path e.g. src = "././wp-content/themes/mtheme/validations.js" to load it. However, on the live server, which is maintained by someone else and I have no access, the website is using something similar to the example to load its JS files: http://www.mysite.com/wp-content/themes/mtheme/jquery.js My question is, will my relative path for the dev site work on the live one as well, or do is there a global path which can work on both, whereby I …

Member Avatar
Member Avatar
+0 forum 2

Hi there. I am making an application in VB.Net. In which i am scanning some system folders and on the execution time it gives me the error; E.g, access to the path "C:\any system file" is denied. Is there any code you people have that is edited in to the "form load" so when ever the application is executed, the denied error should be removed upon the form load? Thanks.. the code is as follows [code]Imports System Imports System.ComponentModel Imports System.Diagnostics Imports System.Drawing Imports System.IO Imports System.Runtime.CompilerServices Imports System.Security.Cryptography Imports System.Text Imports Microsoft.VisualBasic Imports Microsoft.VisualBasic.CompilerServices Imports System.Windows.Forms Imports System.Collections.ObjectModel Public …

Member Avatar
Member Avatar
+0 forum 12

Hi, I wanted to know if I could search for a file in the application's folder, just by checking with the `File.Exists` method. I am searching for a DLL file in the app's directory. Thanks in advance, Yuvjeeth

Member Avatar
+0 forum 0

I downloaded eclipse to my windows 8 computer along with the jdk and when I launch eclipse it tells me that it cannot not find the jre or jdk and that it is not in my current PATH. I have tried setting the path to the jdk folder but it still doesnt seem to solve the problem.

Member Avatar
Member Avatar
+0 forum 6

i have downloaded this script , a photo gallery which creates albums, uploads photos, deletes them, i nedd to insert the path of the folder according to this instructions : $script_url=$_SERVER['PHP_SELF']; //Change this if you want to use this as an include file. $files_path="./album/"; // Where does the album start? Anything under the directory the script will read. With Trailing slash $full_server="http://localhost:8080/phAlbum/album"; //Enter the full server path to where the albums start. //With Trailing Slash Can you explain it to me, i want to be sure, eventhough there are comments that explain, is it ok this way? Because when i …

Member Avatar
Member Avatar
+0 forum 3

Hello Community, I was wondering if there is a way to restrict sub directories from accessing the parent directory (the main directory where all my website file are stored) and from having any interaction with the previous folders (so once there in the child folder they can't leave it eg. using *../*) Is there a way doing this using PHP or .htaccess? Please help...

Member Avatar
Member Avatar
+0 forum 7

Hello! I am having trouble getting the abspath when entering only an executable file. How can I fix this to return the full abspath? I am taking user input and opening a process (application). Here is my code: file = "/" + arr[2] + ".exe" print(file) path = os.path.abspath(file) print(path) subprocess.Popen(path) localtime = time.asctime(time.localtime(time.time())) print(arr[2] + " opened at " + localtime + "\n") When args[2] = 'firefox', this is outputted: firefox.exe C:\firefox.exe Traceback (most recent call last): File "C:\Python33\lib\subprocess.py", line 1090, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified Any suggestions? Thanks!

Member Avatar
Member Avatar
+0 forum 2

So, even thou I have searched throughout the forums, I couldn't get a clear answer, maybe perhaps I'm a noob @ Python. As a beginner, I don't know much about Python, and it's frustrating to search the net and not find the actual answer. So, I'm working on this project, and I stumbled upon this thing: what I want to to is to open the command line(I'm working in Windows 7 ultimate) from a Python file, change the directory, of whatever is there, like, from the start cd c:\\ to the actual c: directory. Next step comes from the user, …

Member Avatar
Member Avatar
+0 forum 3

hi i just started php, my code works on ie, bit when i open the webpage on firefox and chrome the image does not display?, can anyone help [CODE] $car = "C:\wamp\www\porche.jpg"; $banner = "<img src=\"$car\" "; $banner .= "width=\"380\" height=\"110\" border=\"0\" >"; echo($banner); [/CODE]

Member Avatar
Member Avatar
+0 forum 3

how do I set the path of this cookie to my whole site "/"? [ICODE]setcookie("name$id$uid", $id, $month);[/ICODE] currently this is what I have. How do I format the above to set the cookie on a global scale for the entire site.

Member Avatar
Member Avatar
+0 forum 1

This is a continuation of problems with the program posted here: [URL="http://www.daniweb.com/software-development/python/threads/372311"]http://www.daniweb.com/software-development/python/threads/372311[/URL] I started thinking there was something wrong with my statement to open the csv file, using the reader. [CODE]reader = csv.reader(open('C:/Documents and Settings/VPC.VPC-SCALA.000/Desktop/RAH 7-11-11/RH/Projected Cash Goals Template.csv', 'rb')) [/CODE] I put a test statement above the open statement and the test worked the way it was supposed to but when I move it below the open statement, it no longer works. Then, I ran [CODE]if os.path.exists('C:/Documents and Settings/VPC.VPC-SCALA.000/Desktop/RAH 7-11-11/RH/Projected Cash Goals Template.csv'): print 100 else: print 2[/CODE] and got the else branch. I don't see why it would …

Member Avatar
Member Avatar
+0 forum 1

I'm not sure if this is possible. Basically, I have a function that will detect the current active user. [CODE]string currentUser() { string user; ofstream outf("CurrentUser.dat", ios::trunc); system("whoami >> CurrentUser.dat"); outf.close(); ifstream inf("CurrentUser.dat"); inf >> user; return user; }[/CODE] I have another function which will create a directory in the user's computer. The path will be: /Users/*ActiveUser*/Library/Application Support. Now, I have a data file containing only the name of the current active user. How can I insert that into a system command such as: [CODE]system("mkdir \"/Users/ActiveUserGoesHere/Library/Application Support\"");[/CODE] If I read the contents of the data file into a string or …

Member Avatar
Member Avatar
+0 forum 4

I am relatively new to Python and just have a couple quick questions about using file paths in Python code. 1) As I was recently playing around with the command line, I could not get a file path to work correctly unless I used forward slashes in the path...for example: [code=python]reader = csv.reader(open('C:/Folder/Folder/file.txt', 'wb'))[/code] However, I wrote a program previously that used the backslash and everything worked just fine. Is there a time to use the backslash and time to use the forward slash or does it not matter? 2) I was also trying to use the path to a …

Member Avatar
Member Avatar
+0 forum 1

Howdy, I need to print given path to a file. The problem is that my app is platform independent -> I can get a Win32 style path: [CODE]C:\foo\bar.dat[/CODE]. The problem is with printing single backslashes '' -> single char converts to "\char" style. I need to convert it somehow to proper style "\\" in order to print it. I was thinking about some lib function (dir.h, sys_*, etc.), but I had no luck. Any help appreciated! :)

Member Avatar
Member Avatar
+0 forum 2

Hello Daniweb, In 3D space I have generated a path which jumps between points in a grid of 100x100x100. When simulating movement through this path, I tried making a bezier curve of the points in the path, but the results were not good enough. I googled a lot, and the closest I came to success was this article from a game developer ([url]http://www.valvesoftware.com/publications/2009/ai_systems_of_l4d_mike_booth.pdf[/url], page 14) - something called reactive path following seams to be good for my purpose. I am not sure at all, how I would get on to do this. I thought of choosing a random number (2-6 …

Member Avatar
Member Avatar
+0 forum 4

Hey people, I've been coding in vb.net for a while but never had to publish anything (it didn't get covered during any of my classes) so here's my confusion: Context: My application uses an existing excel spreadsheet which it then modifies per user input, and saves the modified version to the user's MyDocs folder. Issue: During development that .xls file sat in my project folder, and was accessed w/o error. When I publish the app, how do I ensure that it still has access to the file? What I think I need is a dynamic file path to the spreadsheet, …

Member Avatar
Member Avatar
+0 forum 1

[CODE]private Bitmap _picture = new Bitmap(@"<C:\Users\Jack\Documents\Visual Studio 2010\Projects\Animotion1.0\DefaultCharPic.jpg>");[/CODE] as a datamember to a class? Can I just not assign Bitmaps as members?

Member Avatar
Member Avatar
+0 forum 1

im a newbie to python, still learning as of today. as a part of my 'self-training' i listed some topics to practice every week but i was not able to run it successfully and im stuck. what i wanted with my activity is for it to read a .txt file which contains tabular data, place each line of the file in an array and return a line i wanted to call. hope you could help me with this. thank you :)

Member Avatar
Member Avatar
+0 forum 5

I need to know how can I use app path? I have a added Shockwave Flash Object control there in my program. However I have added AxShockwaveFlash1(swfla1) there in my form. I have written code there in Form_Load event so that swfla1 will get flash file(.swf) to play. Form_Load event code : Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load swfla1.Movie = ("D:\Documents and Settings\James\My Documents\Test project\Animation\Animation.swf") End Sub Swfla1 will get flash file (.swf) from ("D:\Documents and Settings\James\My Documents\Test project\Animation\Animation.swf") this location. As a result if user will install it there in another drive it …

Member Avatar
Member Avatar
+1 forum 3

Hello,.. Im a New Guy to this forum and 1st of all;... Hi :twisted: im a newbie to c# programming as well ,,, anyway.. i have a huge issue .. here is what s going to happen.. [CODE] if (txtPath.Text != "") { FileInfo fn = new FileInfo(txtPath.Text); string p = txtPath.Text; int pos = p.LastIndexOf("."); string ext = p.Substring(pos + 1); string newname = mid + "." + ext; string path = Application.StartupPath.ToString() + "\\images\\" + newname; fn.CopyTo(path); sql = "INSERT INTO mobile(MID,MMNO,MPRICE,MINFO,MMANU,MPIC,MDOA) VALUES('" + mid + "','" + mmno + "','" + mprice + "','" + minfo + …

Member Avatar
Member Avatar
+0 forum 10

Hi all, I am working on a PHP project. Im having a problem giving the 'src' for a image, because the image file is placed outside of the www folder :(. Let me explain more. When I log in to my server using FTP logins, it gives the directory structure as below +--[B]www[/B] +--[B]project1[/B] -----+[B]www[/B] ----------[B]index.php[/B] -----+[B]resources[/B] --------+[B]additional[/B] ---------------[B]image.jpg[/B] +--oldproject +(some other folders) I can access my [B]project1[/B] directly through the browser using [B][url]http://hostname/index.php[/url][/B] That means [B]/project1/www/index.php[/B] file directly get executed by calling [B][url]http://hostname/index.php[/url][/B] (I really don't know how it is done, but it's working :)) Now I want to …

Member Avatar
Member Avatar
+0 forum 11

Hello everyone, I'm new to C / C++, and just wanted to make a file which can delete an item. The code worked, but when I want to give a path, it doesn't work anymore. Any help? [CODE] #include <iostream> #include <stdio.h> using namespace std; int main() { remove ("c:\users\asus\new.docx"); return 0; } [/CODE] I'm running Vista, and use Microsoft visual studio 2008 express edition.[code][/code]

Member Avatar
Member Avatar
+0 forum 2

The End.