Re: Problems with properties

2005-10-14 Thread shawn
I was thinking that in Python2.4, all class definitions inherited from new-style classes. There may be a bug here. I can make your code work as expected by changing the class definition to: class Task(object): with that change, the assignment raises an attribute error. You could also accomplish

subtyping a builtin type in a C extension

2005-10-16 Thread shawn
I am trying to make a subtype of a string. Initially it will have no new methods or attributes, the C equivalent of: class myStr(str): pass I have experimented a bit, but am currently making a mess of it. Does anybody have an example they can point to of inheriting from a builtin, or a sugges

Re: subtyping a builtin type in a C extension

2005-10-17 Thread shawn
Thank you. I should have looked for this sort of example. That was exactly what I needed. I don't ask for help here very often, but when I have, I have ALWAYS gotten faster results than with any commercial support option I have used. We have a good developer community :-) -- http://mail.python.o

Re: python GUIs comparison (want)

2006-10-24 Thread shawn
all of the podcasts and direct links to the mp3s. Shawn 1. http://www.awaretek.com/python/ 2. http://libsyn.com/media/awaretek/Python411_070509_GUItoolkits.mp3 3. http://www.awaretek.com/python/index.xml -- http://mail.python.org/mailman/listinfo/python-list

How to implement a combo Web and Desktop app in python.

2012-09-13 Thread Shawn McElroy
snt seem to fit what I need to do. There are rest api plugins available for it, but if the core of my app is based on REST, it seemed to make more sense to start with something that has REST built into the core of the framework. Any input or advice is much appreciated. Thanks. - Shawn M

Re: How to implement a combo Web and Desktop app in python.

2012-09-13 Thread Shawn McElroy
e others. And the UI, will be different based on platform. web/mobile will just be html/css, and desktop, will likely end up being something like qt/wx. Thanks. On Thursday, September 13, 2012 5:20:48 PM UTC-7, Shawn McElroy wrote: > I am somewhat new to python. I am still learning it. I am

Re: problem with bcd and a number

2011-08-04 Thread shawn bright
Thanks for your help on this, gents. Got it working now. shawn On Thu, Aug 4, 2011 at 2:28 PM, Dave Angel wrote: > nibbles from a byte -- http://mail.python.org/mailman/listinfo/python-list

Re: Development tools and practices for Pythonistas

2011-04-29 Thread Shawn Milochik
Depends on the project, but I'd start with git the time I created the first file in my project. If you're in the habit of committing then you can easily rollback missteps. If you're in the habit of making branches you can experiment without breaking the currently-working code. -- http://mail.

Re: Development tools and practices for Pythonistas

2011-04-30 Thread Shawn Milochik
For what it's worth, the Python core developers have selected Mercurial. I personally use git and love it. Most open-source people seem to use one or the other of the two. They're pretty similar in most ways. Look at the big two sites for open-source repositories -- github and bitbucket. One's

ANN: datatest 0.7.0 (Test driven data wrangling)

2016-08-02 Thread Shawn Brown
datatest 0.7.0 (Test driven data wrangling) === Datatest extends the standard library's unittest package to provide testing tools for asserting data correctness. * Docs: http://datatest.readthedocs.io/ * PyPI: https://pypi.python.org/pypi/datatest/ This

Fwd: Removing python installation

2020-05-14 Thread Shawn Hoffman
Studio\Shared\Python37_64\python.exe" * -3.7-64C:\Users\shawn\AppData\Local\Programs\Python\Python37\python.exe As you can see, the 3.7.5 install is from Visual Studio. I want to remove this python installation, however while uninstalling it via the VS Installer GUI appears to work, non

network installations

2005-10-20 Thread Shawn Kelley
Hi All - I am working on a project that requires Python be installed on multiple Windows servers. I was wondering if anyone knew of a method/utility/script that can push the installation of Python to multiple networked servers from a centralized location. Thanks in advance! -shawn

first post: new to pythong. some questions.

2005-12-07 Thread shawn a
rmost last):    File "mkoneurl.py", line 5, in ? run = makeoneurl() NameError: makeoneurl am i missing something here? Any help would be greatly appreciated. Thank you --Shawn -- http://mail.python.org/mailman/listinfo/python-list

