324 Posted Topics

Member Avatar for jac@
Member Avatar for Christiaan
Member Avatar for webmeat
Member Avatar for Gribouillis
0
226
Member Avatar for Foday_1

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 …

Member Avatar for HiHe
-1
244
Member Avatar for amin2005

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 …

Member Avatar for HiHe
-2
116
Member Avatar for differentiation
Member Avatar for HiHe
0
251
Member Avatar for Decode098

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.

Member Avatar for HiHe
0
303
Member Avatar for Niloofar24
Member Avatar for HiHe
0
313
Member Avatar for Niloofar24
Member Avatar for HiHe
0
349
Member Avatar for harsh.khanna.37

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

Member Avatar for HiHe
0
138
Member Avatar for Niloofar24
Member Avatar for joy agnes

Maybe it should be called "spineless shoulder surfing crime". Maybe something the North Koreans do.

Member Avatar for HiHe
0
189
Member Avatar for vegaseat

I am not sure if a password like ABCCBA having a double character like CC would be a good idea.

Member Avatar for Lardmeister
3
1K
Member Avatar for vegaseat

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 …

Member Avatar for vegaseat
2
3K
Member Avatar for MasterChat
Member Avatar for RobertHDD
0
189
Member Avatar for sweetsmile

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.

Member Avatar for sweetsmile
0
481
Member Avatar for avishekh.bharati

Look at any computer language as a toolbox. C++ has a lot more tools in the box than C.

Member Avatar for vegaseat
0
193
Member Avatar for divinity02
Member Avatar for Nancy 92

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"] …

Member Avatar for HiHe
0
12K
Member Avatar for EdJones
Member Avatar for tabanpanoam
0
278
Member Avatar for Slavi

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.

Member Avatar for HiHe
1
289
Member Avatar for masterinex

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); // …

Member Avatar for rubberman
0
651
Member Avatar for HiHe

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 …

Member Avatar for vegaseat
0
1K
Member Avatar for My_1
Member Avatar for HiHe
0
96
Member Avatar for ameer.idreis
Member Avatar for xela_1

GUI programming is tough with C, see: http://ubuntuforums.org/showthread.php?t=1359096

Member Avatar for HiHe
0
227
Member Avatar for webecedarian

If you use ProtonMail, you might become a suspect in the eyes of the all powerful government.

Member Avatar for <M/>
0
208
Member Avatar for MasterChat

<M/> you can sleep when you get old. Vacations are for doing wild stuff!

Member Avatar for sweetsmile
0
184
Member Avatar for Xantipius
Member Avatar for Chem_1
Re: IDE

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

Member Avatar for sneekula
0
679
Member Avatar for ~s.o.s~
Member Avatar for chloe.baee

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.

Member Avatar for Agilemind
0
430
Member Avatar for ddanbe

Presumably it will be more secure than previous Windows. Maybe the jump from 8 to 10 will confuse the hackers.

Member Avatar for ZZucker
1
407
Member Avatar for mattster
Member Avatar for vegaseat
2
201
Member Avatar for Ravi_exact
Member Avatar for Chtaylor5201

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': …

Member Avatar for vegaseat
0
426
Member Avatar for fonzali

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

Member Avatar for fonzali
0
345
Member Avatar for Jack_9

I would just write a DOS batch file and run that from Python with something like `os.startfile("mybatch.bat")`

Member Avatar for HiHe
0
3K
Member Avatar for Tcll
Member Avatar for oussama_1
Member Avatar for Warrens80
1
367
Member Avatar for Subin raj
Member Avatar for Jack_9
Member Avatar for Jack_9
0
179
Member Avatar for minitauros
Member Avatar for rebekah.stacy1

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 …

Member Avatar for vegaseat
0
528
Member Avatar for faultybits
Member Avatar for krishna bharath

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

Member Avatar for HiHe
-2
350
Member Avatar for tarmer

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.

Member Avatar for vegaseat
0
195
Member Avatar for OnEaglesWingsjf

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

Member Avatar for HiHe
0
127
Member Avatar for mark103
Member Avatar for vegaseat

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 …

Member Avatar for HiHe
2
21K

The End.