Python Forum
What key shall i use if I want to execute this object
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What key shall i use if I want to execute this object
#1
Python_Learning_Machine is an enormous pdf. I am lost there. Maybe Wavyk, that gave me this object (not file)will tell me what key I shall use. I tried Theano without success.

my codimport theano
from theano import tensor as T

In[1]: nums = input("Write your numbers: ")
...:
Write your numbers: 3 14 5.43  723.98 65
In[2]: nums_l = [float(n) for n in nums.split()]
In[3]: nums_l
Out[3]: [3.0, 14.0, 5.43, 723.98, 65.0]
In[4]: print("Numbers: {}\nSum: {}\nAverage: {:.3f}".format(nums_l, sum(nums_l), sum(nums_l) / len(nums_l)))
Numbers: [3.0, 14.0, 5.43, 723.98, 65.0]
Sum: 811.41
Average: 162

e here
Reply
#2
(Apr-19-2017, 02:22 PM)sylas Wrote: Maybe Wavyk, that gave me this object (not file)will tell me what key I shall use. I tried Theano without success.
This is the post as reference.  
He told you that he did use IPython,you can not  use In[1] out[2] in normal script/code.
Using interactive shell for testing stuff is very common in Python.
Shell start with>>> or In[1] when doing interactive stuff.
So as code:
nums = input("Write your numbers: ")
nums_l = [float(n) for n in nums.split()]
print("Numbers: {}\nSum: {}\nAverage: {:.3f}".\
     format(nums_l, sum(nums_l), sum(nums_l) / len(nums_l)))
What you want use Theano for into this i am not sure  of.
Reply
#3
Thank you for your reply. So far I used Pycharm. For Once I wiil try vim with Python . Now unfortunately I must go in a hospital because I am sick. But I will carry with me my dear PC !
Reply
#4
(Apr-19-2017, 02:54 PM)snippsat Wrote: What you want use Theano for into this i am not sure  of.
I am too curious. Also I am curious why someone trying to learn python language would buy specialized book that assumes atleast basic proficiency in python instead of buying book that teachs python - like Learning Python (and this one is enormous with 1600+ pages, not Python Machine Learning). And there are some nice free python books/tutorials too.
Reply
#5
Thanks again, Mister Snippsat, your code is a real code, and it works very well with my Pycharm. What is easier than pyCharm.???
Reply
#6
(Apr-19-2017, 04:56 PM)sylas Wrote: What is easier than pyCharm.???
Hmm PyCharm is very good for beginner,have a lot tool for Python out of the box.
Other stuff to get used to is command line usage,if use windows cmder fine.
Learn to use REPL(interactive testing),PyCharm has a default one or can use IPython/Jupyter from PyCharm.

A light weight editor for different usage eg (web)html,css,JavaScript or other languages.
Eg Notepad++,Gedit,Kate or a little heavier AtomSublime Text these has a lot cool stuff an modern features.
What Python people use is a big personal mix of different tool,just some mention here.
Reply
#7
Probably easiest way is to edit code with your favourite text editor and run your your program (file) from command line. You mentioned that you are a vim user, vim with few options set on is a good choice to edit python code. After saving your code into a file, you can run it from command line with python3 filename (assuming that you have python3 and you are in directory where is your program file saved).
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020