How did you learn Python?

2004-12-03 Thread Shawn Milo
d, long time, and it matches my values as an Open-Source/Linux supporter, while having relevance in the Windows and Mac world, as well. Plus, it looks like it was designed extremely well, and I'm excited about the principles I've read about. Thanks, Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: Best book on Python?

2004-12-12 Thread Shawn Milo
n" is available for free from diveintopython.org, but it is listed first because I think it is of the greatest immediate value. Dive Into Python Python in a Nutshell Python Cookbook Learning Python Shawn Python Cookbook Very useful as a reference. There are examples for a great many things. Almost

Accessing DB2 with Python

2004-12-16 Thread Shawn Milo
. Is there any commonly used module for this? Thanks, Shawn -- http://mail.python.org/mailman/listinfo/python-list

cannot run a ruby script from a python script.

2014-09-24 Thread Shawn Bright
hello all. i have a linux computer that i use to run a GUI (wxGTK) program. In this program, there is a call to run an external ruby script. command = "ruby run_my_command.rb &" os.system(command) however, when it runs, i get this in the terminal sh: 1: ruby: not found i had considered that

Re: cannot run a ruby script from a python script.

2014-09-25 Thread Shawn Bright
On Wednesday, September 24, 2014 6:57:34 PM UTC-5, Shawn Bright wrote: > hello all. > > > > i have a linux computer that i use to run a GUI (wxGTK) program. In this > program, there is a call to run an external ruby script. > > > > command = "ruby r

TypeError: no arguments expected

2005-12-11 Thread shawn a
mkoneurl.py I get this error: Traceback (innermost last): File "mkoneurl.py", line 5, in ? run = make_ou_class.makeoneurl() TypeError: no arguments expected Ive looked around for this exeption but nothing ive read has help in this situation. Any of your thoughts are greatly apprect

Re: TypeError: no arguments expected

