Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
28% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
3
Posts with Downvotes
2
Downvoting Members
3
1 Commented Post
~41.1K People Reached
Favorite Tags

17 Posted Topics

Member Avatar for vegaseat

Here's one toy script I'm going to write when I'm ready: convert a number expressed in decimal digits to a number expressed in a standard way in English words, and vice-versa. (For example, convert 2,733.89 to "two thousand, seven hundred and thirty-three point eight nine" and vice-versa.)

Member Avatar for vegaseat
20
18K
Member Avatar for farmwife

Here is a plan for a (relatively) random numeric dictionary I've put together. I'm hoping that people can help me refine the plan so that I can start incremental coding: #! usr/bin/env python # creates a random dictionary from random import randint # user inputs maximum length of dictionary # …

Member Avatar for vegaseat
0
217
Member Avatar for farmwife

"Active cracking" means indirectly changing a plaintext message so that it becomes a totally different, plaintext message that says something totally different but still makes sense, by creating a brand new encryption key that is applied to the ciphertext itself and changes the ciphertext rather than the original plaintext. I …

0
140
Member Avatar for chris99

Just as an aside, a way to eliminate duplicates from lists, which the OP asked about: list1 = [1, 2, 7, 3, 9, 2, 3, 5, 1, 0, 9] set1 = {list1[x] for x in len(list1))} list2 = list(set1) # can optionally redefine list1 Although I'm sure that code could …

Member Avatar for farmwife
0
6K
Member Avatar for Ancient Dragon

I'm assuming the laptop is 64-bit. Did you choose the 64-bit version of Ubuntu? I've never tried the 32-bit version and don't know if that might be causing the issues with your graphics hardware.

Member Avatar for farmwife
0
622
Member Avatar for farmwife

The Software Manager offered both python-tk and python3-tk for install, so I installed both. The latter permits me to import tkinter as a whole, while the former does not. Instead, the python 2.x version chopped tkinter up into several submodules that must be imported separately, which is a major nuisance. …

0
172
Member Avatar for somjit{}

I also want to know whether 64-bit is that much of an advantage over 32-bit, considering that my Mint Cinnamon 64-bit kept crashing after install so badly that I had to uninstall it. In my case it was a problem with my PCIE-16 graphics card.

Member Avatar for farmwife
0
367
Member Avatar for RHNation

def inputt(input_string): while True: outputt = raw_input(input_string): Try: float(outputt) == float(abs(int(outputt))) except ValueError: print("Not a valid number. Please enter a valid number.") else: return float(outputt) def evaluate(miles_driven, gallons_used): return miles_driven / gallons_used miles_driven = inputt("Please input miles driven: ") gallons_used = inputt("Please input gallons used: ") mpg = evaluate(miles_driven, gallons_used) …

Member Avatar for farmwife
0
301
Member Avatar for onalenna.bobeilwe

#! /usr/bin/env python def verify(username, password): if username == "aladdin" and password == "sesane": return True else: return False username = raw_input("Enter username: ") password = raw_input("Enter password: ") result = verify(username, password) if result: pass else: print("Invalid input.") Although it could probably be done much better by a more …

Member Avatar for farmwife
0
234
Member Avatar for farmwife

This error frustrates me when I want to iterate over the elements of a set, for example when trying to convert the set to a list. How do I get around it?

Member Avatar for farmwife
0
7K
Member Avatar for farmwife

As I've learned more about basic console Python script writing, I've had a look at both Tkinter and GTK+...and, at first glance, I like GTK+ better. Which do you guys prefer, and why?

Member Avatar for farmwife
0
4K
Member Avatar for farmwife

Which of these is the best practice for executable Linux scripts: #! usr/bin/env python #! usr/bin/python #! usr/bin/env python3 #! usr/bin/python3 All four of them work just fine on my system, so I'm looking for the best practice. Thanks.

Member Avatar for james.lu.75491856
0
244
Member Avatar for farmwife

This code: def reverse(x): for i in range(len(x)): y[i] = x[-(i+1)] return y a = [1, 2, 3, 4, 5] b = reverse(a) returns a "global variable 'y' not defined" error. WHAT GLOBAL VARIABLE????? If I add 'y = []' anywhere in the code, either inside the function or outside …

Member Avatar for james.lu.75491856
-1
178
Member Avatar for farmwife

I had a function all by itself in the file [filename].py, and the file was properly executable. This is how people advised me to call it externally: import func func.[filename]() But I was getting errors all over the place. So I contacted Python help and they told me something different, …

Member Avatar for farmwife
0
179
Member Avatar for farmwife

Okay, so cryptography is insanely well developed and I'm not doing anything new here, but I still thought I'd monkey around with a cryptography project. Here's what I want it to do: 1) generate an encryption and decryption key that is randomly between 20 and 40 digits long and contains …

0
105
Member Avatar for farmwife

Suppose you have this file named func.py: def func(x): y = raw_input(x) return y func(z) And then you have this calling code: z = raw_input('Type a request for input and hit enter: ') omega = execfile('func.py') print(omega) Why does the output always end up being "None?"

Member Avatar for farmwife
0
1K
Member Avatar for TrustyTony
Member Avatar for farmwife
0
1K

The End.