Re: Question about PANDAS

2014-10-19 Thread Mark Lawrence

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

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


Re: Question about PANDAS

2014-10-19 Thread Joel Goldstick
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


Re: pyserial on freebsd 10.10 i386 [SOLVED]

2014-10-19 Thread Grant Edwards
On 2014-10-18, Nagy L?szl? Zsolt  wrote:

> Strangely, pyserial will accept the number 0, but then it tries to open 
> a device that exists on Linux only...

I'm sure Chris would be happy to accept a patch fixing that problem.

-- 
Grant


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: BASIC vs Python

2014-10-19 Thread humphreys404
On Thursday, December 16, 2004 6:36:18 PM UTC, abisofile wrote:
> hi 
> 
> I'm new to programming.I've try a little BASIC so I want ask since 
> Python is also interpreted lang if it's similar to BASIC.

Hi.
I want to know if SMALL basic is the same as/like python. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: BASIC vs Python

2014-10-19 Thread Joel Goldstick
On Sun, Oct 19, 2014 at 11:29 AM,   wrote:
> On Thursday, December 16, 2004 6:36:18 PM UTC, abisofile wrote:
>> hi
>>
>> I'm new to programming.I've try a little BASIC so I want ask since
>> Python is also interpreted lang if it's similar to BASIC.
>
> Hi.
> I want to know if SMALL basic is the same as/like python.
> --
> https://mail.python.org/mailman/listinfo/python-list

Much richer language and more modern.  Easy to learn (but you keep
learning more!)


-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: BASIC vs Python

2014-10-19 Thread Chris Angelico
On Mon, Oct 20, 2014 at 2:29 AM,   wrote:
> On Thursday, December 16, 2004 6:36:18 PM UTC, abisofile wrote:
>> hi
>>
>> I'm new to programming.I've try a little BASIC so I want ask since
>> Python is also interpreted lang if it's similar to BASIC.
>
> Hi.
> I want to know if SMALL basic is the same as/like python.

You're responding to something from ten years ago. You'll do better to
ask your own question on its own merits; a lot can happen in ten
years.

What's "SMALL basic"? (I found two languages of approximately that
name, one by Microsoft and the other hosted on sourceforge. And there
may be others.)

It won't be "the same as" Python; if it were, one language or the
other wouldn't exist. And "like Python" is a matter of degree and area
- Pike is very like Python in semantics, but very unlike Python in
syntax; REXX has a vaguely similar syntactic style, but extremely
different semantics; ECMAScript has a few similarities, though not
that many; etcetera. Are you familiar with some other language(s) and
wanting to learn Python, or familiar with Python and wanting to learn
this other language?

