Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread Alan Gauld

On 31/12/14 13:49, Tammy Miller wrote:


I need help on the
following:  I have a created a project from a csv file to calculate the
mean and standard deviation.


I assume that means you read the data from the CSV file
and display the stats?


However, I would like to
create a drop-down list and display the mean and standard deviation?


I assume you mean you want to create a GUI that has a "drop down list" 
containing data and you want to display the stats based on the list 
contents?


If so you need to decide what kind of UI you want to use.
Your choices are:
1) CLI using curses (Not on windows)
2) Web UI based on HTML/Javascript
3) Desktop GUI using Tkinter/WxPython/PyGTK
   (or some other toolkit)

And once you decide your option you need to design what the UI
looks like - how does the output appear? Is it in a label? a text 
widget? a pop-up dialog?



Is there a module for that?


Yes, for all of the above.

Option 1 uses the curses module

Option 2 uses standard HTML linked to a CGI(standard library)
or a web framework(several third-party options)

Option 3: the standard library includes Tkinter,
the others are third-party downloads.

We can't help much until you make the choices above.
It will help if you tell us which python version and
which OS you use.

And once you choose an option which tookkit you want
to go with (or at least which option and we can advise
on toolkits based on your experience and your UI visual
design)

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python drop-down list options

2014-12-31 Thread WolfRage
What is the user interface that your program is using, currently? IE: 
QT, GTK, Tkinter, Curses, Kivy, Pygame, Or None?

What is the target system on which your program runs?
How are you currently viewing the mean and standard deviation results?
What version of Python are you using and what is your OS?

On 12/31/2014 08:49 AM, Tammy Miller wrote:

Hello All,

  


I need help on the
following:  I have a created a project from a csv file to calculate the
mean and standard deviation.

However, I would like to
create a drop-down list and display the mean and standard deviation?  Is there 
a module
for that?

  


Thank you,

  


Tammy

  

  

  

  



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Help on Python drop-down list options

2014-12-31 Thread Tammy Miller
Hello All, 

 

I need help on the
following:  I have a created a project from a csv file to calculate the
mean and standard deviation. 

However, I would like to
create a drop-down list and display the mean and standard deviation?  Is there 
a module
for that?

 

Thank you, 

 

Tammy 

 

 

 

 

  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python

2013-04-15 Thread Danny Yoo
For example, see: http://nltk.org.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python

2013-04-15 Thread Alan Gauld

On 15/04/13 09:54, Jabesa Daba wrote:

is it possible to reorder a sentence in the form of SVO (Subject Verb
Object) into the form of SOV (Subject Object Verb) by using a python
program? if so, how?


Python is a general purpose programming language so yes, you can program 
it to do any computational task. How much work is involved depends on 
how well you can define the algorithm and whether somebody else has 
already implemented it for you in Python.


In your case you need to consider which language you are processing and 
what the grammatical rules are (what is a word? How do you identify a 
subject, object and verb? What are the separator rules and do you need 
to consider changes of endings etc when you change order? etc)

Just how sophisticated does it need to be?)

There are several libraries that can help ranging from general
purpose text processing and parsers to natural language tookits.
Whatever you use you will still need a fair amount of effort
to get it working. Google (or any other search engine!) is your
friend.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python

2013-04-15 Thread Mark Lawrence

On 15/04/2013 09:54, Jabesa Daba wrote:

is it possible to reorder a sentence in the form of SVO (Subject Verb
Object) into the form of SOV (Subject Object Verb) by using a python
program? if so, how?

regards,



Yes.  By writing code.

You could have answered your own question by typing something like 
"python natural language processing" into your favourite search engine.


--
If you're using GoogleCrap™ please read this 
http://wiki.python.org/moin/GoogleGroupsPython.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Help on python

2013-04-15 Thread Jabesa Daba
is it possible to reorder a sentence in the form of SVO (Subject Verb
Object) into the form of SOV (Subject Object Verb) by using a python
program? if so, how?

regards,
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Dave Angel

On 02/24/2011 11:55 AM, Walter Prins wrote:

On 24 February 2011 16:22, Dave Angel  wrote:



(Is there a reason you double-spaced all that code?  It makes it very hard
to read, and quite difficult to quote, since I had to delete every other
line.)



