File: help.txt

package info (click to toggle)
drpython 1%3A3.11.4-1.1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 3,868 kB
  • ctags: 2,871
  • sloc: python: 16,653; makefile: 141; sh: 1
file content (664 lines) | stat: -rw-r--r-- 20,511 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
================
 DrPython: Help
================


Introduction
=============

*Just what is DrPython?*

To start with, DrPython is a Development Environment. It is essentially
a text editor with built in programming tools, like an integrated
prompt, text manipulation, and syntax highlighting to name a few.
The integrated prompt means when you run a python program, 
DrPython catches the output, takes input, and in general behaves
like a console window (:program:`cmd.exe` or :program:`rxvt` for example).

DrPython was designed to be a cross-platform Python IDE. 
The primary purpose was for use in Education, to make teaching
Python programming easier. It was originally designed based 
roughly on :program:`DrScheme`. DrPython is meant to play the same role 
for Python that :program:`DrScheme` plays for Scheme.

The main development platform is Linux.  It has been tested on various
flavors of Linux (E.g. Debian, Fedora, Gentoo, Mandrake, Ubuntu), Windows 9x,
Windows NT, Windows XP, and Mac OS X.

Any platform which supports python 2.5+ and wxPython 2.8.1+
should work.

*Is DrPython Free or What?*

DrPython is both free and open source software. This means 
you can download DrPython for free, share it as much as you 
want, look through the source, whatever. You can even take 
chunks of code and plop them into your own program (so long 
as you give proper credit!). You could even start your own 
branch of DrPython, or rewrite the code to work with another
language.

The point of Free/Open Source Software is that the user 
has the power to use their software as they wish.

The bummer side of this is that DrPython has no warranty. 
So if after using DrPython your computer becomes telekinetic 
and blows up your refrigerator... You can send me a bug report.

DrPython is released under the GNU Public License.

Built Using
------------

For the Program:

- `Python <http://www.python.org/>`_ (Guido van Rossum et al.)
- `wxWidgets <http://wxwidgets.org/>`_ (Julian Smart et al.)
- `wxPython <http://wxpython.org/>`_ (Robin Dunn et al.)
- `Scintilla <http://www.scintilla.org/>`_ (Neil Hodgson)

For the Documentation:

- `docutils <docutils.sourceforge.net>`_ (David Goodger)
- `pygments <http://pygments.org/>`_
- `Sphinx <http://sphinx.pocoo.org/>`_ (Georg Brandl)

Icons from:

- Klassic New Crisp Icons (Asif Ali Rizwaan)
- Sparkling (Flow)
- Noia (Carles Carbonell Bernado)
- Nuvola (David Vignoni)
- (Some Icons Were Either Created or Edited by Daniel Pozmanter.)

Donate!
--------

If you want to show support for DrPython, send a donation our 
way. A single dollar would be delicious and nutritious:

`Donate to Daniel Pozmanter <http://sourceforge.net/donate/index.php?user_id=796750>`_

`Donate to North Star <http://sourceforge.net/donate/index.php?group_id=83074>`_


Installation
=============

If you are reading this, DrPython should already be installed.
That being said, you need the following programs to run 
DrPython: Python 2.5 or newer (tested with 2.5) and the 
corresponding wxPython. It is really best to get the lastest
version of Python 2.x and wxPython.

If you are having trouble running DrPython on Linux/Unix, 
run the file :command:`drpython.lin`, or edit the first line of 
:command:`drpython.pyw` or :command:`drpython.py` to read:

.. code-block:: python

  #!/usr/bin/env python

