rgb192
asked on
What is the shell command and what is the other program professor is commenting/uncommenting
This is a screenshot of the professor on a mac showing program-that-displays-loca ls-and-glo bals-for-e ach-functi on-on-one- screen
I have seen ide debuggers that will display current scope local and all global
but not all the variables of each local scope
And this is screenshot of me on windows selecting shell stack (but no output is generated).
how do I get to this screen, what other program/app do I open and what do I type in shell?
This is the code instructor uncomments in groups (many different code samples are here.
And then this is run in shell (I do not know shell command)
So my question is
What is the shell command and what is the other program professor is commenting/uncommenting blocks of this code:
note:
Instructor is using python 2.5 in mac
I can only install portable python 2.7 for windows7
and
portable python 3.2 for windows7
I would prefer an answer in portable python 3.2
Please do not teach me how to install non portable python because that is another question.
If This can not be done in portable python please just state: This can not be done in portable python
I have seen ide debuggers that will display current scope local and all global
but not all the variables of each local scope
And this is screenshot of me on windows selecting shell stack (but no output is generated).
how do I get to this screen, what other program/app do I open and what do I type in shell?
This is the code instructor uncomments in groups (many different code samples are here.
And then this is run in shell (I do not know shell command)
So my question is
What is the shell command and what is the other program professor is commenting/uncommenting blocks of this code:
##x = 0.5
##epsilon = 0.01
##low = 0.0
##high = x
##ans = (high + low)/2.0
##while abs(ans**2 - x) >= epsilon and ans <= x:
## print 'ans =', ans, 'low =', low, 'high =', high
## if ans**2 < x:
## low = ans
## else:
## high = ans
## ans = (high + low)/2.0
##print ans, 'is close to square root of', x
##def withinEpsilon(x, y, epsilon):
## """x,y,epsilon ints or floats. epsilon > 0.0
## returns True if x is within epsilon of y"""
## return abs(x - y) <= epsilon
##print withinEpsilon(2,3,1)
##val = withinEpsilon(2,3,0.5)
##print val
##def f(x):
## x = x + 1
## print 'x =', x
## return x
##
##x = 3
##z = f(x)
##print 'z =', z
##print 'x =', x
##def f1(x):
## def g():
## x = 'abc'
## x = x + 1
## print 'x =', x
## g()
## assert False
## return x
##x = 3
##z = f1(x)
##def isEven(i):
## """assumes i a positive int
## returns True if i is even, otherwise False"""
## return i%2 == 0
##def findRoot(pwr, val, epsilon):
## """assumes pwr an int; val, epsilon floats
## pwr and epsilon > 0
## if it exists,
## returns a value within epsilon of val**pwr
## otherwise returns None"""
## assert type(pwr) == int and type(val) == float\
## and type(epsilon) == float
## assert pwr > 0 and epsilon > 0
## if isEven(pwr) and val < 0:
## return None
## low = -abs(val)
## high = max(abs(val), 1.0)
## ans = (high + low)/2.0
## while not withinEpsilon(ans**pwr, val, epsilon):
## #print 'ans =', ans, 'low =', low, 'high =', high
## if ans**pwr < val:
## low = ans
## else:
## high = ans
## ans = (high + low)/2.0
## return ans
##def testFindRoot():
## """x float, epsilon float, pwr positive int"""
## for x in (-1.0, 1.0, 3456.0):
## for pwr in (1, 2, 3):
## ans = findRoot(pwr, x, 0.001)
## if ans == None:
## print 'The answer is imaginary'
## else:
## print ans, 'to the power', pwr,\
## 'is close to', x
#testFindRoot()
##sumDigits = 0
##for c in str(1952):
## sumDigits += int(c)
##print sumDigits
##x = 100
##divisors = ()
##for i in range(1, x):
## if x%i == 0:
## divisors = divisors + (i,)
##
##print divisors
##print divisors[0] + divisors[1]
##print divisors[2:4]
note:
Instructor is using python 2.5 in mac
I can only install portable python 2.7 for windows7
and
portable python 3.2 for windows7
I would prefer an answer in portable python 3.2
Please do not teach me how to install non portable python because that is another question.
If This can not be done in portable python please just state: This can not be done in portable python
You don't click any of them. You are running a shell command in a command window, remember?
You need to have a file with all the commented blocks of code. Let's say you call that professor.py. Then make a copy of that file, in which you un-comment a block, say lines 15 - 22 which is the second example (define a function and call it). Let's say you call that file ex2.py.
You need to ensure that python and possibly Potable-Python are available from a cmd.exe window (the folders containing them must be in the PATH). Now you should see something like the following when you type python ex2.exe
The first example (lines 1 - 13) has a bug in it. It goes into a loop when trying to find the square root of a number < 1.0. You can stop it looping by changing "<=" in line 6 to "<" so line 6 reads
The problem is that for numbers < 1.0, the square root is > than the number. I threw this code together to fix that
You need to have a file with all the commented blocks of code. Let's say you call that professor.py. Then make a copy of that file, in which you un-comment a block, say lines 15 - 22 which is the second example (define a function and call it). Let's say you call that file ex2.py.
You need to ensure that python and possibly Potable-Python are available from a cmd.exe window (the folders containing them must be in the PATH). Now you should see something like the following when you type python ex2.exe
C:\Users\rgb192>python ex2.exe
True
False
It may work to type Potable-Python ex2.exe but I don't have Potable-Python to try.The first example (lines 1 - 13) has a bug in it. It goes into a loop when trying to find the square root of a number < 1.0. You can stop it looping by changing "<=" in line 6 to "<" so line 6 reads
while abs(ans**2 - x) >= epsilon and ans < x:
but the program still wrongly returns x (=0.5) as the result.The problem is that for numbers < 1.0, the square root is > than the number. I threw this code together to fix that
x = 0.5
epsilon = 0.01
if x >= 1.0:
low = 0.0
high = x
ans = (high + low)/2.0
while abs(ans**2 - x) >= epsilon and ans <= x:
print 'ans =', ans, 'low =', low, 'high =', high
if ans**2 < x:
low = ans
else:
high = ans
ans = (high + low)/2.0
else:
low = x
high = 1.0
ans = (high + low)/2.0
while abs(ans**2 - x) >= epsilon and ans > x:
print 'ans =', ans, 'low =', low, 'high =', high
if ans**2 < x:
low = ans
else:
high = ans
ans = (high + low)/2.0
print ans, 'is close to square root of', x
ASKER
this is how I opened python exe window
(I think I could have clicked on an icon)
now that the window is open I tried running your code
https://www.experts-exchange.com/viewCodeSnippet.jsp?refID=40182209&rtid=20&icsi=3
saved as c:\users\acer\documents\po rtable-pyt hon\ex2.py
(I think I could have clicked on an icon)
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd ../
C:\Windows>cd ..
C:\>cd users/acer/libraries/documents/portable-python
The system cannot find the path specified.
C:\>cd users
C:\Users>cd acer
C:\Users\Acer>cd libraries
The system cannot find the path specified.
C:\Users\Acer>cd documents
C:\Users\Acer\Documents>cd portable-python
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.51"
The system cannot find the path specified.
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.5.1"
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>python-portable.
exe
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>
now that the window is open I tried running your code
https://www.experts-exchange.com/viewCodeSnippet.jsp?refID=40182209&rtid=20&icsi=3
saved as c:\users\acer\documents\po
Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
Portable Python >>> ls
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ls' is not defined
Portable Python >>> cd ..
File "<stdin>", line 1
cd ..
^
SyntaxError: invalid syntax
Portable Python >>> c:\users\acer\documents\portable-python\ex2.py
File "<stdin>", line 1
c:\users\acer\documents\portable-python\ex2.py
^
SyntaxError: invalid syntax
Portable Python >>>
Your first window looks OK, except that you didn't realize you need to separate pathname components with a back-slash, ("\") so you had to cd to each component individually.
Then you erred by invoking Python-Portable without any arguments, when I meant for you to give it ex2.py as an argument. When invoked with no arguments, (it looks to me like) Python-Portable expects you to type in lines of python code - that is what regular python.exe would do. Here's what I would try (from cmd.exe)
Then you erred by invoking Python-Portable without any arguments, when I meant for you to give it ex2.py as an argument. When invoked with no arguments, (it looks to me like) Python-Portable expects you to type in lines of python code - that is what regular python.exe would do. Here's what I would try (from cmd.exe)
cd C:\users\acer\documents\portable-python
Python-Portable ex2.py
ASKER
cd C:\users\acer\documents\portable-python
Python-Portable ex2.py
same .exe file opens but then closes in 2 seconds
So quick I can not see output
This should work then
cd "C:\users\acer\documents\portable-python\Portable Python 2.7.2.1\App"
python ..\..\ex2.py
ASKER
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd ../
C:\Windows>cd ..
C:\>cd users/acer/libraries/documents/portable-python
The system cannot find the path specified.
C:\>cd users
C:\Users>cd acer
C:\Users\Acer>cd libraries
The system cannot find the path specified.
C:\Users\Acer>cd documents
C:\Users\Acer\Documents>cd portable-python
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.51"
The system cannot find the path specified.
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.5.1"
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>python-portable.
exe
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>python-portable.
exe ex2.py
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>cd ..
C:\Users\Acer\Documents\portable-python>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python
07/07/2014 06:43 PM <DIR> .
07/07/2014 06:43 PM <DIR> ..
07/07/2014 12:59 PM <DIR> BAD-Portable Python 3.2.5.1
07/09/2014 03:19 PM <DIR> myfiles
07/07/2014 12:59 PM <DIR> Portable Python 2.7.2.1
07/07/2014 06:40 PM <DIR> Portable Python 3.2.1.1
07/09/2014 02:28 AM <DIR> Portable Python 3.2.5.1
0 File(s) 0 bytes
7 Dir(s) 5,831,065,600 bytes free
C:\Users\Acer\Documents\portable-python>cd "portable python 2.7.2.1"
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>python ..\..\ex2
.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>
You missed out cd App before running python ..\..\ex2.py
ASKER
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd ../
C:\Windows>cd ..
C:\>cd users/acer/libraries/documents/portable-python
The system cannot find the path specified.
C:\>cd users
C:\Users>cd acer
C:\Users\Acer>cd libraries
The system cannot find the path specified.
C:\Users\Acer>cd documents
C:\Users\Acer\Documents>cd portable-python
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.51"
The system cannot find the path specified.
C:\Users\Acer\Documents\portable-python>cd "portable python 3.2.5.1"
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>python-portable.
exe
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>python-portable.
exe ex2.py
C:\Users\Acer\Documents\portable-python\Portable Python 3.2.5.1>cd ..
C:\Users\Acer\Documents\portable-python>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python
07/07/2014 06:43 PM <DIR> .
07/07/2014 06:43 PM <DIR> ..
07/07/2014 12:59 PM <DIR> BAD-Portable Python 3.2.5.1
07/09/2014 03:19 PM <DIR> myfiles
07/07/2014 12:59 PM <DIR> Portable Python 2.7.2.1
07/07/2014 06:40 PM <DIR> Portable Python 3.2.1.1
07/09/2014 02:28 AM <DIR> Portable Python 3.2.5.1
0 File(s) 0 bytes
7 Dir(s) 5,831,065,600 bytes free
C:\Users\Acer\Documents\portable-python>cd "portable python 2.7.2.1"
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>python ..\..\ex2
.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>cd app
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>cd "portable
python 2.7.2.1"
The system cannot find the path specified.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\Ap
p
07/07/2014 12:59 PM <DIR> .
07/07/2014 12:59 PM <DIR> ..
07/03/2014 10:08 AM <DIR> DLLs
07/03/2014 10:08 AM <DIR> Doc
07/03/2014 10:08 AM <DIR> include
07/03/2014 10:16 AM <DIR> Lib
07/03/2014 10:08 AM <DIR> libs
06/12/2011 04:13 PM 40,080 LICENSE.txt
07/03/2014 10:15 AM <DIR> locale
11/06/2007 01:24 PM 524 Microsoft.VC90.CRT.manifest
07/03/2014 07:05 PM 602 module1.py
06/23/2011 12:28 AM 225,280 msvcm90.dll
06/23/2011 12:28 AM 569,680 msvcp90.dll
06/23/2011 12:28 AM 653,136 msvcr90.dll
06/12/2011 03:22 PM 285,115 NEWS.txt
04/01/2008 04:40 PM 7,886 PyProject.ico
12/14/2010 07:28 AM 1,518,245 PyScripter.chm
12/14/2010 07:21 AM 7,339,520 PyScripter.exe
07/07/2014 06:39 PM 81,750 PyScripter.ini
07/03/2011 12:37 PM 622,592 python-2.7.2.msi
06/12/2011 04:09 PM 26,624 python.exe
06/12/2011 04:09 PM 2,206,720 python27.dll
02/26/2011 07:02 PM 354,304 pythoncom27.dll
02/26/2011 07:10 PM 8,192 pythoncomloader27.dll
06/12/2011 04:06 PM 27,136 pythonw.exe
02/27/2011 05:13 PM 110,080 pywintypes27.dll
05/30/2011 06:53 AM 54,967 README.txt
02/27/2011 03:44 PM 1,997 remserver.py
07/03/2014 10:08 AM <DIR> Scripts
07/03/2014 10:15 AM <DIR> Skins
07/03/2014 10:09 AM <DIR> tcl
07/03/2014 10:08 AM <DIR> Tools
11/28/2007 05:32 PM 258,352 unicows.dll
06/12/2011 04:05 PM 49,664 w9xpopen.exe
22 File(s) 14,442,446 bytes
12 Dir(s) 107,462,656 bytes free
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>python ..\..
\ex2.py
python: can't open file '..\..\ex2.py': [Errno 2] No such file or directory
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>cd ../..
C:\Users\Acer\Documents\portable-python>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python
07/07/2014 06:43 PM <DIR> .
07/07/2014 06:43 PM <DIR> ..
07/07/2014 12:59 PM <DIR> BAD-Portable Python 3.2.5.1
07/16/2014 12:04 PM <DIR> myfiles
07/07/2014 12:59 PM <DIR> Portable Python 2.7.2.1
07/07/2014 06:40 PM <DIR> Portable Python 3.2.1.1
07/14/2014 05:56 PM <DIR> Portable Python 3.2.5.1
0 File(s) 0 bytes
7 Dir(s) 106,594,304 bytes free
C:\Users\Acer\Documents\portable-python>cd myfiles
C:\Users\Acer\Documents\portable-python\myfiles>python ex2.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\myfiles>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python\myfiles
07/16/2014 12:04 PM <DIR> .
07/16/2014 12:04 PM <DIR> ..
07/07/2014 11:45 AM 914 3-EDIT.py
07/03/2014 11:23 PM 111 3.4.py
07/03/2014 11:39 PM 244 3.5.py
07/04/2014 11:20 PM 619 4.1.1.py
07/04/2014 11:30 PM 640 4.1.2.py
07/04/2014 11:41 PM 132 4.1.3.py
07/05/2014 12:12 AM 254 4.1.4.py
07/05/2014 02:24 PM 1,000 4.2.py
07/05/2014 07:07 PM 255 4.3.1.py
07/05/2014 07:28 PM 497 4.3.2.py
07/05/2014 07:36 PM 849 4.3.3.py
07/05/2014 07:56 PM 384 4.4.py
07/05/2014 08:22 PM 124 4.5.py
07/05/2014 08:45 PM 199 4.6.2.py
07/05/2014 08:32 PM 132 4.6.py
07/05/2014 02:45 PM 1,018 4.kaufmed.py
07/07/2014 11:32 AM 2,354 5-all.py
07/07/2014 11:32 AM 914 5-lists.py
07/07/2014 11:32 AM 424 5.0.1.py
07/07/2014 11:32 AM 543 5.1.py
07/07/2014 11:32 AM 70 5.2.py
07/05/2014 08:20 PM 228 circle.py
07/07/2014 11:32 AM 184 code5.1.py
07/08/2014 06:37 PM 663 ex2.py
07/03/2014 11:15 PM 347 for-loop.py
07/13/2014 10:31 PM 3,377 gtp-structshape.py
07/07/2014 07:23 PM 74 gtp10.10.py
07/07/2014 07:54 PM 81 gtp10.11.py
07/07/2014 07:59 PM 104 gtp10.12.py
07/07/2014 08:24 PM 154 gtp10.12b.py
07/07/2014 07:44 PM 102 gtp10.8.py
07/07/2014 10:39 PM 206 gtp11.2.py
07/08/2014 06:29 PM 586 gtp11.3.py
07/08/2014 07:46 PM 599 gtp11.4.py
07/08/2014 08:02 PM 180 gtp11.5.py
07/09/2014 01:40 AM 313 gtp11.6.py
07/07/2014 09:04 PM 130 gtp11.py
07/11/2014 01:28 AM 711 gtp12.1.py
07/11/2014 01:48 AM 699 gtp12.1b.py
07/12/2014 09:59 PM 695 gtp12.1c.py
07/12/2014 10:27 PM 664 gtp12.5.py
07/13/2014 09:25 PM 523 gtp12.6.py
07/13/2014 10:14 PM 653 gtp12.7.py
07/14/2014 10:55 PM 261 gtp12.9.py
07/09/2014 01:03 PM 184 gtp12.py
07/07/2014 11:32 AM 114 gtp4.9.py
07/06/2014 09:00 PM 213 gtp6.4.py
07/07/2014 11:32 AM 161 gtp6.py
07/07/2014 11:32 AM 142 gtp8.4.py
07/07/2014 11:32 AM 155 gtp9.4.1.py
07/06/2014 11:17 PM 139 gtp9.4.py
07/05/2014 08:45 PM 50 kids
07/16/2014 12:04 PM 5,449 letters.py
07/09/2014 03:19 PM 537 loop-over-globals.py
07/14/2014 10:27 PM 3,377 structshape.py
07/14/2014 10:27 PM <DIR> __pycache__
55 File(s) 33,732 bytes
3 Dir(s) 106,414,080 bytes free
C:\Users\Acer\Documents\portable-python\myfiles>cd ..
C:\Users\Acer\Documents\portable-python>cd
C:\Users\Acer\Documents\portable-python
C:\Users\Acer\Documents\portable-python>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python
07/07/2014 06:43 PM <DIR> .
07/07/2014 06:43 PM <DIR> ..
07/07/2014 12:59 PM <DIR> BAD-Portable Python 3.2.5.1
07/16/2014 12:04 PM <DIR> myfiles
07/07/2014 12:59 PM <DIR> Portable Python 2.7.2.1
07/07/2014 06:40 PM <DIR> Portable Python 3.2.1.1
07/14/2014 05:56 PM <DIR> Portable Python 3.2.5.1
0 File(s) 0 bytes
7 Dir(s) 106,352,640 bytes free
C:\Users\Acer\Documents\portable-python>cd "portable python 2.7.2.1"
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>cd app
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>python ..\..
\myfiles\ex2.py
('ans =', 0.75, 'low =', 0.5, 'high =', 1.0)
('ans =', 0.625, 'low =', 0.5, 'high =', 0.75)
('ans =', 0.6875, 'low =', 0.625, 'high =', 0.75)
('ans =', 0.71875, 'low =', 0.6875, 'high =', 0.75)
(0.703125, 'is close to square root of', 0.5)
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>
so now I can do commands using cmd.exe
I think this is how to see the stack (This screenshot is from my windows computer, not from the instructor)
Is this file allowed? because picture is gone from my original question
now how can I see a stack viewer of all stacks open and closed
like the photo in the question
http://filedb.experts-exchange.com/incoming/2014/07_w27/800_859299/program-that-displays-locals-and-globals
I do not recognize that debugger. I tried winpdb - quite liked it
ASKER
https://code.google.com/p/winpdb/downloads/list
where do I put the folder
where do I put the folder
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>cd ../../users/acer/documents/portable-python
C:\Users\Acer\Documents\portable-python>cd "portable python 2.7.2.1"
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1>cd app/scripts
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>easy
_install swampy
Searching for swampy
Reading http://pypi.python.org/simple/swampy/
Best match: swampy 2.1.7
Downloading https://pypi.python.org/packages/source/s/swampy/swampy-2.1.7.zip#md
5=690d64aabce9280dc0370c1103eb184e
Processing swampy-2.1.7.zip
Running swampy-2.1.7\setup.py -q bdist_egg --dist-dir c:\users\acer\appdata\loca
l\temp\easy_install-qsprfx\swampy-2.1.7\egg-dist-tmp-2zvwct
zip_safe flag not set; analyzing archive contents...
swampy.Lumpy: module MAY be using inspect.stack
Adding swampy 2.1.7 to easy-install.pth file
Installed c:\users\acer\documents\portable-python\portable python 2.7.2.1\app\li
b\site-packages\swampy-2.1.7-py2.7.egg
Processing dependencies for swampy
Finished processing dependencies for swampy
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>easy
_install pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Best match: pip 1.5.6
Downloading https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz#md5=0
1026f87978932060cc86c1dc527903e
Processing pip-1.5.6.tar.gz
Running pip-1.5.6\setup.py -q bdist_egg --dist-dir c:\users\acer\appdata\local\t
emp\easy_install-iozmqz\pip-1.5.6\egg-dist-tmp-yvretq
warning: no files found matching 'pip\cacert.pem'
warning: no files found matching '*.html' under directory 'docs'
warning: no previously-included files matching '*.rst' found under directory 'do
cs\_build'
no previously-included directories found matching 'docs\_build\_sources'
Adding pip 1.5.6 to easy-install.pth file
Installing pip-script.py script to C:\Users\Acer\Documents\portable-python\Porta
ble Python 2.7.2.1\App\Scripts
Installing pip.exe script to C:\Users\Acer\Documents\portable-python\Portable Py
thon 2.7.2.1\App\Scripts
Installing pip.exe.manifest script to C:\Users\Acer\Documents\portable-python\Po
rtable Python 2.7.2.1\App\Scripts
Installing pip2.7-script.py script to C:\Users\Acer\Documents\portable-python\Po
rtable Python 2.7.2.1\App\Scripts
Installing pip2.7.exe script to C:\Users\Acer\Documents\portable-python\Portable
Python 2.7.2.1\App\Scripts
Installing pip2.7.exe.manifest script to C:\Users\Acer\Documents\portable-python
\Portable Python 2.7.2.1\App\Scripts
Installing pip2-script.py script to C:\Users\Acer\Documents\portable-python\Port
able Python 2.7.2.1\App\Scripts
Installing pip2.exe script to C:\Users\Acer\Documents\portable-python\Portable P
ython 2.7.2.1\App\Scripts
Installing pip2.exe.manifest script to C:\Users\Acer\Documents\portable-python\P
ortable Python 2.7.2.1\App\Scripts
Installed c:\users\acer\documents\portable-python\portable python 2.7.2.1\app\li
b\site-packages\pip-1.5.6-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>pyth
on setup.py install
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\Ap
p\Scripts
07/16/2014 08:59 PM <DIR> .
07/16/2014 08:59 PM <DIR> ..
07/07/2010 09:28 PM 286 easy_install-2.7-script.py
07/07/2010 09:28 PM 7,168 easy_install-2.7.exe
07/07/2010 09:28 PM 515 easy_install-2.7.exe.manifest
07/07/2010 09:28 PM 278 easy_install-script.py
07/07/2010 09:28 PM 7,168 easy_install.exe
07/07/2010 09:28 PM 511 easy_install.exe.manifest
07/16/2014 08:59 PM 315 pip-script.py
07/16/2014 08:59 PM 7,168 pip.exe
07/16/2014 08:59 PM 518 pip.exe.manifest
07/16/2014 08:59 PM 317 pip2-script.py
07/16/2014 08:59 PM 321 pip2.7-script.py
07/16/2014 08:59 PM 7,168 pip2.7.exe
07/16/2014 08:59 PM 521 pip2.7.exe.manifest
07/16/2014 08:59 PM 7,168 pip2.exe
07/16/2014 08:59 PM 519 pip2.exe.manifest
15 File(s) 39,941 bytes
2 Dir(s) 115,896,320 bytes free
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>cd .
.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>dir
Volume in drive C is ACER
Volume Serial Number is A4DC-28C4
Directory of C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\Ap
p
07/07/2014 12:59 PM <DIR> .
07/07/2014 12:59 PM <DIR> ..
07/03/2014 10:08 AM <DIR> DLLs
07/03/2014 10:08 AM <DIR> Doc
07/03/2014 10:08 AM <DIR> include
07/16/2014 08:59 PM <DIR> Lib
07/03/2014 10:08 AM <DIR> libs
06/12/2011 04:13 PM 40,080 LICENSE.txt
07/03/2014 10:15 AM <DIR> locale
11/06/2007 01:24 PM 524 Microsoft.VC90.CRT.manifest
07/03/2014 07:05 PM 602 module1.py
06/23/2011 12:28 AM 225,280 msvcm90.dll
06/23/2011 12:28 AM 569,680 msvcp90.dll
06/23/2011 12:28 AM 653,136 msvcr90.dll
06/12/2011 03:22 PM 285,115 NEWS.txt
04/01/2008 04:40 PM 7,886 PyProject.ico
12/14/2010 07:28 AM 1,518,245 PyScripter.chm
12/14/2010 07:21 AM 7,339,520 PyScripter.exe
07/07/2014 06:39 PM 81,750 PyScripter.ini
07/03/2011 12:37 PM 622,592 python-2.7.2.msi
06/12/2011 04:09 PM 26,624 python.exe
06/12/2011 04:09 PM 2,206,720 python27.dll
02/26/2011 07:02 PM 354,304 pythoncom27.dll
02/26/2011 07:10 PM 8,192 pythoncomloader27.dll
06/12/2011 04:06 PM 27,136 pythonw.exe
02/27/2011 05:13 PM 110,080 pywintypes27.dll
05/30/2011 06:53 AM 54,967 README.txt
02/27/2011 03:44 PM 1,997 remserver.py
07/16/2014 08:59 PM <DIR> Scripts
07/03/2014 10:15 AM <DIR> Skins
07/03/2014 10:09 AM <DIR> tcl
07/03/2014 10:08 AM <DIR> Tools
11/28/2007 05:32 PM 258,352 unicows.dll
06/12/2011 04:05 PM 49,664 w9xpopen.exe
22 File(s) 14,442,446 bytes
12 Dir(s) 115,896,320 bytes free
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>python setup
.py install
python: can't open file 'setup.py': [Errno 2] No such file or directory
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App>
What does swampy have to do with your original question?
Your installation of Python so far is exceptionally messy. I think your best bet might be to run the install command when your working directory is C:\Users\Acer\Documents\po rtable-pyt hon\Portab le Python 2.7.2.1\App
Also if you Google for swampy [linux] you get a lot of articles about how to install swampy.
Did you know you can select and paste into a CMD.EXE window? You have to turn on fast-edit first: right-click in the taskbar, then Properties/Options and check the box. Make it the default as well.
Once fast-edit is enabled, right click pastes the clipboard. To put a line on the clipboard, swipe the line (it will highlight) then press Enter.
Your installation of Python so far is exceptionally messy. I think your best bet might be to run the install command when your working directory is C:\Users\Acer\Documents\po
Also if you Google for swampy [linux] you get a lot of articles about how to install swampy.
Did you know you can select and paste into a CMD.EXE window? You have to turn on fast-edit first: right-click in the taskbar, then Properties/Options and check the box. Make it the default as well.
Once fast-edit is enabled, right click pastes the clipboard. To put a line on the clipboard, swipe the line (it will highlight) then press Enter.
ASKER
You really ought to think about installing Python using your distribution's package manager.
To persevere with your current setup: yes, unpack the zip or tar.gz file in the app directory, then follow the instructions in README.txt
To persevere with your current setup: yes, unpack the zip or tar.gz file in the app directory, then follow the instructions in README.txt
ASKER
distribution's package manager.what is this?
persevere with your current setupthere is no boss telling me that the old data has value and this is production not development.
I can start fresh
what is this?
Sorry that's a Linux term - I forgot you had Windows. But there is an official python distribution for Windows.
Portable Python is itself a distribution of sorts, so you can stick with it if you like. It already contains wxPython, which winpdb requires for its GUI, so you're in front there. If you could put C:\Users\Acer\Documents\po rtable-pyt hon\Portab le Python 2.7.2.1\App in the PATH, then you could install winpdb from anywhere (and run Python programs anywhere)
Sorry that's a Linux term - I forgot you had Windows. But there is an official python distribution for Windows.
Portable Python is itself a distribution of sorts, so you can stick with it if you like. It already contains wxPython, which winpdb requires for its GUI, so you're in front there. If you could put C:\Users\Acer\Documents\po
ASKER
but if I do not want to put it in my path
(because I am working on fixing errors of non portable python installation)
1. what folder should I put the downloaded from the internet file
2. what folder should I type easy_install $x
3. should I type easy_install winpdb?
(because I am working on fixing errors of non portable python installation)
1. what folder should I put the downloaded from the internet file
2. what folder should I type easy_install $x
3. should I type easy_install winpdb?
1. I suggest you make a downloads folder (e.g. "C:\users\acer\documents\po rtable-pyt hon\Portab le Python 2.7.2.1\App\downloads" and put the files you download there.
2. In your Scripts directory, as you did previously. Otherwise your system will not find the easy_install command.
3. It can do no harm to try. But I think easy_install only searches python.org so will not find winpdb. If so, download winpdb yourself. If you don't put App in the PATH, you will have to move all the files you unpack from it to App. Then follow the instructions in the readme
2. In your Scripts directory, as you did previously. Otherwise your system will not find the easy_install command.
3. It can do no harm to try. But I think easy_install only searches python.org so will not find winpdb. If so, download winpdb yourself. If you don't put App in the PATH, you will have to move all the files you unpack from it to App. Then follow the instructions in the readme
ASKER
no need to download file winp_db
what do I do now
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>easy
_install winpdb
Searching for winpdb
Reading http://pypi.python.org/simple/winpdb/
Best match: winpdb 1.4.8
Downloading http://winpdb.googlecode.com/files/winpdb-1.4.8.tar.gz
Processing winpdb-1.4.8.tar.gz
Running winpdb-1.4.8\setup.py -q bdist_egg --dist-dir c:\users\acer\appdata\loca
l\temp\easy_install-oqgovn\winpdb-1.4.8\egg-dist-tmp-fu0vgg
copying winpdb -> winpdb_.pyw
zip_safe flag not set; analyzing archive contents...
rpdb2: module references __file__
winpdb: module references __file__
Adding winpdb 1.4.8 to easy-install.pth file
Installing rpdb2.bat script to C:\Users\Acer\Documents\portable-python\Portable
Python 2.7.2.1\App\Scripts
Installing winpdb.bat script to C:\Users\Acer\Documents\portable-python\Portable
Python 2.7.2.1\App\Scripts
Installing winpdb_.pyw script to C:\Users\Acer\Documents\portable-python\Portabl
e Python 2.7.2.1\App\Scripts
Installing winpdb_inst.py script to C:\Users\Acer\Documents\portable-python\Port
able Python 2.7.2.1\App\Scripts
Installed c:\users\acer\documents\portable-python\portable python 2.7.2.1\app\li
b\site-packages\winpdb-1.4.8-py2.7.egg
Processing dependencies for winpdb
Finished processing dependencies for winpdb
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>
what do I do now
Locate where the installer has put the winpdb command. It might be in the App directory along with python.exe, or it might be somewhere along your PATH and reference the App directory in its first line. If you don't see it in the App directory, try entering winpdb in your cmd.exe window and see if that does anything.
Once you can start winpdb, you can debug python programs by e.g. winpdb any_file.py
Once you can start winpdb, you can debug python programs by e.g. winpdb any_file.py
ASKER
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>winp
db
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>winp
db ../../../myfiles 3.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>winp
db ../../../myfiles 3.4.py
'python' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Acer\Documents\portable-python\Portable Python 2.7.2.1\App\Scripts>
and I can not find winpdb in this directory
because I am using a portable installation, I have not modified path
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I can not find exe file to open winpdb, .bat does not open
when winpdb is open
http://filedb.experts-exchange.com/incoming/2014/07_w27/859302/stack-frame.JPG
I should see more information about the stack frame, like all the methods in this question's first youtube screenshot
winpdb-has-a-stack-frame-b ut-not-a-s tack-frame -with-info rmation-ab out-method s.JPG
and at most there are only 3 items on stack frame where the picture of my other experts exchange question has 7
when winpdb is open
http://filedb.experts-exchange.com/incoming/2014/07_w27/859302/stack-frame.JPG
Global: Defined f. Current scope: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'f', 'pyscripter']
Global: Defined x. Current scope: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'f', 'pyscripter', 'x']
Entered f. Current scope: ['x']
Defined g. Current scope: ['g', 'x']
Defined h. Current scope: ['g', 'h', 'x']
Incremented x. Current scope: ['g', 'h', 'x']
x = 4
Entered h. Current scope: ['x']
Defined z. Current scope: ['x', 'z']
z = 4
Returned from h. Current scope: ['g', 'h', 'x']
Entered g. Current scope: []
Defined x. Current scope: ['x']
x = abc
Returned from g. Current scope: ['g', 'h', 'x']
x = 4
Global: Defined z. Current scope: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'f', 'pyscripter', 'x', 'z']
Global: x = 3
Global: z = <function g at 0x02E26540>
Entered g. Current scope: []
Defined x. Current scope: ['x']
x = abc
Global: Returned from z. Current scope: ['__builtins__', '__doc__', '__file__', '__name__', '__package__', 'f', 'pyscripter', 'x', 'z']
I should see more information about the stack frame, like all the methods in this question's first youtube screenshot
winpdb-has-a-stack-frame-b
and at most there are only 3 items on stack frame where the picture of my other experts exchange question has 7
ASKER
yes this was correct answer to see all the variables in each method
thanks.
thanks.
The shell command before the commented code is python