Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
77% Quality Score
Upvotes Received
16
Posts with Upvotes
13
Upvoting Members
11
Downvotes Received
5
Posts with Downvotes
4
Downvoting Members
4
2 Commented Posts
~93.1K People Reached
Favorite Forums
Favorite Tags
Member Avatar for halo_123

1)Create a list of the odd numbers between 1 and n (include 1 as well as n -- if it's odd-- in the list). Associate the list with the variable odds . 2)Given the list my_list containing integers, create a list consisting of all the even elements of my_list . …

Member Avatar for PartVIII
-11
2K
Member Avatar for Cup of Squirrel

I've skimmed the manual and cant find the answer to this anywhere: In basic, to add an Input function you would do (for example): [CODE] Input "What is your name? " name$ [/CODE] How do I do this in Python?

Member Avatar for Jason_15
1
17K
Member Avatar for iuessele

I am a total newbie to programming. I was hoping to learn how to write a program that prints out a string representation of a random card from a deck of playing cards. The programs should use either “A”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “10”, “J”, “Q”, …

Member Avatar for alexander.selin.7
0
13K
Member Avatar for keyoh

I'm working on a cleanup script for tv shows that I download. Right now I'm just looking for a file greater than 50mb, but there should be a better way. [CODE] import os import shutil dir = "C:\Users\Bobe\Downloads\TV\\" for folder in os.listdir(dir): if os.path.isdir(os.path.join(dir,folder)): for file in os.listdir(dir + folder): …

Member Avatar for The Geek Scope
0
5K
Member Avatar for mahela007

Is it possible to keep writing the output of a program on the same line instead of moving to a new line every time? The output should be written over the preceding output. An example would be a kind of counter... say a number that counts from 1 to 10 …

Member Avatar for Lucaci Andrew
0
11K
Member Avatar for Deepak.G

Hi I'm having a test suite in python and i would like to email the result through my company server. I used a similar code but the code seems to be hung while waiting for a response from server during socket.connect() call. I traced the code and found that it …

Member Avatar for rogerkrush
0
1K
Member Avatar for lewashby

In the following program, I have three different comments each after a line of code. Please read those comments to answer my questions. [CODE] # Property Critter # Demonstrates get and set methods and properties class Critter(object): """A virtual pet""" def __init__(self, name): print "A new critter has been born!" …

Member Avatar for lrh9
0
260
Member Avatar for mn_kthompson

For those of you that are familiar with wx... I'm just dipping my toe into the world of wxPython and I've been trying to put together a very simple Wizard app. Right now I have code that is working properly, but I'd like to know how I can change the …

Member Avatar for mn_kthompson
0
136
Member Avatar for baskar007

I have a list of part files (that is many parts of single file). I want to append all parts into a single file to make a full file. I used this code: [CODE] import os l = ["home/baskar/1.part","home/baskar/2.part","home/baskar/3.part"] source_file ="/home/baskar/source.file" re_size = 0 buffer = 10*1024 #10 KiB's for …

Member Avatar for Archenemie
0
182
Member Avatar for Musafir

[CODE]def main1(f): return (f - 32) * 5.0 / 9.0 def main2(c): return 9.0 / 5.0 * c + 32[/CODE] the two function above convert fahrenheit and celsius I have to write a third function which calls the two functions above and allows the user to input to convert between …

Member Avatar for sneekula
0
388
Member Avatar for ffs82defxp

Its not running [CODE]import math import os cls = os.system("cls") title = os.system("title Pythagorean Theorum Solver") def MainLoop(): cls print "Enter 3 coordinate plane points (x - y) format" print "" firstPair = input("--> ") SecondPair = input("--> ") MathPart() def MathPart(): '''structure of the formula: squareRoot of --> (x-y)^2 …

Member Avatar for vegaseat
0
140
Member Avatar for leegeorg07

Hi again, I'm now working on a twitter client and I'm wondering how people update their programs when it needs it, for example when I commit a change. Any help on the subject would be most appreciated thanks

Member Avatar for Stefano Mtangoo
0
194
Member Avatar for Archenemie

28 Minutes Ago | Add Reputation Comment | Flag Bad Post One last problem with my script, it returns this error message... [CODE]Traceback (most recent call last): File "C:/Python26/Renamer 3", line 23, in <module> os.rename(fname, b)WindowsError: [Error 2] The system cannot find the file specified.Traceback (most recent call last): File …

Member Avatar for Archenemie
0
212
Member Avatar for Archenemie

Just like in the title, instead of renaming the files in the "target folder" it just renames all possible files in the python directory, and im not sure how to fix it, although this is my best attempt. [CODE] #!usr/local/bin/python import re, os from os.path import join as pjoin targetfolder …

Member Avatar for Archenemie
0
195
Member Avatar for mn_kthompson

I have some processes that I need to keep running on a linux host. For some reason the processes are dying (possibly being killed by another admin). I can hunt that down later, right now I need to make sure the processes are running and relaunch them if necessary Launching …

Member Avatar for donaldw
0
130
Member Avatar for lewashby

In the following program, at what point does my program call the _str__ method/constructor? I don't see it specifically being called at any point. I know it happens with this line print [CODE]"Printing crit1:" print crit1[/CODE] but I still don't see how or when this happens. Thanks for any and …

Member Avatar for mn_kthompson
0
198
Member Avatar for sravan953

What do you mean by: "but I don't know how to add something to the dictionary while the program is running"?

Member Avatar for mn_kthompson
0
108
Member Avatar for HiHe

Does anyone use Python on a Windows7 machine? What is your experience? Does it work well? I am thinking about getting a new computer and also start some Python programming.

Member Avatar for mn_kthompson
0
107
Member Avatar for lewashby

I'M reading the book "Python Programing second edition for the absolute beginner". While explaining the object paramater whithin a class, this how it reads. Base your class on [I]object[/I] , a fundamental, built-in type. Can someone please tell me what that means? Thanks.

Member Avatar for mn_kthompson
0
127
Member Avatar for J-M DESMETTRE

Hi, I wrote this sample code to check the integrity of an IBAN (International Bank Account Number) bank account number. (See Wikipedia for further information) Any advice to simplify this? [code=python] # # IBAN_Check.py # Utility to check the integrity of an IBAN bank account No. # Python 2.5.1 # …

Member Avatar for orinbai
0
3K
Member Avatar for calccrypto

I wrote my own sha implementations but i cant get them to read files correctly. i know to use [CODE]open(file,'rb').read()[/CODE] as the input into the algorithm, but [CODE]import hashlib hashlib.sha1(open(file,'rb').read()).hexdigest()[/CODE] and my code [CODE]sha_1(open(file,'rb').read())[/CODE] return two different hashes. any idea why? i know that a normal string will have the …

Member Avatar for mn_kthompson
0
142
Member Avatar for denniskhor

I want use MD5 to compare both folder in Python. Following steps that i want to compare both folder by using MD5: 1. After all the files downloaded to folderA. 2. All the files inside folderA will copy to folderB. 3. Then MD5 will compare both folder is correct hash. …

Member Avatar for vansoking
0
1K
Member Avatar for figved

I have written a script for scraping a web site, and it works fine. What does not work fine, is when I try to use the write function, to write the results to a txt-file. I am trying to run this: import BeautifulSoup, urllib2, re, time import codecs path='C:/Users/Me/Documents/Python' outfile=open(r'C:/Users/Steinar/Documents/Python/Vegvesen/vegresultat.txt', …

Member Avatar for pythopian
0
310
Member Avatar for xm1014

Hello everyone, I'm learning Python and I have a few questions about Dictionaries and sorting them by a value other than the key. Lets say, for example, I have a Dictionary full of data that needs to be sorted on the 3rd value instead of the key. How would I …

Member Avatar for vegaseat
0
440
Member Avatar for lewashby

I am currently reading two books, one on PHP and one on Python. Not that I'M good at ether. I'M about half way through the book on PHP or less and almost done with the one on Python. Though I haven't actually read anything web related in this particular Python …

Member Avatar for pythopian
0
626
Member Avatar for saikeraku

I'm just wondering what do I have to add to the code [code] print "Hello World" [/code] to output H e l l o W o r l d like there's spaces in between each letter? Thanks.

Member Avatar for pythopian
0
123
Member Avatar for pyprog

Assume I have a file of the following format: a,1 b,2 c,3 d,4 Here is my code: [CODE]def junk(f): d1 = {} d2 = {} for line in f: columns = line.split(",") letters = columns[0] numbers = columns[1] d1[letters] = numbers d2[numbers] = letters return (d1, d2) def something(): print …

Member Avatar for vegaseat
0
171
Member Avatar for gangster88

I have to get pthagaros to get the distance between 2 points. so the function distanceBetweenPoints(Point(1, 2), Point(4, 6)) should result in 5.0. the parameters are supposed to be P1, P2, which i think i have done?. The get an error when i try to execute this?.. help please def …

Member Avatar for gangster88
0
171
Member Avatar for Fo_Be_La

Hi everyone, I'm trying to write some code for this question. I believe I have the right answer but it says it isn't. Anyways here is the question. 1) Given that dict1 refers to a dictionary, change the value mapped to by the key 'Boo' to 'Hoo' . My code …

Member Avatar for Fo_Be_La
0
155
Member Avatar for kisan
Member Avatar for Gribouillis
-1
189