For what it's worth the code came out perfectly fine on my email reader
(GMail). (No double spacing, courier formatted, all in all pretty easy to
read. What email client are you using?)

Walter



I use Thunderbird 3.1.7 on Linux 10.04.  In text mode, naturally, but I 
get the same result in html mode.


The prose was properly spaced, and everyone else's messagesare properly 
spaced.  But the code in that particular message was double-spaced.



DaveA
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 16:22, Dave Angel  wrote:

>
> (Is there a reason you double-spaced all that code?  It makes it very hard
> to read, and quite difficult to quote, since I had to delete every other
> line.)
>

For what it's worth the code came out perfectly fine on my email reader
(GMail). (No double spacing, courier formatted, all in all pretty easy to
read. What email client are you using?)

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread pyhx0r
Dear All,

Thank you for your advise, it's helpful for me.

NB: To DaveA, It was copy-paste from my notepad so the indentation went
wrong :(


+---+--+---+
| py | h | x0r |
+---+--+---+
■ 1 3 0 E2 C 9 ■
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Dave Angel

On 01/-10/-28163 02:59 PM, pyhx0r wrote:

Dear All,



 multiple = 1024 if a_kilobyte_is_1024_bytes else 1000
 for suffix in SUFFIXES[multiple]:
 size /= multiple
 if size<  multiple:
 return '{0:.1f} {1}'.format(size, suffix)



 

I’ve shorted the code be:



SUFFIXES = {1000: ['KB','MB','GB'],


 1024: ['KiB','MiB','GiB']}



multiple = 1000



size = 2300
for suffix in SUFFIXES[multiple]:

 size /= multiple
 if size<  multiple:
 '{0:.1f} {1}'.format(size, suffix)




*Why do in my code, it loops to all values and not in Mark Pilgrim’s code?*



(Is there a reason you double-spaced all that code?  It makes it very 
hard to read, and quite difficult to quote, since I had to delete every 
other line.)


You wrote your code inline, and not as a function.  And you omitted the 
return statement.  So the loop won't return, it'll run to completion.


Another way to exit a loop early is to use the break statement.


DaveA
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 14:52, pyhx0r  wrote:

> *Why do in my code, it loops to all values and not in Mark Pilgrim’s code?
> *
>
>
Because in Mark's code the loop is terminated by the return statement
(contained in the utility function approximate_size().)  In your code you've
removed the entire function including the return statement, consequently the
loop runs to completion.

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Help on Python Looping Please

2011-02-24 Thread pyhx0r
Dear All,


I’m new in programming and I’m studying Python now. I use Python 3.1.2 and
learn from Dive Into Python 3 book (Mark Pilgrim, Thank you very much for
him). I’ve learned list, tuple, set, dictionary and little bit about
looping. I’m so confused about looping in first Python Program in that book
(humanize.py), it’s the code:


SUFFIXES = {1000: ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],

1024: ['KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']}



def approximate_size(size, a_kilobyte_is_1024_bytes=True):

'''Convert a file size to human-readable form.

   Keyword arguments:

   size -- file size in bytes

   a_kilobyte_is_1024_bytes -- if True (default), use multiples of 1024

   if False, use multiples of 1000

   Returns: string

'''

if size < 0:

raise ValueError('number must be non-negative')



multiple = 1024 if a_kilobyte_is_1024_bytes else 1000

for suffix in SUFFIXES[multiple]:

size /= multiple

if size < multiple:

return '{0:.1f} {1}'.format(size, suffix)



raise ValueError('number too large')



if __name__ == '__main__':

print(approximate_size(1, False))

print(approximate_size(1))


 Result:

1.0 TB

931.3 GiB


I’ve shorted the code be:


>>> SUFFIXES = {1000: ['KB','MB','GB'],

1024: ['KiB','MiB','GiB']}

>>> multiple = 1000

>>> size = 2300

>>> for suffix in SUFFIXES[multiple]:

size /= multiple

if size < multiple:

'{0:.1f} {1}'.format(size, suffix)





'2.3 KB'

'0.0 MB'

'0.0 GB'

>>>


*Why do in my code, it loops to all values and not in Mark Pilgrim’s code?*



Best Regards,
[ pyhx0r - hx0r-labs.org ]
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python file extension windows vista recognition

