break/continue - newbe
I have trouble sometimes figuring out where break and continue go to. Is there some easy way to figure it out, or a tool? TIA Ann -- http://mail.python.org/mailman/listinfo/python-list
Re: break/continue - newbe
"Jeff Shannon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ann wrote: > > >I have trouble sometimes figuring out where > >break and continue go to. Is there some easy > >way to figure it out, or a tool? > > > > > > Break and continue always operate on the most-nested loop that's > currently executing. To show an example, let's add some line numbers to > some code... > > 1) while spam: > 2) if foo(spam): > 3) continue > 4) for n in range(spam): > 5) if bar(n): > 6) break > 7) results.append(baz(spam, n)) > 8) spam = spam - 1 > > Now, when this loop runs, when foo(spam) evaluates as True we execute > the continue at line 3. At this time, we're running code that's at the > loop-nesting level just inside 'while spam' (line 1), so line 1 is the > loop statement that's affected by the continue on line 3. If line 3 is > triggered, then we skip lines 4-8 and go back to line 1. > > If line 3 is *not* triggered, then we enter a for loop at line 4. > There's a break at line 6; if this gets triggered, then we look > backwards to find the most-current (i.e. most nested) loop, which is now > that for loop on line 4. So we break out of that for loop (which > comprises lines 4-7), and drop down to line 8. > > So, in general, the way to determine how break and continue will affect > program flow is to look backwards (up) for the most recent loop > statement; the break/continue will be inside that statement's dependent > body. Break will drop you down to the next line after the loop body, > and continue will bring you back up to the top of the loop body and the > start of the next loop iteration. > > Jeff Shannon > Technician/Programmer > Credit International > Thanks Jeff, that solves my problem. BTW: is there an easy way to break/continue out more than one level? -- http://mail.python.org/mailman/listinfo/python-list
Which is the best FREE forum?
Free Unlimited Storage Free Unlimited Bandwidth Free Free Subdomain Free More Skins Free No annoying pop-ups Free 99% Uptime Free Daily Backups Free Fast, Friendly Tech Support So,what's that? That's our free forum named http://www.forumgogo.com. We have the human_based management also provide you human_based forum service. You needn't,we won't ! This is a great site that is completely free, and can make some cool forums, here's an example of one, you can make your own topic, polls, and replies etc, and you can have an accout for every member. This next link is an example of a forum made from invisionfree. http://support.forumgogo.com -- http://mail.python.org/mailman/listinfo/python-list
How to get a forum for your free site?
If you have something good and want to show or share it with eachother ,what would you do then? Send it one by one ?It's so slow and boring that you will be tired and have no interested to do that again.The buoyant you will be lost,are you ? http://www.forumgogo.com this is the place where can provide you all things and functions what you want. The forum is free.It's a very good flat roof for you to communicate with the other one ,upload things. As you like Beauty & Style、football or Pets,you can create a special topic such as Football Forum . We can provide you a free、stable、high-speed 、Professional and technical Forum.So what are you waiting for? Come on ! -- http://mail.python.org/mailman/listinfo/python-list
Re: How to get a forum for your free site?
On 4月14日, 下午2时49分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Normaly I would consider this way way off topic but I did notice that > you offer unlimited space so I suppose it could be usefull for those > of us that distribute software.. what else do I get some of the add > space?? If you are after killer apps you should consider allowing > combination of other boards between websites... (I had a provider > that went down in the .com bust that did that) Don't be doubtful of our space .We can sure to provide you unlimited free space forever. If you need add your space ,we could support too.If you have the intention, you can leave the link, or contact with me ,my MSN : [EMAIL PROTECTED] . thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to get a forum for your free site?
On 4月14日, 下午3时39分, "Ann" <[EMAIL PROTECTED]> wrote: > On 4月14日, 下午2时49分, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Normaly I would consider this way way off topic but I did notice that > > you offer unlimited space so I suppose it could be usefull for those > > of us that distribute software.. what else do I get some of the add > > space?? If you are after killer apps you should consider allowing > > combination of other boards between websites... (I had a provider > > that went down in the .com bust that did that) > > Don't be doubtful of our space .We can sure to provide you unlimited > free space forever. If you need add your space ,we could support > too.If you have the intention, you can leave the link, or contact with > me ,my MSN : [EMAIL PROTECTED] . > thank you. What's your account on our forum ? So we could contact you convenience. -- http://mail.python.org/mailman/listinfo/python-list
Re: Overlap in python
On Aug 4, 11:31 am, Marcus Wanner wrote:
> On Aug 4, 2:15 pm, Jay Bird wrote:
>
>
>
> > Hi everyone,
>
> > I've been trying to figure out a simple algorithm on how to combine a
> > list of parts that have 1D locations that overlap into a non-
> > overlapping list. For example, here would be my input:
>
> > part name location
> > a 5-9
> > b 7-10
> > c 3-6
> > d 15-20
> > e 18-23
>
> > And here is what I need for an output:
> > part name location
> > c.a.b 3-10
> > d.e 15-23
>
> > I've tried various methods, which all fail. Does anyone have an idea
> > how to do this?
>
> > Thank you very much!
> > Jay
>
> Just take all the values, put them in a list, and use min() and max().
> For example:
>
> import string
>
> def makelist(values):
> values = string.replace(values, ' ', '')
> listofvaluepairs = string.split(values, ',')
> listofvalues = []
> for pair in listofvaluepairs:
> twovalues = string.split(pair, '-')
> listofvalues.append(int(twovalues[0]))
> listofvalues.append(int(twovalues[1]))
> return listofvalues
>
> values = '5-9, 7-10, 3-6'
> values = makelist(values)
> print('Values: %d-%d' %(min(values), max(values)) )
>
> Marcus
Thank you for your help, this is a very nice program but it does not
address the issue that I have values that do not overlap, for example
'c' and 'd' do not overlap in the above example and thus I would not
want to output 3-20 but the individual positions instead. In
addition, my inputs are not ordered from smallest to largest, thus I
could have a situation where a=5-9, b=15-20, c=7-10, etc., and I would
still want an output of: a.c = 5-10, b=15-20. I apologize for the
complication.
Thank you again!
Jay
--
http://mail.python.org/mailman/listinfo/python-list
Questions for the Python Devs Out There
I'm with an open source game engine project - Project Angela (www.projectangela.org) and I'm writing in hopes that you guys will have some advice for me. We're working on an entirely new concept in gaming engines - Ruleset Markup Languge (RML) that will allow game rules to be engine agnostic meaning that if you decide to change platforms you can take your rules - in essence your game - with you without having to do a lot of rewriting. That said, I'm looking for advice on how to reach python developers who might be interested in working on this project. If anyone reading this is interested, please feel free. We've just moved to a new web site and the forums are at http://www.projectangela.org:8081/plone-site/zforum. Much information is still stored on our old site http://www.rpg-gamerz.com. If you know of places that I might be able to post queries for python developers, I'm certainly open to suggestions. Since I'm guessing that all of you are quite active in the python community, I'd appreciate pointers. TIA, RecentCoin aka Morrighu -- http://mail.python.org/mailman/listinfo/python-list
How to delete this file ???
pop up that says: error loading c:/progra~1\mywebs~1bar\2bin\mwsbar.dll the specified module could not be found this pop up appeares on desktop each time we log on cannot get rid off it can you help Ann-- http://mail.python.org/mailman/listinfo/python-list
One Jew RASPUTIN hires another gentile RASPUTIN - to look good in comparison - always, profligate white led by a misleader jew - roman polansky, bernard madoff, moshe katsav, Craigslist Killer Philip
One Jew RASPUTIN hires another gentile RASPUTIN - to look good in comparison - always, profligate white led by a misleader jew - roman polansky, bernard madoff, moshe katsav, Craigslist Killer Philip Markoff jew HP CEO Mark Hurd Resigns After Sexual-Harassment Probe JORDAN ROBERTSON and RACHEL METZ | 08/ 6/10 11:53 PM | AP Resignation On August 6, 2010, he resigned from all of his positions at HP, following discovery of inappropriate conduct in an investigation into a claim of sexual harassment made by former reality TV actress Jodie Fisher. THE ZIONIST JEW LARRY ELLISON WHOSE COMPANY STOLE SAUDI MONEY TO DEVELOP ARABIC SUPPORT OF ORACLE TO HELP ISRAEL MONITOR THE PALESTINIAN PRISON AND LABOR CAMP - ONE NEEDS TO DO INVESTIGATION TO FIND THE BONES - A LOT OF BONES IN HIS CLOSET . A thorough good investigation into oracle's past should prove this. There should be a wikileaks on corporate crimes as well. http://www.zpub.com/un/un-le.html "Hi there, can I buy you a car?" According to accusations from an ongoing trial, that's the approach the Oracle CEO used to convince company secretaries to, ahem, "date" the boss. The case involves a 33- year-old former employee [FALSELY AND WRONGLY] accused of forging an email message. The woman [Adelyn Lee], who was fired shortly after an affair with Ellison, obtained a $100,000 settlement from him. Larry Ellison's All-Time Top Pickup Line http://www.thesmokinggun.com/documents/crime/polanski-predator jew roman polanski raped 13 year old girl semantha geimer, orally, vaginally and anally without any mercy jew roman polanski raped 13 year old girl semantha geimer, orally, vaginally and anally without any mercy SAN FRANCISCO — Hewlett-Packard Co. ousted its CEO on Friday for allegedly falsifying documents to conceal a relationship with a former contractor and help her get paid for work she didn't do. News of Mark Hurd's abrupt departure sent HP's stock tumbling. Shares of the world's biggest maker of personal computers and printers have doubled in value during his five-year stewardship, and HP became the world's No. 1 technology company by revenue in that time. The company said it learned about the relationship several weeks ago, when the woman, who did marketing work for HP, sent a letter accusing Hurd, 53, and the company of sexual harassment. An investigation found that Hurd falsified expense reports and other financial documents to conceal the relationship. The company said it found that its sexual harassment policy wasn't violated but that its standards of business conduct were. Hurd's "systematic pattern" of submitting falsified financial reports to hide the relationship -- http://mail.python.org/mailman/listinfo/python-list
Tkinter problem
I am using Colab. How could solve this problem.
import tkinter as Tk
from tkinter import *
import sys
import os
#create main window
master = Tk()
master.title("tester")
master.geometry("300x100")
#make a label for the window
label1 = tkinter.Label(master, text='Hello')
# Lay out label
label1.pack()
# Run forever!
master.mainloop()
The error shows that :
in ()
9
10 #create main window
---> 11 master = Tk()
12 master.title("tester")
13 master.geometry("300x100")
/usr/lib/python3.7/tkinter/__init__.py in __init__(self, screenName, baseName,
className, useTk, sync, use)
2021 baseName = baseName + ext
2022 interactive = 0
-> 2023 self.tk = _tkinter.create(screenName, baseName, className,
interactive, wantobjects, useTk, sync, use)
2024 if useTk:
2025 self._loadtk()
TclError: couldn't connect to display ":0.0"
--
https://mail.python.org/mailman/listinfo/python-list
Anaconda navigator not working
After installing Anaconda, I tried to open the anaconda navigator but it did not work. When i check in anaconda prompt by running code >>>anaconda it got error like this (base) C:\Users\Acer>anaconda Traceback (most recent call last): File "C:\Users\Acer\anaconda3\Scripts\anaconda-script.py", line 6, in from binstar_client.scripts.cli import main File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\__init__.py", line 17, in from .utils import compute_hash, jencode, pv File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\__init__.py", line 17, in from .config import (get_server_api, dirs, load_token, store_token, File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\config.py", line 54, in USER_LOGDIR = dirs.user_log_dir File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\appdirs.py", line 257, in user_log_dir return user_log_dir(self.appname, self.appauthor, File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\appdirs.py", line 205, in user_log_dir path = user_data_dir(appname, appauthor, version); version = False File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\appdirs.py", line 67, in user_data_dir path = os.path.join(_get_win_folder(const), appauthor, appname) File "C:\Users\Acer\anaconda3\lib\site-packages\binstar_client\utils\appdirs.py", line 284, in _get_win_folder_with_pywin32 from win32com.shell import shellcon, shell ImportError: DLL load failed while importing shell: %1 is not a valid Win32 application. what is its solution? -- https://mail.python.org/mailman/listinfo/python-list
Re: can't get python to run
trying to install and run Python 3.5.2 (64 bit) and keep getting error message: the program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reintalling the program to fix this problem. I am on Windows 7 Home Premium I have uninstalled and reinstalled 3.5.2 several times and tried repairing and still the error message keeps coming back and i can't run python 3.5.2 I was able to run Python27 and it opened just fine. I am not a computer person and am just starting to learn python and the professor said to install 3.5.2. I just have no idea what the issue is other than maybe an old computer regards, Mary Ann -- https://mail.python.org/mailman/listinfo/python-list
