324 Posted Topics
Re: Do each of the players throw the dice 100 times? | |
Re: Does the MS Internet Explorer work? Don't forget the new https://vivaldi.com/ | |
Re: Good for the beginner: http://learnpythonthehardway.org/book/ | |
Re: Something like: Read through every character in the text file If the character is a vowel add one to the vowel count If the character is a consonant add one to the consonant count If the character is a space add one to the word count If the character is … | |
Re: Don't use any of these malicious bots: Spambots that harvest email addresses from contact or guestbook pages (as used by LinkedIn, Facebook, Twitter) Downloader programs that suck bandwidth by downloading entire web sites Website scrapers that grab the content of websites and re-use it without permission on automatically generated doorway … | |
Re: Are you using Python2 or Python3? '/' changed from an integer division to a float division. | |
Re: You are not using a Python GUI. Do you mean a multiline sentence? Otherwise put your input in a while loop with a break condition. | |
Re: The with statement `with conn:` takes care of conn.commit() and conn.close() | |
Re: Since I am not much of a mindreader, what does your code look like at this time? | |
Re: Play around with this: count = 1 for c in "abcde": s = c * count count += 1 s = s.zfill(5) s = s.replace('0', ' ') print s | |
Re: `ent = Entry(w)` | |
Re: Maybe it should be called "spineless shoulder surfing crime". Maybe something the North Koreans do. | |
Re: I am not sure if a password like ABCCBA having a double character like CC would be a good idea. | |
Re: A little timing experiment: ''' timeit_isprime.py check the speed of three isprime functions ''' import timeit import sys print(sys.version) def isprime2(n): ''' check if integer n is a prime, return True or False ''' # 2 is the only even prime if n == 2: return True # integers less … | |
Re: Get a gas mask from the military surplus store, wear it and knock at his door! You can also burn a candle to destroy cigarette smoke. | |
Re: Try this: ''' tk_countdown_ny.py countdown to New Year using Tkinter use update() after sleep() ''' try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk import time def countDown(): '''start countdown 10 seconds before new year starts''' lbl.config(bg='yellow') for k in range(10, -1, -1): lbl["text"] … | |
Re: See also: http://personal.denison.edu/~krone/cs173/files/PythontoC++.pdf | |
Re: For the "Two IDLE" solution check: https://www.daniweb.com/software-development/python/threads/488483/different-version-of-python#post2136990 Just change Python32 to Python34 in the batch file. | |
Re: Compile with something like CodeBlocks to get meaningfull error messages. This should work: // ohms+law101.c // i = v/r # include <stdio.h> void get_values(float *r, float *v); float do_calculations(float resistance, float voltage ) ; void display_answer(float current); int main() { float resistor; float volts; float current; //explain_program(); get_values(&resistor, &volts); // … | |
I copied this code from page 11 of http://personal.denison.edu/~krone/cs173/files/PythontoC++.pdf and assigned it to a Python string. Alas there are still line numbers. How could I use Python to remove these? Help, I have a mental block. s = ''' 1 #include <iostream> 2 using namespace std; 3 4 int gcd(int … | |
Re: You could run an external program that shows the image. | |
Re: GUI programming is tough with C, see: http://ubuntuforums.org/showthread.php?t=1359096 | |
Re: If you use ProtonMail, you might become a suspect in the eyes of the all powerful government. | |
Re: <M/> you can sleep when you get old. Vacations are for doing wild stuff! | |
Re: I thought they only serve bread and water in prison. | |
Re: You can find the start of a nice GUI editor right here: https://www.daniweb.com/software-development/python/threads/32007/projects-for-the-beginner/14#post1840298 | |
Re: Scientists are blamed for the evils of technology, like cancer causing chemicals. Most US students simply don't like science and the people that teach it. | |
Re: Presumably it will be more secure than previous Windows. Maybe the jump from 8 to 10 will confuse the hackers. | |
Re: `x[x[:,0]=='t2']` gives you a new array | |
Re: You would waste more time on the silly costly flowchart. Python code is very readable, so the whole thing might look something like this: print("Enter 'zzzz' as employee name to quit data entry loop ...\n") pay_list = [] while True: emp = input("\nEnter employee's name: ") if emp == 'zzzz': … | |
Re: The problem with this package is that any help is at a minimum. It is probably written to be used for a science class at a junior college where the teaching assistant is present. That said look at: http://www.pyzo.org/pyzo_linux.html#pyzolinux and: https://plus.google.com/+PyzoOrg/posts | |
Re: I would just write a DOS batch file and run that from Python with something like `os.startfile("mybatch.bat")` | |
Re: Editra is nice until you come to Python's input() function. | |
![]() | |
Re: I would have suggested something like cx_Freeze, but I guess the problem is already solved. | |
Re: To avoid error messages you should make sure that the numbers entered are workable numbers (integers or floats). Actually slate's hint works with Python27 too, if you make sure the / is a floating point division like it is in Python3. For Python27 use this line in your code: `from … | |
| |
Re: # test string mystr = "Zero Animal zones." for c in mystr: if 'a' <= c <= 'z': print("character {} is between 'a' and 'z'".format(c)) elif 'A' <= c <= 'Z': print("character {} is between 'A' and 'Z'".format(c)) else: print(c, ord(c)) | |
Re: If it's just a text based console game, then Python should do it. If you want to introduce graphics, then look into Python module Pygame. | |
Re: Hint: def get_distance(x1, y1, x2, y2): """ get_distance(x1, y1, x2, y2) returns distance between two points using the pythagorean theorem the function parameters are the coordinates of the two points """ dx = x2 - x1 dy = y2 - y1 distance = (dx**2 + dy**2)**0.5 return distance | |
Re: Are we supposed to know what you are talking about? | |
Re: Just experimented putting red text in a listbox: [code]# load, sort, clear and add to wxPython's # wx.ListBox(parent, id, pos, size, choices, style, name) # choices is a list of strings # # style --> # wx.LB_SINGLE single-selection list (default) # wx.LB_MULTIPLE multiple-selection list, the user can toggle # multiple … |
The End.