Just for reference, by the way: being interpreted is almost completely
non-significant. It's a feature of an implementation, not a language;
plus, pretty much every modern interpreted language is first compiled
into some kind of byte-code. (The only one I can think of that isn't
would be some forms of shell script or batch file; I do remember
editing batch files under DOS and having the changes happen live, not
sure if that's true under any of the modern Windowses.) There are
Python compilers (eg Cython), and I've seen C interpreters, so I think
that proves there's no real difference there :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pyserial on freebsd 10.10 i386 [SOLVED]

2014-10-19 Thread Mark Lawrence

On 19/10/2014 16:06, Grant Edwards wrote:

On 2014-10-18, Nagy L?szl? Zsolt  wrote:


Strangely, pyserial will accept the number 0, but then it tries to open
a device that exists on Linux only...


I'm sure Chris would be happy to accept a patch fixing that problem.



Sadly to some people a patch is a thing that mends your flat tyre or 
goes over your eye.


--
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


Re: Question about PANDAS

2014-10-19 Thread Joel Goldstick
On Sun, Oct 19, 2014 at 3:57 PM, Ryan Shuell  wrote:
>
> 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.

So you have a lot of experience with Microsoft world.  The Open Source
world is a different slant.  That might contribute to your
frustration.  I just looked up R, and I see it is for statistics,
which is something you also seem to know about.

I think there will come an 'aha' moment when python clicks for you.
Or maybe not.   Its a very well constructed language.

Good luck, though.
>
> 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
>
>



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


OS X Menubar in Tkinter

2014-10-19 Thread Noble Bell
I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code 
that they would share with me on how to remove the "Python" menu in the menubar 
at the top next to the "apple'? 

I would like to have the name of my program there instead and my menu. I can 
add menus but not sure how to do the special menubar. Any help would be 
appreciated.

NB
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OS X Menubar in Tkinter

2014-10-19 Thread Ned Deily
In article ,
 Noble Bell  wrote:
> I am using Python 3.4 on Mac OS X and Tinter 8.5. Does anyone have any code 
> that they would share with me on how to remove the "Python" menu in the 
> menubar at the top next to the "apple'? 
> 
> I would like to have the name of my program there instead and my menu. I can 
> add menus but not sure how to do the special menubar. Any help would be 
> appreciated.

The name that shows up in the menu is derived by OS X from the 
application name in the executing application bundle.  If you don't 
package your program up as an OS X application bundle, defaults will be 
used; in the case of Python OS X framework builds, Python provides a 
Python.app within the framework to allow the Python process to be 
automatically promoted to a full OS X gui process.  Probably the 
simplest approach is to use py2app to create a double-clickable app with 
the name you want.  There's an example in an answer to a similar 
question on Stackoverflow.  And there are some old but still relevant 
details documented in the Tcl/TkAqua FAQ.

https://pypi.python.org/pypi/py2app
http://stackoverflow.com/questions/8695926/remove-default-python-submenu-
with-tkinter-menu-on-mac-osx
http://wiki.tcl.tk/12987

-- 
 Ned Deily,
 [email protected]

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flush stdin

2014-10-19 Thread Marko Rauhamaa
Cameron Simpson :

> Even if nc itself does no buffering (handing data to the OS as soon as
> received, highly desirable for a tool like nc), the OS keeps a buffer
> for the pipeline between nc and python,

Yes, there is a buffer associated with the pipe, but linux/unix never
withholds any data from the reader. As soon as there is a single byte in
the pipe buffer, the reader process becomes ready to run and read(2) on
the pipe returns immediately.

> and python itself keeps a buffer for sys.stdin.

I found this comment in CPython's source code (pythonrun.c):

/* stdin is always opened in buffered mode, first because it shouldn't
   make a difference in common use cases, second because TextIOWrapper
   depends on the presence of a read1() method which only exists on
   buffered streams.
*/

The solution is to use os.read().


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Question about PANDAS

2014-10-19 Thread Rustom Mody
On Sun, Oct 19, 2014 at 3:57 PM, Ryan Shuell wrote:
>
> 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. 

You have my sympathies.

Most of what help you'll get here is 'inside-out':
Start with small toys. Work slowly towards more realistic problems

Many people (like you) would like to go the other way --
Start with trying to solve a real problem.
Handle the small nitty-gritties as they arise.

On and off Ive expressed a need in a similar direction eg

https://mail.python.org/pipermail/python-list/2011-November/615522.html
https://mail.python.org/pipermail/python-list/2011-May/603506.html
https://mail.python.org/pipermail/python-list/2011-May/603635.html

The problem with your approach is that its very system-specific

>>> [1,2]+[3,4]
[1, 2, 3, 4]

will be the same on any python. Any OS. Any version.

However installing a package will vary.
And the best way of installing will vary widely.
So its harder to help

OTOH I will say this:
Any learning requires some faith at least temporary and provisional.
If you pick up some book which purports to educate on some subject
and decide before opening it that
- subject is bogus
- author is a rogue
etc etc

you are not likely to get much out of it.¹

So it may irritate you to listen to the advice you get here to 
start baby-steps first.
However if you dont listen, you are wasting time - most of all your own.

---
¹ Of course your suspicions may be true. Thats the fun of life!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Flush stdin

2014-10-19 Thread Cameron Simpson

On 18Oct2014 18:42, Dan Stromberg  wrote:

On Sat, Oct 18, 2014 at 6:34 PM, Dan Stromberg  wrote:

Once the "nc" process actually write()s the data to its standard
output (i.e. desriptor 1, not the "stdout" FILE*)

I'm not sure why you're excluding stdout, but even if nc is using
filedes 1 instead of FILE * stdout, isn't it kind of irrelevant?


On further reflection, isn't it stdio that does the varied buffering,
and filedes 1 that's always unbuffered?  IOW, the OP might wish nc was
using 1, but it probably can't be given what they're seeing.


Traditionally, fd 1 (standard output, _generally_ associated with FILE 
*stdout), gets stdio buffering; line buffered for a terminal, block buffered 
otherwise. fd 2 (standard error, _generally_ associated with FILE *stderr) gets 
an unbuffered stdio stream by default.


However, nc may well be behaving like "tail -f": always unbuffered.

However, as I recall the OP seemed to want to "flush" the stream from nc to 
python. Even if nc itself does no buffering (handing data to the OS as soon as 
received, highly desirable for a tool like nc), the OS keeps a buffer for the 
pipeline between nc and python, and python itself keeps a buffer for sys.stdin.


Both of those are candidates for some kind of flush/discard. IF (a big IF) that 
is what the OP really needs.


Have we heard anything from the OP since this discussion took off?

I think we need to better understand his/her use case.

Cheers,
Cameron Simpson 

Do you even know anything about perl? - AC replying to Tom Christiansen post
--
https://mail.python.org/mailman/listinfo/python-list


Question about PANDAS

2014-10-19 Thread flebber
On Windows my advice would be to use the anaconda installer. Linux pip will 
work flawlessly. 

If you install anaconda full then you will have pandas as well as an ipython 
launcher installed. 

Sayth
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: OS X Menubar in Tkinter

2014-10-19 Thread Gregory Ewing

Ned Deily wrote:
The name that shows up in the menu is derived by OS X from the 
application name in the executing application bundle.


I found a hackish way to change it at run time while
working on PyGUI, but it requires using PyObjC:

  from Foundation import NSBundle

  def change_application_name(new_name):
#  Arrange for the application name to be used as the title
#  of the application menu.
ns_bundle = NSBundle.mainBundle()
  if ns_bundle:
ns_info = ns_bundle.localizedInfoDictionary()
if not ns_info:
  ns_info = ns_bundle.infoDictionary()
if ns_info:
  if ns_info['CFBundleName'] == "Python":
ns_info['CFBundleName'] = new_name

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list