2009-10-13 Thread Tim Golden

Dave Angel wrote:
You will also need to get comfortable with the DOS box (Command Prompt,  
whatever Vista calls it.  It's probably in Start->Accessories).  In a 
DOS box, you could do a DIR of that directory, and see exactly what the 
file is called.  You also could invoke python or pythonw explicitly on 
the file, with extra option switches.  And when the program finishes, 
the window with the result wouldn't automatically vanish.  And you can 
scroll back and see what's been happening in previous runs.  And you can 
actually type arguments to your script.  And ...



If you haven't already, check out the "Using Python on..."
section of the docs. This is an online link:

 http://docs.python.org/using/windows.html

but the docs are included in the standard Windows install.

TJG
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Dave Angel

Victor Binns wrote:
 


Please,
I need help. I installed python on my gateway windows vista laptop computer.
 
This is with the latest version of python (Python 2.6.3 Windows installer)

Python 2.6.3 Windows installer
  

It's not the latest, but no problem. It's probably a good choice.
 
I have some python code files I placed on my desktop and tried placing it in a folder containing

python program.
  

Which?  On the desktop, or in a folder containing python programs?
 
The files still appears on the computer as a text file.  Even though I placed the .py file extension on the file.
 
The .py is on the file but the icon image appears as a notepad file.
 
I need help in resolving this issue.
 
Thanks


 		 	   		  

  
Are you familiar with your system, and with Vista in particular?  One 
thing that's  been wrong for the last few implementations of Windows is 
that by default Explorer hides the extension of files.  So you have to 
believe in icons to guess what the file extension is.  When I get each 
new system, one of the first things I change is "hide file extensions 
for known types".  Don't hide anything.  There are a number of other 
foolish settings which ought to be switched, but this is one of the most 
important.


Most likely, your base problem is that your file is called

myprogram.py.txt

Notepad loves to add a txt extension to files, and by default Windows 
Explorer obscures that fact.  If you must use Notepad to edit the files, 
then when doing the SaveAs, make sure you change the "Save as file 
type"  from "Text Documents" to "All files"  Otherwise Notepad will add 
an extra .txt to whatever extension you try to use.


You will also need to get comfortable with the DOS box (Command Prompt,  
whatever Vista calls it.  It's probably in Start->Accessories).  In a 
DOS box, you could do a DIR of that directory, and see exactly what the 
file is called.  You also could invoke python or pythonw explicitly on 
the file, with extra option switches.  And when the program finishes, 
the window with the result wouldn't automatically vanish.  And you can 
scroll back and see what's been happening in previous runs.  And you can 
actually type arguments to your script.  And ...


DaveA

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Amos Anderson
You probably have the true extension hidden. Try this...

1. Start->Control Panel->Appearance and Personalization->Folder Options2.
Click the View tab
3. Uncheck Hide Extensions for Known File Types
4. Hit apply.

Now check the file. You probably will notice the .txt extension is still
there. You can remove it by renaming now.

On Mon, Oct 12, 2009 at 1:21 PM, Victor Binns  wrote:

>
> Please,
> I need help. I installed python on my gateway windows vista laptop
> computer.
>
> This is with the latest version of python (Python 2.6.3 Windows 
> installer
> )
> Python 2.6.3 Windows installer
>
> I have some python code files I placed on my desktop and tried placing it
> in a folder containing
> python program.
>
> The files still appears on the computer as a text file.  Even though I
> placed the .py file extension on the file.
>
> The .py is on the file but the icon image appears as a notepad file.
>
> I need help in resolving this issue.
>
> Thanks
>
>
> --
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up
> now. 
>
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Help on python file extension windows vista recognition

2009-10-12 Thread Victor Binns

 

Please,
I need help. I installed python on my gateway windows vista laptop computer.
 
This is with the latest version of python (Python 2.6.3 Windows installer)
Python 2.6.3 Windows installer
 
I have some python code files I placed on my desktop and tried placing it in a 
folder containing
python program.
 
The files still appears on the computer as a text file.  Even though I placed 
the .py file extension on the file.
 
The .py is on the file but the icon image appears as a notepad file.
 
I need help in resolving this issue.
 
Thanks

  
_
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
http://clk.atdmt.com/GBL/go/177141664/direct/01/___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor