Sublime Forum

Problems with the listing of the current directory

#1

Hello world !

So I’m new in Sublime text plugins and I’m trying to get all the .cs and .dll files in the file directory

I have two problems :

_The first is I have no feedBack from sublime text when an error occurs (is it normal ?)

_The second is from my code (i tested it in the python idle) :

[code]import sublime, sublime_plugin
import os

class OpenCompilerCommand(sublime_plugin.TextCommand) :
def run(self, edit) :
file_name=self.view.file_name()
path=file_name.split("\")
path.pop()

	command = "csc /out:Main.exe"
	dllArray      = ]
	CodeFileArray = ]

	pathToDir = ""
	for dir in path:
		pathToDir += dir + "\\"
	sublime.error_message(str(pathToDir))

[/code]

don’t really know what’s wrong…
If you could also give a link for a beginner tutorial (I already googled it but… no good results)

Thanks !

0 Likes

#2
  1. Whenever an uncaught exception occurs it is printed into the console (ctrl+´).
  2. Your code does not match with what you describe you want to do. Actually, the whole code is pretty weird.

If you are new to programming, read this: learnpythonthehardway.org/
If you are new to Python, read this: docs.python.org/2/tutorial/
If you don’t know how to google, click this: bit.ly/UXF0p0

0 Likes