How to install and run a script?

2014-10-12 Thread Ryan Shuell
I'm an absolute noob to Python, although I have been programming in several 
other languages for over 10 years.

I'm trying to install and run some scripts, and I'm not having much success.

I followed the steps at this site.
https://docs.python.org/2/install/

I have Python 2.7.6 Shell.

If I type this:
python setup.py install

I get this:
SyntaxError: invalid syntax


If I try this:
setup.py beautifulsoup

I get this:
SyntaxError: invalid syntax


If I got to File > Open . . . . navigate to a folder and open the setup.py file 
and hit F5 . . . . it looks like it runs, but I can't tell what it does for 
sure, and then nothing works after that.For instance, I downloaded 
something called 'Flask'.  I put that folder in my Python27 folder, and typed 
'pip install Flask' and I keep getting errors.  

Any idea how to run a simple program???
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Quick Question About Setting Up Pytz

2014-10-20 Thread Ryan Shuell
Ok, thanks everyone.  I just need to spend more time with this stuff.  It's
definitely slow going.

On Sat, Oct 18, 2014 at 11:16 PM, Rustom Mody  wrote:

> On Sunday, October 19, 2014 8:25:53 AM UTC+5:30, Ben Finney wrote:
> > Chris Angelico writes:
>
> > > Try learning Python itself, rather than playing around with extension
> > > packages like pytz.
>
> > To be fair, "You need to install 'pytz' to work correctly with date and
> > time values" is correct advice. If the OP doesn't install it early, then
> > works with timestamps, problems are inevitable -- at which point "oh, you
> > needed to do that first" will be inevitable. It's lose-lose.
>
> Yes
>
> > It's a sad fact that MS Windows has completely useless timezone support,
> > and this "install a third-party package" hurdle is a cost that is paid
> > by all people trying to set up Python on MS Windows.
>
> About MS-lacunae Ive nothing to say
>
> [Just head over to a debian list like users or vote or.. and witness the
> riot going on over systemd... Hard to believe all's right in Linux-land]
>
> As for this OP and similar problems -- yes python is in a peculiar
> position.
> Because of 'batteries included' beginners can do powerful stuff.
> However sometimes the batteries need to be supplemented.
> And then there's a problem -- its not clear whether
> - the beginner is having classic noob problems.
>   Expert just needs to tweak a command a bit and he's sailing
> - the beginner is in somewhat uncharted (research-needed) land -- charting
>   the route between mutually complementary AND competing setup tools
>
>   I believe python must be some sort of record setter in this that
> o pip is a replacement for easy_install
> o you install pip with easy_install
>
> !!
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question about PANDAS

2014-10-20 Thread Ryan Shuell
Thanks guys.  I just feel frustrated that I can't do something useful.
I'm reading all about dictionaries, and types, and touples.  Then I read
about string manipulation and loops; two of my favorite things to do.  Then
I read about logic:
-719 >= 833
False

That's great, but it's just not very useful for me.  I thought I could use
Python to do screen scraping.  Right now, I use R to do almost all my
screen scraping.  I used to use Excel, but r is just light years easier to
use, so I'll go with that.  I thought Python may be even easier to use than
R, and perhaps even more powerful too.  However, since I picked up my first
Python book about 3 months ago, I seem to be learning all kinds of useless
things, and no practical things.  When I find cool code samples online, I
can't even get them to run.  Last week I found a small sample of code that
supposedly merges data from several text files in a folder into one single
file.  I played with it for a couple hours, and never got it to work.  In
less than 15 minutes, I could have done the merging task, using Excel,
Access, VB.NET, C#.NET, or even a batch file.

I guess I'll just keep reading these books.  I have 10 books, and I'm most
of the way throguh 4 of them.  So far, none are teaching me anything that I
could use in my role managing financial assets.  Maybe something will click
soon.  I hope so.

Thanks again everyone.


On Sun, Oct 19, 2014 at 10:48 AM, Joel Goldstick 
wrote:

> On Sun, Oct 19, 2014 at 10:19 AM, Mark Lawrence 
> wrote:
> > On 18/10/2014 21:00, ryguy7272 wrote:
> >>
> >> I'm trying to install Pandas.  I went to this link.
> >> https://pypi.python.org/pypi/pandas/0.14.1/#downloads
> >>
> >> I downloaded this:  pandas-0.14.1.win32-py2.7.exe (md5)
> >> I have Python27 installed.
> >>
> >> So, I run the executable and re-run my Python script and I get the same
> >> error as before.
> >>
> >>
> >> Traceback (most recent call last):
> >>File "C:/Python27/stock_data.py", line 3, in 
> >>  import pandas as pd
> >> ImportError: No module named pandas
> >>
>
> What messages did you get when you run the installer?
> Most people use pip to install python packages
> Are you writing code and putting it in C:/Python27/ ? isn't that where
> python is installed.  You should write your code in some directory
> under your user tree.
>
>
> >> I thought I just installed it!  Isn't that what the executable is for?
> It
> >> seems like 100% of my errors are with uninstalled libraries.  I don't
> >> understand why there are so, so, so many dependencies running Python.
> Also,
> >> I don't understand why something isn't installed, right after I just
> >> installed it.
> >>
> >> Can someone please explain the logic to me?
> >>
> >> Thanks.
> >>
> >
> > Have you actually run any code from the Python tutorial yet?  You can do
> > lots of things with Python that require no third party libraries.  In
> fact
> > many questions here go "I need a solution to this that must be in the
> > stdlib".  It strikes me that you're trying to enter an Iron Man
> competition
> > before you can crawl.
> >
> > --
> > My fellow Pythonistas, ask not what our language can do for you, ask
> > what you can do for our language.
> >
> > Mark Lawrence
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> Joel Goldstick
> http://joelgoldstick.com
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list