new to mac and textmate, can someone explain these shortcuts? - python

I'm using textmate for the first time basically, and I am lost as to what keys map to these funny symbols.
using python bundles, what keys do I press for:
run
run with tests
run project unit tests
Also, with textmate, do I actually define a project in textmate or do I just work on the files and textmate doesn't create its own .project type file ?

Check out this link for some of the translations to some of the keyboard symbols. This should help you out :)
Also here is a link from the Apple site for an exhaustive list of shortcuts.
(source: osxkeyboardshortcuts.com)

Also, with textmate, do I actually define a project in textmate or do I just work on the files and textmate doesn't create its own .project type file ?
You can do both. You can create a new project in TextMate by going to File -> New Project and add your files manually, or you can drag a folder into TextMate and it will create a project from those files (you can add other files later). Note that the second method will not create a .tmproj file, though, so if you want to "keep" that project, you'll have to save it (File -> Save Project).

Related

Eclipse: Open ressource on folder

Is it possible in Eclipse (pydev) to include folder (names) in the Open Ressource file navigation?
When opening specific files in one of my projects I often use the Open Ressource (see the Eclipse help) dialog (Navigate -> Open Ressource). This way I don't have to remember (or keep track in a multi-developer project), where a specific file is placed, but only the file name.
This only seems to filter through file names. I would rather like to
(optionally) include the folder name
open python package file __init__.py in the editor
(or any other configurable custom file like __custom_module__.py)
How can I achieve this?
For finding any file, Ctrl+Shift+R (open resource) is good, but to find a Python package/module/class/method, Ctrl+Shift+T (Python tokens browser) is better -- you can filter by the module name as you want -- see the docs on the dialog when you open the tokens browser.
Note: you need to focus some PyDev editor for it to become active (such as the PyDev package explorer or a PyDev editor).
Note 2: You may still use a filter with folders in the open resource if you filter with the path (i.e.: *package/file*.py)

Pycharm update reference automatically

I'm a new Pycharm's user, and in my project, I need to turn a python file in a directory. This file contains a lot of functions and so i would like reorder my project creating a new directory that contains new python files with the functions cited previously. So my question is:
Is there a pycharm functionality that update automatically all references (for example import) in project?
I have searched something like this but i haven't found a good solution.
Thanks in advance
Regards
go to File >> Settings >> Project >> Project Interpreter
select the setting icon there and click on more
here click in last option (Interpreter Paths).
add your modules directory location here.
restart Pycharm

Single EXE to Install Python Standalone Executable for Easy Distribution

I used Pyinstaller to create a standalone exe file for a PyQt project. I did not use the single file option because the exe that is created with the single file option takes too long to open. Therefore, Pyinstaller created a dist folder that contains a bunch of files including my program.exe file. I would now like to create a setup.exe file that will place the contents of my dist folder in the program directory and create a shortcut in the start menu and on the desktop. I want it to be super simple for the user. Maybe like the setup.exe files that you get when you download a program from CNET. I found Inno-setup, which looks promising. However, I do not know if there any special considerations because the program is a standalone program create from a python/PyQt program. Thanks! Anyone have experience with this task? Is there a program everyone is using for this task that I do not know about?
Inno-Setup or NSIS are probably the easiest to use. You just tell them what files to include and where to put them and then they will create a nice installer for you. I wrote a short tutorial on my experiences using InnoSetup that you might find helpful:
http://www.blog.pythonlibrary.org/2008/08/27/packaging-wxpymail-for-distribution/
Note that this tutorial was based around a wxPython app I wrote, but the concepts are the same.

How to work within individual files rather than projects in PyCharm

Relatively new to Python and PyCharm and as such most of the work. I'm doing is single files and therefore is not organized into projects.
Is there a way to configure Pycharm to be used to open single files and not use projects?
Similarly, is it possible to just run a single page/file?
On Pycharm 5.0.4...
Open the file (i.e. by double clicking in explorer)
Navigate to File->Settings...
Expand the Project tab on the left and select 'project interpreter' from the options that appear beneath
Set your project interpreter from the dropdown menu, and you should be able now to run your file without creating a project
You can always open a single file (File > Open) but to actually run or debug the code from within Pycharm, or use most of its other features, it needs a correctly configured project.
What you can do is create a single project to hold all of your "assorted" code. I usually recommend creating a virtualenv for this project as well and using that as your Pycharm project interpreter. You can further divide this project into different packages to keep things organized.
Update: PyCharm 4.5 now provide Scratch Files which seem relevant to this question.
You have to work with a configured project (indicated by folders) but there is a work around... In Pycharm when you create a project you will have a default file in .py or any other format.
Just follow the steps to work with individual files..
right click on the folder (in left hand side project tree) and add new python file
double click on the newly added file ,it will now be open in a new tab
(BUT..if you try to run this new file pycharm will still compile the previous file ...so to change that..)
right click on the tab of your file and click run "file name" or you can press CTRL+shift+F10
done :)
From the command line
pycharm [path_to_your_file]
where pycharm on my machine is aliased to /opt/pycharm-community-3.1.1/bin/pycharm.sh in file ~/.bash_aliases.
As Preston mentioned, not all features seem to work: for example, navigation between files does not seem to work.
You can also create a .py file and implement it within a PyCharm project by dragging it into the editor. This method also allows you to use a separate text editor to create your .py file.

Don't display .pyc files in the Xcode 4 project navigator

I'm working on a fairly large django-project in Xcode 4. I prefer not to see all the automatically generated .pyc files in the project navigator.
Does anyone know a way to hide the .pyc files from the interface?
I don't necessarily want to remove them from disk.
Thanks.
-
What fails:
Checking "Show only files with source-control status" hides all files except the .pyc files... If only there is a way to invert this selection.
Showing files with matching name will also only give me a solution for solely showing the .pyc files. Typing ".py" also yields .pyc files...
The best I can come with is the way I do it: By dragging only the .py files into the XCode project at the start. It's not ideal; there should be a way to filter out build files. This method also isn't great for sub-folders, since you have to create each folder and then drag the .py files in for each folder by hand. But it works, and now I have no .pyc files in my project. Also, irritatingly, I can't delete .pyc files from the project once they're in there, so controlling things from the outset is the only solution I found.
given that this has not been answered directly here is an alternative solution using another programming software which is Coda 2.
You can create a rule that will hide those files, here is how to proceed :
First open your preferences from the main menu
Second go to the rules tab and create a new rule using the lower left "+" button
Give the rule a name, such as "Python compiled Files"
Select "Hide" from the right menu instead of "Skip"
Edit the first rule as showed to apply it to files which "Name" ends with "pyc"
Close the preferences pane and voilĂ , you are all set to keep being an efficient Coda user
This is taken from this website for sourcing purpose. It contains images illustrating this.

Categories

Resources