If you are still having trouble, go to the DrPython website
(http://www.sourceforge.net/projects/drpython/) and post to 
the help forum.

You can manually set the path used for storing preferences:

:samp:`drpython.pyw --preferencesbasepath={the path}`

DrPython will then use preferences in the directory:

- :file:`{the path}/.drpython` on Unix/Linux
- :file:`{the path}/drpython` on Windows

Support
--------

Found a bug? Want to see something change? 
Have a feature request? Stop by the `DrPython Sourceforge
Project Page <http://www.sourceforge.net/projects/drpython/>`_.
Post in the forum, or formally submit a bug/feature request.
I highly recommend starting a discussion on possible 
features/changes. Part of the power of open source is the 
power of the users and developers to engage in discourse 
about a project, its design and its uses.

Features
=========

Bookmarks
----------

Bookmarks are pretty straighforward: there are Bookmarks, and there are Bookmark Folders.

A Bookmark is either a file or directory. When it is selected from the menu, if it is a file, it is opened. If it is a directory, an Open Dialog in that directory pops up.

A Bookmark Folder may contain Bookmarks and/or Bookmark Folders.

You can only add a Bookmark Folder or Bookmark to a Bookmark Folder.

To move a Bookmark or a Bookmark Folder (and all it's contents): 

1. Single click on the item you want to move.
2. Drag it to the item you want it to go immediately after.
3. Dragging it to the any item in a folder will cause it 
   to be added directly after that item.
4. Dragging it to a folder will cause it to be the first 
   item in that folder.


Check Syntax
-------------

Runs the python built in 'compile', then tabnanny, on the current file. Reports syntax and indentation errors.

Note that this only checks the syntax for the current file.

Encoding Support
-----------------

.. note::

    The following only applies if your version of wxPython was built with
    unicode support:

If you want to use a non ascii encoding (like latin-1 or unicode (utf8)),
you need to set some preferences first.  (In the event of a bad encoding,
drpython will warn you via standard output (if the problem is in the file dialog
or prompt), or via a dialog (if the problem occurs while saving or opening a file).

DrPython, by default, checks for unicode when opening/saving files,
and in the Prompt. 

If you want to use a specific encoding, you have two options.

1. You can set the default encoding via Preferences.
   This is the encoding used by default when opening/saving files,
   and the encoding used in the prompt and file dialog.
2. For Opening and Saving files, if you use the special python comment:

.. code-block:: python

    # -*- coding: xyz -*-

(As detailed in the Python Tutorial).

DrPython will try the encoding 'xyz' for the file first.

DrPython, when getting text to open/save
will go through the following steps:

1. Check for a special comment (coding) (if Auto Detect is enabled).
2. Check for Unicode (if Auto Detect is enabled)
3. Check for default encoding (if Default Encoding is enabled)
4. If no check passes, ensure the text is ascii.

To disable default encoding, leave it blank.


Find/Replace
--------------

This is a rather standard/straightforward dialog. However 
there are some things that stick out.

Right clicking on the text field will yield a pop up menu. 
You can insert tab/newline/carriage returns, perform clipboard
operations, or clear the text.

You can also access Find/Replace History via the combobox. 


Find and Complete
------------------

This is a user initiated version of auto complete. 
DrPython will search the current file for possible 
completions to the word you are currently typing. 
It will display these results in a small window. 
Navigate by using the up and down arrows, or to go faster, 
page up and page down to go faster, or home and end to skip 
to the start and end of the list.

Hitting :kbd:`Enter` or :kbd:`Tab` will complete the current word with 
the selection.

Context Sensitive: Find And Complete stops at the following 
characters (in addition to whitespace)::

  ( ) < > [ ] { }

This means:

.. code-block:: python

  tree
  dog(threat)
    
  dogs
  dog(tre

searching at ``dog(tre`` will yield ``tree, treat``. However:

.. code-block:: python

  tree
  dog(treat

  dogs

  dog(
    
searching at ``dog(`` will yield ``dog(threat, dogs``.

.. note::
    
    Find And Complete is case sensitive.


Go To Block / Class / Def
--------------------------

A few notes. In the code:

.. code-block:: python

  if True:
      print "Hallo"
  # Comment
      print "Hello again"
    
``if True:`` is the start of the block; ``print "Hello again"`` is the end.

Comments (``#``) are ignored. For explicitly (joined with a 
backslash) and implicitly joined lines, every line after the
first is ignored.

Goto Traceback
---------------

Double clicking a traceback entry in the prompt (the *File* 
line in the example below)

.. code-block:: pytb

  Traceback (most recent call last):
  File "/home/user/Desktop/test.py", line 6, in ?
    wd
  NameError: name 'wd' is not defined

will tell DrPython to open :file:`/home/user/Desktop/test.py` and 
go to line 6.


Indentation and Tabs
---------------------

The "Use Tabs" option under "Document" in preferences tells 
DrPython whether to use tabs (default) or spaces for 
autoindentation. "Tab Width" under "General" is how many 
spaces DrPython should consider a "Tab" to be.

To see what characters the current document uses for 
indentation, check the statusbar.

The "Whitespace" menu has entries that allow you to set 
indentation to tabs or spaces. Setting the indentation for 
the document to tabs, for example, will replace a set number 
of spaces with tabs. This operation takes place at the 
beginning of each line.

Some programmers prefer (and/or were taught) to use tabs 
('\t') to indent blocks of code. Some use spaces instead.

The whitespace menu lets you easily switch the type of 
indentation used in the current file to the type you prefer
to work with.

Note: The ClassBrowser only works properly if the current 
file is using the same type of indentation (tab character 
or spaces) as is set as the default for DrPython in prefs. 
DrPython will automatically check for this when you open 
the Class Browser. To fix a mixed file, use the "Whitespace"
menu under "Edit".

.. warning::

    If the line endings are mixed, DrPython will not be 
    able to properly fix the indentation. Always set the line 
    endings before setting the indentation type. 


Shortcuts
----------

You can set shortcuts by selecting "Customize Shortcuts" from 
the Options menu.

Ignore Keys ignores the modifier keys listed. Only modifier 
keys are valid. This is primarily for operating systems such 
as Linux, where the "Meta" key is set to "Num Lock" by default,
and hence may always be on.

.. note::

    You can set shortcuts for DrScript menu items. If you 
    have not, or the shortcuts file is somehow out of sync with
    the actual number of DrScripts, DrPython will simply load the
    correct DrScripts, with no default shortcuts. DrScript 
    Shortcuts are stored separately from DrPython Shortcuts.

If your shortcuts are not working, use "get key" on a shortcut
to see if a modifier key is constantly present. On Linux, 
"Meta" may be present. If this is the case, use "Ignore Keys"
to set "Meta" as a key to ignore.

For a given shortcut, simply click the "Get Key" Button, 
and press the keys you wish. It will print the modifiers 
detected, and the keycode. When you are done, hit "Close",
and the keystring will be next to the shortcut.

Select "Update" to start using the key now. Select "Save" 
to have DrPython remember the changes.

.. note::

    The Tab and Enter keys are used for code related
    to indentation in the document, and :kbd:`Enter` + the arrow keys
    are used behaviour specific to the prompt.  Setting these
    keys in the shortcuts may cause DrPython to behave incorrectly.

.. note::

    On some platforms some keys may not register, and thus 
    cannot be used as shortcuts.

.. note::

    There seems to be a bug where :kbd:`shift + backspace`
    inserts the backspace character. To work around this, 
    "Delete Back Not Line" is assigned to :kbd:`shift + backspace`.
    If you want to insert the backspace character, just set 
    "Delete Back Not Line" to None. If you want to use 
    :kbd:`shift + backspace` for something else, just set it to 
    None, and you should be set.

The defaults are:

=================== ==================
Key                  Default shortcut
=================== ==================
Ctrl + N             New File
Ctrl + O             Open File
Ctrl + S             Save File
Ctrl + W             Close File
..                   ..
Ctrl + M             Open Imported Module
..                   ..
F9                   Select Previous Document
F10                  Select Next Document
..                   ..
F7                   Open a Python interpreter
Ctrl + E             Run current program
Ctrl + D             End current program / Python interpreter
..                   ..
Ctrl + R             Replace
Ctrl + F             Find
F3                   Find Next
Shift + F3           Find previous
..                   ..
Ctrl + G             Go to line
Ctrl + B             Go to block start
Ctrl + Shift + B     Go to block end
Ctrl + F8            Source Browser Go To
..                   ..
Ctrl + Enter         Find and complete
..                   ..
F6                   Toggle view prompt
F5                   Toggle maximise
F8                   Toggle source browser
Ctrl + Shift + W     Toggle view whitespace
..                   ..
Ctrl + P             Print file
Ctrl + Shift + P     Print prompt
..                   ..
Ctrl + [             Comment
Ctrl + ]             Uncomment
Ctrl + I             Indent
Ctrl + Shift + I     Dedent
..                   ..
Ctrl + A             Select all
Ctrl + Z             Undo
Ctrl + Y             Redo
Ctrl + X             Cut
Ctrl + C             Copy
Ctrl + V             Paste
Ctrl + +             Zoom in
Ctrl + -             Zoom out
Ctrl + Shift + U     Uppercase
Ctrl + U             Lowercase
=================== ==================


Line Endings
-------------

================ ======== ===
Unix Mode         \\n      New line
Windows Mode      \\r\\n   Carriage return, New line
Macintosh Mode    \\r      Carriage return
================ ======== ===

Windows mode can make Linux hiccup. So Unix Mode is the 
default (Windows seems to be fine with it.)

.. note::

    Setting the Line Endings in Preferences does not 
    affect the current open file! 


Menu And Focus (Toggling)
--------------------------

Some menu items act on the Text Control currently with focus.
Toggle Whitespace Visible is one such item.

If the focus is on the File text control, then selecting 
this menu item will cause the whitespace to either become 
visible or invisible in that control.

If the focus is on the prompt, then the whitespace will be 
toggled in the prompt. 


Open Imported Module
----------------------

DrPython only shows modules which exist. These are either in 
the current module search path for Python, or in the same 
directory as the current document.

Some modules do not exist as files. The integral modules sys 
and time are two examples. These will not show up in the 
list of imported modules, even if they are imported in the 
current document.

If you type, the typed text is used as a filter for the 
matching modules. (Use backspace to backtrack). Only matches
that contain the typed text will be shown. (Case insensitive.) 


Pop Up Menu
-------------

The Pop Up Menu is the menu that pops up when you right 
click on the Document, or the Prompt. You can customize 
this menu to handle DrPython functions, DrScripts, or plugins.

Note that each item on the Pop Up Menu must have a distinct 
name for everything to work properly.


Rectangular Selection
-----------------------

To activate this feature, use :kbd:`Alt` on Windows, 
:kbd:`Shift + Alt` on Linux. (If neither works, try :kbd:`Ctrl`).

**In Find**: rectangular selection ignores line endings, 
and does not support the 'Whole Word' flag. It searches line 
by line.

**In Replace**: the above applies. Also, 'Prompt On Replace'
is not supported.


Regular Expressions
--------------------

It is best to consult the python documentation 
(Under Modules, :mod:`re`).

In short, Regular Expressions provide a fast and powerful 
method for matching patterns of text. These can be quite 
useful in programs you write, or simply to find and/or 
replace text in a given file.


Running a Python Program
-------------------------

Open a file, click run, and you are set to go. If your 
program takes arguments, select "Set Arguments" from the 
menu or toolbar.

Note the right field in the status bar tells you if the 
program is running. Also note that the "End" button is 
enabled, and "Run", "Set Arguments", and "Python Debugger" 
are disabled.

When the program has ended, the right status bar field 
goes blank, "End" is disabled, and "Run", "Set Arguments",
and "Python Debugger" are enabled.


Shell Commands
---------------

To add a shell command, go to the DrScript menu, under 
Add Script, and select "Shell Command".


Source Browser
---------------

The source browser displays classes, defs, imports, and labels.
Double Clicking (Or, Optionally, Right Clicking) an item
will set the Document to the line number of that item.

Separators (Labels) can be added manually (``#---YourLabelHere``)
or via the Insert Seperators Dialog.


Source Browser Go To
---------------------

A very quick and simple way to move around in a large document.
If you type, the typed text is used as a filter for the 
matching classes, defs, and imports.  (Use backspace to 
backtrack). Only matches that contain the typed text will 
be shown. (Case insensitive.)

The typed text is echoed in the top text control. The next 
two text controls shows the line number of the selected 
item, as well as the class or function the item is defined in.
(The filename is used if no class or function is found).


Status Bar
-----------

| The Status Bar displays some useful information. The left bar displays:
| [*current line*] [*current column*] [*line ending type*] [*insert/overtype*] [*indentation type*]
| The right bar displays program/Python status, for example ``Running Python Interpreter``. 


Tool Bar
---------

A few notes on customizing the toolbar.

1. When selecting a particular icon for a toolbar item, 
   select the toolbar item from the left list ("Current List"),
   then click the "Change" button for the icon size you want.
2. If you specify an icon, this will be loaded instead of the
   default, and instead of any icon file loaded.
3. If you select an icon that is a different size than the 
   selected size (16x16, 24x24), the toolbar will not display
   correctly.


Tracebacks
-----------

Tracebacks are the output the python interpreter produces for
an unhandled exception. This output

.. code-block:: pytb

  Traceback (most recent call last):
    File "/mnt/win_e/docs/prog/drpython/drpython-3.1.2/drpython.py", line 1840, in OnGoTo
      v = int(v) - 1
  ValueError: invalid literal for int(): line number

is produced if you type "line number" into the Goto dialog.

Now, DrPython handles this exception. However DrPython 
displays tracebacks in its error dialogs (if there are any)
for the purposes of transparency. This way, if there is a 
bug it is easier to report it, and if you are working on a 
DrScript or a Plugin, this makes it easier to figure out 
what is going on.


View In Panel
--------------

View In Panel lets you view any open document (including 
the current one) in any side panel.

There are two notes.

1. Only STC shortcuts work in these panels. (The exception 
   is if the split view is of the current document).
2. If you view document 1 in document 2, then close document
   1, you need to close the panel in document 2 manually.


Notes
======

DrPython cannot handle everything.

If you create more than 100 Panels in any one direction 
(Left, Right, Top, Bottom), the events will be all messed up.

If you do not have permission to write to your user's home 
directory, or the replacement directories DrPython will try
if your home directory does not exist (eg. :file:`C:\\` or 
``os.environ["APPDATA"]``), then DrPython will not save 
preferences, and will not keep a recent files list.

If you run a program with an infinite loop, things will get 
rather slow. Hit the "End" button on the toolbar, or hit 
:kbd:`Ctrl+D` to end the program being run.

Please note that if you type the color in for the font style
dialog, any bad characters (not 0-9 or A-F) will create 
a warning the moment you enter them. If the string is not
properly formated ('#' followed by 6 characters), the 
sliders will be disabled. Upon hitting OK, any invalid 
color string will be ignored, and DrPython will revert
to the last value for that color string.