2005-12-12 Thread shawn a
thanks for all your input. Ive gotten it to work thanks! --shawn On 12/12/05, Steve Holden <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber wrote: > > On Sun, 11 Dec 2005 22:00:55 -0500, shawn a <[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > &

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
On 8/14/07, Bryan <[EMAIL PROTECTED]> wrote: > Hi, > > I just started with python, and have a for loop question > > In c++ (or a number of other languages) I can do this: > > for (int i=0, j=0; i < i_len, j< j_len; ++i, ++j) {} > > If I have this in python: > l = ['a', 'b', 'c'] > > I want to get t

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
> this will get index and item at index, > > for i in range(0, len(l)): > print i > print l[i] > > > -- > http://mail.python.org/mailman/listinfo/python-list > Enumerate is better here -- it provides the same result and that's what it's for. However, if you do use range, the zero is unne

Re: Simple python iteration question

2007-08-14 Thread Shawn Milochik
the third response advocating the use of enumerate()? Did the other responses not get through, or was this a time-delay thing? Thanks, Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: Opinions about this new Python book?

2007-08-14 Thread Shawn Milochik
Yes, please post back to the list. I saw this book on Amazon, but there's no table of contents listed, nor is there one on the publisher's site. Thanks, Shawn On 8/14/07, James Matthews <[EMAIL PROTECTED]> wrote: > i got to say that the best python book i bought was Core

Re: curses library

2007-08-14 Thread Shawn Milochik
You should try Google -- you'll get results faster: http://www.amk.ca/python/howto/curses/ http://docs.python.org/lib/module-curses.html On 8/14/07, Ghirai <[EMAIL PROTECTED]> wrote: > Hello list, > > I need to write a console application. > > Are there any wrappers around curses/ncurses? >

Re: [Tutor] Python Book Recommendations

2007-08-15 Thread Shawn Milochik
If I could have only one book, I would buy "Core Python, Second Edition," by Wesley Chun. For the record, I own: Core Python, Second Edition (great) wxPython in Action (haven't used yet) Beginning Python (barely used) Python in a Nutshell (use as a reference, although interactive python dir() is m

Python app to ration cell-phone minutes

2007-08-15 Thread Shawn Milochik
n. By the way, I get free minutes on weekends, so it takes that into consideration. Everything is working fine. I'm just posting it in case anyone finds it interesting or useful, and as always, comments or constructive criticism are welcome. Shawn $ cat cell.py #!/usr/bin/env python &quo

Re: "Variable variable name" or "variable lvalue"

2007-08-15 Thread Shawn Milochik
On 8/15/07, mfglinux <[EMAIL PROTECTED]> wrote: > Hello to everybody > > I would like to know how to declare in python a "variable name" that > it is in turn a variable > In bash shell I would wrote sthg like: > > for x in `seq 1 3` > do > M$i=Material(x) #Material is a python class > done > > W

Re: Python Book Recommendations

2007-08-16 Thread Shawn Milochik
I should add that "Dive Into Python" is also available for free online: http://www.diveintopython.org/ It's a great book. It is not a linear book -- it doesn't start you off talking about variable types and structure. It starts you right off with a piece of working code. If you already have some

Re: A problem with Time

2007-08-16 Thread Shawn Milochik
import time oneDay = 60 * 60 * 24 #seconds in one day date = time.time() yesterday = date - oneDay -- http://mail.python.org/mailman/listinfo/python-list

Making a copy (not reference) of a file handle, or starting stdin over at line 0

2007-08-17 Thread Shawn Milochik
fference. How can I check a line (or two) from my input file (or stdin stream) and still be able to process all the records with my function? Thanks, Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: question

2007-08-17 Thread Shawn Milochik
You need to post some kind of code (even non-working) to show that you've actually done some work. Nobody will do your work for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
#!/usr/bin/env python normalPay = 0.4 overPay = 1.4 normalLimit = 22 def calcPay(numStops): pay = 0 if numStops > normalLimit: pay = overPay * (numStops - normalLimit) numStops = normalLimit return pay + (numStops * normalPay) if __name__ == "__main__": print

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
me * 1.4 > return x > > # Use your own brain next time > > Mike > > -- > http://mail.python.org/mailman/listinfo/python-list > Mike, I wonder if we were both just duped into helping someone with their homework... Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbee Question

2007-08-20 Thread Shawn Milochik
d to know I'm not trying to write it like Perl or VBScript anymore. ^_^ Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: regular expression dictionary search

2007-08-20 Thread Shawn Milochik
tches more than one pattern, only one will be returned. I'm not sure if I'm doing the patterns thing properly -- if anyone could instruct me on whether it would be proper to declare it in the function, or use a global declaration, please let me know. However, it runs properly as far as I tested it. Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: question

2007-08-20 Thread Shawn Milochik
> And Shawn, I didn't post any of my work because the network I work on > isn't > connected to the internet. So it didn't seem constructive to re-type > all of my > failed code just to satisfy your "standards" of proving that I've been > trying to

Re: regular expression dictionary search

2007-08-20 Thread Shawn Milochik
On 8/20/07, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Aug 20, 10:35 am, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/env python > > > if __name__ == "__main__": > > > > print "The return for 'fr

Re: I Need help from all the group participants

2007-08-20 Thread Shawn Milochik
On 8/20/07, Boris Ozegovic <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > The only sentence that comes to mind is: > > > > "I hope I never find myself in a hospital that uses your system." > > You are not funny. The system isn't for hospitals, it is for university > purposes. > > -- >

Re: reading a line in file

2007-08-20 Thread Shawn Milochik
Write some code, even if it doesn't quite work, and post it. We'll help you fix it. You can open a file with: input = open("file.txt", "r") You can read a line with: someText = input.readline() You can loop through an open file like this: for line in input: #do something with line That s

Re: reading a line in file

2007-08-20 Thread Shawn Milochik
Hopefully this will help (using your input file) #!/usr/bin/env python import re buildinfo = "input.txt" input = open(buildinfo, 'r') regex = re.compile(r"^\s*build.number=(\d+)\s*$") for line in input: if re.search(regex, line): print line buildNum = re.sub(r"^\s*build.numbe

Re: reading a line in file

2007-08-20 Thread Shawn Milochik
Everybody hates regexes. Except me. Discrimination! -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a line in file

2007-08-20 Thread Shawn Milochik
Although you're technically correct, I think there's a knee-jerk anti-regex reaction, citing the meaningless overhead. If you're running many thousands of records or something then it becomes a small issue compared to a replace statement or something. But in most cases it makes no difference at all

Re: I Need help from all the group participants

2007-08-21 Thread Shawn Milochik
"Please enter John's heart rate." "Please notify me immediately if John's heart rate drops below 60 or exceeds 100." -- http://mail.python.org/mailman/listinfo/python-list

Re: Asking all python programmers.

2007-08-28 Thread Shawn Milochik
ngs with Python. The latter is available for free online. Take some pride in the way you write. It will pay off. Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Code reading for learning Python

2007-09-04 Thread Shawn Milochik
I second the Python Cookbook recommendation. -- http://mail.python.org/mailman/listinfo/python-list

PythonAlley.com

2007-09-05 Thread Shawn Milochik
to do something with at least the Python site, since I love Python. Not too sure about the others -- maybe I'm make them wikis and open them up to the community. Maybe I should just sell them. Ideas? Thanks, Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonAlley.com

2007-09-05 Thread Shawn Milochik
On 9/5/07, O.R.Senthil Kumaran <[EMAIL PROTECTED]> wrote: > * Shawn Milochik <[EMAIL PROTECTED]> [2007-09-05 10:27:08]: > > I bought the domain PythonAlley.com (and PerlAlley.com and > > > > Does anyone have any ideas as to what a wonderful use for > > Pytho

Re: REGULAR EXPRESSION

2007-09-05 Thread Shawn Milochik
> Hi.. Thanks alot for finding time to help a beginner like me. What I > am trying to do is validate the input i get. I just want to take > numbers and numbers only. So if the input is 23+1 or 2/3 or 9-0 or > 7/0 , I want to find it using reg exp. I know there are other ways to > do this... but i t

Re: Text processing and file creation

2007-09-05 Thread Shawn Milochik
On 9/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have a text source file of about 20.000 lines. > >From this file, I like to write the first 5 lines to a new file. Close > that file, grab the next 5 lines write these to a new file... grabbing > 5 lines and creating new files until proces

Re: Text processing and file creation

2007-09-06 Thread Shawn Milochik
Here's my solution, for what it's worth: #!/usr/bin/env python import os input = open("test.txt", "r") counter = 0 fileNum = 0 fileName = "" def newFileName(): global fileNum, fileName while os.path.exists(fileName) or fileName == "": fileNum += 1 x = "%0.5d" % fileN

Re: Python and Cron

2007-09-07 Thread Shawn Milochik
Could you send the output of "crontab -l" and the script you're running? It's probably an environment issue of some kind, but it's hard to say what blindly. -- http://mail.python.org/mailman/listinfo/python-list

Re: why should I learn python

2007-09-07 Thread Shawn Milochik
I wholeheartedly second the recommendation of this article: http://www.linuxjournal.com/article/3882 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and Cron

2007-09-07 Thread Shawn Milochik
Any chance your import statements aren't coming in properly due to something in your environment in Python that's not being inherited by your cron job? -- http://mail.python.org/mailman/listinfo/python-list

Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
I have done what I wanted, but I think there must be a much better way. Given two timestamps in the following format, I just want to figure out how far apart they are (in days, seconds, whatever). Format: -MM-DD_MM:SS Example: 2007-09-11_16:41 It seems to me that to do what I want, I need

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
On 9/11/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-09-11, Shawn Milochik <[EMAIL PROTECTED]> wrote: > > > I have done what I wanted, but I think there must be a much better way. > > See the strptime() function in either the time or the datetime > module

Re: Difference between two times (working ugly code, needs polish)

2007-09-11 Thread Shawn Milochik
uctions. ^_^ In any case, DST isn't an issue because the same machine generates both timestamps, and all I use it for is to stop displaying auctions after they are 10 days old, so I don't get all my old crap filling up the alert e-mail or skewing the total dollar amount for all active aucti

Re: Difference between two times (working ugly code, needs polish)

2007-09-12 Thread Shawn Milochik
ting it with one purpose in mind and changed it midstream. I actually renamed it yesterday to dayDiff. ;o) Shawn -- http://mail.python.org/mailman/listinfo/python-list

Perl and Python, a practical side-by-side example.

2007-03-02 Thread Shawn Milo
e ID (piid). The best is defined as follows: The newest expiration date (field 5) for the record with the state (field 1) which matches the desired state (field 6). If there is no record matching the desired state, then just take the newest expiration date. Thanks for takin

Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
hon\PyModuleSetup.cc:58: instantiated from here C:/MinGW/include/boost/python/detail/invoke.hpp:88: error: no match for call to `(const boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning) (const std::basic_string, std::allocator >&)' Runtime

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
I forgot to mention, getname is defined as: const std::string &Entity::getName() const; -- http://mail.python.org/mailman/listinfo/python-list

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > I forgot to mention, getname is defined as: > const std::string &Entity::getName() const; After more reading I found the copy_const_reference, and replaced: boost::python::return_internal_reference&l

Re: Boost Python properties/getter functions for strings

2007-03-19 Thread Shawn McGrath
On Mar 19, 12:49 pm, "Jon Clements" <[EMAIL PROTECTED]> wrote: > On 19 Mar, 16:40, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > On Mar 19, 12:00 pm, "Shawn McGrath" <[EMAIL PROTECTED]> wrote: > > > > I forgot to mention,

Re: How to Start

2007-09-14 Thread Shawn Milochik
7;t learn by asking for help every step along the way, did you? Is it really teaching a man to fish if you bait his line and tell him where to cast? Shawn -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Just bought Python in a Nutshell

2007-09-14 Thread Shawn Milochik
some built-in functions that you will need and possibly would have re-invented if you didn't know they were there. I don't really find it to be a "reading" book -- it's more of a reference book. Flip through it, then keep it within reach of your keyboard. Shawn --

Re: [Tutor] list iteration question for writing to a file on disk

2007-09-14 Thread Shawn Milochik
When you use "print," it automatically adds a newline (\n). You can avoid this by following the print line with a comma: print j, Or rstrip() the line before printing. Either way. -- http://mail.python.org/mailman/listinfo/python-list

string questions

2007-09-15 Thread Shawn Minisall
work...I just get spam back when I print s1. Any ideas? Thanks. -Shawn -- http://mail.python.org/mailman/listinfo/python-list

thanks everyone for your replies!

2007-09-15 Thread Shawn Minisall
:) -- http://mail.python.org/mailman/listinfo/python-list

Re: pattern combinations

2007-09-17 Thread Shawn Milochik
On 9/17/07, dorje tarap <[EMAIL PROTECTED]> wrote: > Hi all, > > Given some patterns such as "...t...s." I need to make all possible > combinations given a separate list for each position. The length of the > pattern is fixed to 9, so thankfully that reduces a bit of the complexity. > > For examp

qa

2007-09-17 Thread Shawn Minisall
I'm trying to get a space in between these two strings but it's ignoring the space in between when it prints. >>> string.capwords (string.join([s1 + " " + s2])) * 3 'Spam Ni!Spam Ni!Spam Ni!' >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question

2007-09-18 Thread Shawn Milochik
On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sep 18, 1:31 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > If I have a file name: AVC1030708.14. How do I s

Re: Newbie question

2007-09-18 Thread Shawn Milochik
On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > If I have a file name: AVC1030708.14. How do I strip out certain > characters from the file name? I am so used to using MID, LEFT, and > RIGHT functions, that I have no idea how to do this in python? I have > had trouble as well with mos

Re: [Tutor] Finding prime numbers

2007-09-19 Thread Shawn Milochik
Here's my attempt: #!/usr/bin/env python import math for x in range(3,1000,2): isPrime = True for y in range(3,(math.sqrt(x) + 1)): if x % y == 0: isPrime = False break if isPrime: print "%d is prime." % x Notes: This doesn't bother with ev

Re: [Tutor] Finding prime numbers

2007-09-19 Thread Shawn Milochik
Okay, I caught one bug already myself: for y in range(3,(math.sqrt(x) + 1)): should be for y in range(3,(int(math.sqrt(x)) + 1)): -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding prime numbers

2007-09-19 Thread Shawn Milochik
> If you'd just search the archives, you would have found this: > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/b134b2235e9c19a6/34857fb0b0b2a4b5?lnk=gst&q=prime+number&rnum=1#34857fb0b0b2a4b5 Yeah, but that's no fun. ;o) -- http://mail.python.org/mailman/listinfo/python

Re: Finding prime numbers

2007-09-20 Thread Shawn Milochik
On 9/20/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Sep 19, 1:31 pm, "Shawn Milochik" <[EMAIL PROTECTED]> wrote: > > > If you'd just search the archives, you would have found this: > > > > >http://groups.google.com/group/comp.lang.py

acronym program

2007-09-21 Thread Shawn Minisall
I'm trying to write a program that gets the first letter of every word of a phrase and prints it on screen. I'm having problems with it. I'm thinking a for loop would be good since I don't know the exact number of words the user is going to enter, but after that I get confused. How do I tell

Re: acronym program

2007-09-21 Thread Shawn Minisall
I thought it could work both ways? Paul Rudin wrote: > Shawn Minisall <[EMAIL PROTECTED]> writes: > > >> I'm trying to write a program that gets the first letter of every word >> of a phrase and prints it on screen. I'm having problems with it. >&g

too many values with string.split

2007-09-22 Thread Shawn Minisall
I'm trying to unpack a list of 5 floats from a list read from a file and python is telling me 5 variables are too many for the string.split statement. Anyone have any other idea's? NOTE: the only reason I convert it to a float instead of just leaving it as a string in the loop is because I ha

Re: [Tutor] Take if offline

2007-09-25 Thread Shawn Milochik
Since everyone else is replying to the list, I'll (top) post this: No, not really. He had to give everyone the rule once. Otherwise, he'd have to do it a hundred times a day, and monitor every single post to find out who he had to inform. He'd end up doing not much else with his life, and would fl

ValueError: too many values to unpack,>>>

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this "ValueError: too many values to unpack" I've googled it and it says that happens when you have too few or too many strings that don't mat

ValueError: too many values to unpack

2007-09-27 Thread Shawn Minisall
I am trying to read a few lines of a file with multiple values, the rest are single and are reading in fine. With the multiple value lines, python says this "ValueError: too many values to unpack" I've googled it and it says that happens when you have too few or too many strings that don't mat

Re: ValueError: too many values to unpack,>>>

2007-09-27 Thread Shawn Minisall
Marc 'BlackJack' Rintsch wrote: > On Thu, 27 Sep 2007 12:36:58 -0400, Shawn Minisall wrote: > > >> With the multiple value lines, python says this "ValueError: too many >> values to unpack" >> >> I've googled it and it says that happen

Re: ValueError: too many values to unpack,>>>

2007-09-27 Thread Shawn Minisall
Fredrik Lundh wrote: > Shawn Minisall wrote: > > >> Sorry, it looks like it's on the fourth line with the 3 values on line >> 4...its reading line 3 fine >> >> Traceback (most recent call last): >> File "", line 1, in >>

Re: Algebraic Modules For Python

2007-10-02 Thread Shawn Milochik
On 10/1/07, Brandon McGinty <[EMAIL PROTECTED]> wrote: > > > Hi All, > I know that there is probably a great deal of literature on this on the net, > but I don't have any time to go searching. -- > Brandon McGinty > McGinty Soft Ltd. > Website design, configuration, and maintenance > Python and

Re: [Tutor] data from excel spreadsheet to csv and manipulate

2007-10-03 Thread Shawn Milochik
dge with > BackOfMyHand.com > ___ > Tutor maillist - [EMAIL PROTECTED] > http://mail.python.org/mailman/listinfo/tutor > > Here's the best approach: 1. Browse: http://python.org/doc/ 2. Search Google. 3. Write code. 4. Post c

Re: [Tutor] matching a street address with regular expressions

2007-10-10 Thread Shawn Milochik
On 10/4/07, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > Christopher Spears wrote: > > One of the exercises in Core Python Programming is to > > create a regular expression that will match a street > > address. Here is one of my attempts. > > > street = "1180 Bordeaux Drive" > patt = "\d+

if then elif

2007-10-10 Thread Shawn Minisall
I just learned about if, then elif statements and wrote this program. The problem is, it's displaying all of the possibilities even after you enter a 0, or if the fat grams are more then the total number of calories , that is supposed to stop the program instead of continuing on with the print

while statements

2007-10-16 Thread Shawn Minisall
I just learned about while statements and get why you place them around inputs for validation, but I'm a little lost on exactly where to place it with what condition in this program where the number of fat grams exceeds the total number of calories so that it loops back and asks you the two que

for loop

2007-10-22 Thread Shawn Minisall
#Intro print "*" print "WELCOME TO THE POPULATION GROWTH CALCULATOR" print "*" print "This program will predict the size of a population of organisms." print print organisms=inp

Re: for loop

2007-10-22 Thread Shawn Minisall
ECTED] wrote: > On Oct 22, 5:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >> On Oct 22, 5:22 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> >>> On Mon, 22 Oct 2007 18:17:56 -0400, Shawn Minis

Re: Regular Expression

2007-10-23 Thread Shawn Milochik
other data which looks similar? Do you have a specific field length? Is it guaranteed to contain a digit? Is it required to start with a letter? Does it always start with 'C'? You need to have those kinds of rules in mind to write your regex. Shawn -- http://mail.python.org/mailman/listinfo/python-list

greatest and least of these...

2007-10-23 Thread Shawn Minisall
I just wrote a program to let the user input a series of whole numbers and tell them which is least and which is greatest based off of a menu. However, the menu isn't kicking in after they pick a number. I included a while statement for a loop just for the menu and compared it to my other pro

Re: for loop

2007-10-24 Thread Shawn Minisall
I agree, but if I want to get a A on the program, thats how my professor wants the output. :) [EMAIL PROTECTED] wrote: > On Oct 22, 9:12?pm, Shawn Minisall <[EMAIL PROTECTED]> wrote: > >> Thanks, everyone! Using everyone's suggestions and points, the program

while within while

2007-10-27 Thread Shawn Minisall
I've been having some problems with using a while statement for one menu within another while statement for the main menu, first time I've done it. It's with choice number two from the menu. When I run the program, I get a UnboundLocalError: local variable 'ai' referenced before assignment.

while within while

2007-10-27 Thread Shawn Minisall
K I've since fixed the UnboundLocalError: local variable 'ai' referenced before assignment error, I forgot to include decision = (1, 2, 3) inside " " for each number. Now when I run it, I get this.. >>> main() READY TO PLAY ROCK, PAPER, SCISSORS??? Please choose from the following menu: 1. Se

Re: while within while

2007-10-28 Thread Shawn Minisall
about or ever cover them in class. I think we get to true statements in the next chapter next week. It turns out that my problem was with indentation, as soon as I fixed it, it's working perfectly now. thx Dennis Lee Bieber wrote: > On Sat, 27 Oct 2007 15:11:37 -0400, Shawn Minis

clear shell screen

2007-10-28 Thread Shawn Minisall
Does anyone know how to clear the shell screen completely ? I tried import os and then os.system("clear") was said to have worked in Windows XP, but it's just bringing up another window, then it turns black and then it closes in within about a second moving the prompt at the os.system("clear")

Re: New

2007-10-29 Thread Shawn Milochik
On 10/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi! > Am new to Python and am looking for a sample project that demonstrates > how to connect to MySQL, save data in MySQL database using a form on a > web page. > > Regards, > Joseph > > -- > http://mail.python.org/mailman/listinfo/python

Re: clear shell screen

2007-10-29 Thread Shawn Minisall
Hmm...it works fine within the command line but then when I import os in python and then try os.system("cls"), i get that very fast opening/closing window and 0 inside the shell. Gabriel Genellina wrote: > En Mon, 29 Oct 2007 00:08:14 -0300, Shawn Minisall > <[EMAIL

  1   2   >