Where are the python modules stored?

Is there a way to obtain a list of Python modules available (i.e. installed) on a machine? This works for me: help(‘modules’) Where is the module code actually stored on my machine? Usually in /lib/site-packages in your Python folder. (At least, on Windows.) You can use sys.path to find out what directories are searched for … Read more

List all files and directories in a directory + subdirectories

string[] allfiles = Directory.GetFiles(“path/to/dir”, “*.*”, SearchOption.AllDirectories); where *.* is pattern to match files If the Directory is also needed you can go like this: foreach (var file in allfiles){ FileInfo info = new FileInfo(file); // Do something with the Folder or just add them to a list via nameoflist.add(); }

How to copy directories in OS X 10.7.3?

Is there something special with that directory or are you really just asking how to copy directories? Copy recursively via CLI: cp -R <sourcedir> <destdir> If you’re only seeing the files under the sourcedir being copied (instead of sourcedir as well), that’s happening because you kept the trailing slash for sourcedir: cp -R <sourcedir>/ <destdir> … Read more

Create a folder inside documents folder in iOS apps

I do that the following way: NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@”/MyFolder”]; if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath]) [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error]; //Create folder

How do I create a directory from within Emacs?

to create the directory dir/to/create, type: M-x make-directory RET dir/to/create RET to create directories dir/parent1/node and dir/parent2/node, type: M-! mkdir -p dir/parent{1,2}/node RET It assumes that Emacs’s inferior shell is bash/zsh or other compatible shell. or in a Dired mode + It doesn’t create nonexistent parent directories. Example: C-x d *.py RET ; shows python … Read more

How do I move a single folder from one Subversion repository to another repository?

If you have access the repository itself (not a working copy), you should be able to dump the current repository, filter it to only include information about the docs folder, and load it into the other repository. Would be something like this: svnadmin dump /svn/old_repos > ./repository.dump svndumpfilter include path/to/docs –drop-empty-revs –renumber-revs –preserve-revprops < ./repository.dump … Read more

How can I access a folder inside of a resource folder from inside my jar File?

Finally, I found the solution: final String path = “sample/folder”; final File jarFile = new File(getClass().getProtectionDomain().getCodeSource().getLocation().getPath()); if(jarFile.isFile()) { // Run with JAR file final JarFile jar = new JarFile(jarFile); final Enumeration<JarEntry> entries = jar.entries(); //gives ALL entries in jar while(entries.hasMoreElements()) { final String name = entries.nextElement().getName(); if (name.startsWith(path + “https://stackoverflow.com/”)) { //filter according to the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)