-
Notifications
You must be signed in to change notification settings - Fork 63
Home
Welcome to the py-coursera wiki!
This is a great place to collect together notes on using py-coursera.
Here's some pages we've created so far:
What's needed is some collating of the posts to the google group - for example Peter has been working through a number of issues:
QUESTIONS ISSUES FROM PETER (needs to be organized into a FAQ?)
I have the enthought package too, but how do you start then? I go to the main directory: python.exe then from pylab import * So you do it differently? HOW?
Ipython or IPython exist in several 'flavours', depending on where you got it and on which operation system you are working with.
If you installed for your system from http://www.enthought.com/ the free package including IPython you have several possibilities to start.
One nice possibility to start is using pyshell.exe (Vista) in the 'Scripts' directory of the installed epd-7.3.1 (the package from enthought).
Why? Because you can get popup-help by that window of commands you are trying to use, and configurable or direcly using the 'Options' menu in the 'shell-window'. And too, the options-menu lets you easily edit a startup-file! E.g. PKHG did this: from pylab import *
Sorry boys, all answers do no apply for a person with an (old) Vista PC. E.g. I have Ipython, and just typing pylab ==> name 'pylab' is not defined. import pylab and then dir(pylab) works So you should all understand that exact description what to do is needed.
Enthought explanation is not appropriate either
(I get pylab working more or less like it is user-friendly, but not with all that nice possibilities Ipython offers
So, finally found out:
Because of several pythons on my (Vista) Pc and of the environment variables it was difficult (now not anymore ;-)) to see why then enthought ... package did not do what it should ...
Solution: C:\epd731\Scripts>ipython.bat --pylab --colors NoColor
And probably there are configuration files and another problem on windows, at least Vista, may depend as which USER you are logged in and as which USER you installed 'Ipython' and what your environment variables look like .. and WHERE e.g. ipython.bat looks for its configuration e.g at /users/Peter/.ipython or /users/Peter/Appdata/Roaming/??? ...
Summarizing: look e.g. in "yourpython"/Scripts directory ;-)
The file as it is now in the github could not be imported, at least in my Vista. Ipython started as: C:\epd731\Scripts>ipython.bat --pylab --colors NoColor
I added at this moment in the beginning: from pylab import * , strange, --pylab not obeyed??? delete from np.Array the np and added before a=pi from math import pi #to get no error about not knowing pi ;-)
save("my_file", v) gave error too so camouflaged after a #PKHG error TODO
Got the sin-cos-picture ;-)
and then errors to be solved ...
in my ipython it is not known... Loaded it from http://www.hep.wisc.edu/~rgavin/mg2/cuts/scratch/mercurial/lib/python2.6/site-packages/IPython/lib/pylabtools.py
copy pasted the def and imported then fig1 = getfigs(1)[0] #worked and then fig1.savefig("mygraphfromIpython.png") #worked too => in my epd271 directory saved
source of getfigs had to be put in ipython_sessio.py ==> got several pictures
Problem: exit ==>error now after a # ;-)
last problem costFunctionJ.py not yet available ...
exit alone in the shell works well, thus not if used by 'importing ...' ??!!