15,175 Topics

Member Avatar for
Member Avatar for Julie_2

Program 8— Social Security Number Validation In this project, you will write a program to prompt the user to enter their social security number in the format ###-##-#### and then determine if the input is properly formatted. A properly formatted social security number will have: • A length of 11 …

Member Avatar for Anton_7
-1
3K
Member Avatar for <HHH>

i'm trying to import random & urllib.request libraries in sublime test but it give my the below error File "C:\Users\7oss\Desktop\print.py", line 47 import random IndentationError: expected an indented block Any ideas ?

Member Avatar for rproffitt
0
164
Member Avatar for Bashy345

Trying to make the user write to a file and seeing if it exists and if they should override it print("Enter a file name to save your database to.") name = input('Enter name of text file: ')+'.txt' if name print ("Would you like to overwrite this file? Yes or No") …

Member Avatar for Gribouillis
0
272
Member Avatar for Niloofar24

Hello. I want to insert data into django db from a function in the **views.py** file. I'm using **linux**, **python 3.4**, **django 1.8.2**, **PyMySQL**

Member Avatar for Niloofar24
0
12K
Member Avatar for render786

I am currently working on a code and there are three tasks. I am struggling on the last task - I have rearched alot and asked my teachers, i'v tried a variety of codes but there hasnt been any luck. Here is the task: complete all tasks and provide evidence …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Niloofar24

Hello. With running this command: `python manage.py validate` I faced with this error: `Unknown command: 'validate'` What should I do now? For more explanations: - Linux - Virtualenv - Python 3.4.3+ - Django (1, 9, 2, 'final', 0)

Member Avatar for Niloofar24
0
316
Member Avatar for pirulo64

Hello everyone, I'm trying to get a python script to run base on the os release and if its physical or virtual machine. If its virtual the script will NOT run, but if its Physical the script will run base on the os release level. I'm a little bit confusing …

Member Avatar for Gribouillis
0
497
Member Avatar for Matt_20

Hello, I have done a little research as I want to create a piece of software. I discovered that the language I should learn was Python and that it should be easy to learn. I have started to read the information but I learn by doing so I thought I …

Member Avatar for Matt_20
0
377
Member Avatar for seher_2

**i want to normalize these ingredients values to range of 0,1 my question is how to pass how dictionary to function? and recieving as a arguments** sample code def normalize(d, target=1.0): raw = sum(d.values()) factor = target/raw return {key:value*factor for key,value in d.iteritems()} Use it like this: >>> data = …

0
115
Member Avatar for jennga

So I'm starting to learn Python (3.43) code on my own time and my friend who is a major in Comp Sci made up a little assignment for me to try to complete although I have no class experience. So what I need to do is make some code where …

Member Avatar for Gribouillis
0
3K
Member Avatar for vegaseat

If you have a long message to display in a large readable font, then this little Tkinter GUI toolkit code might help.

Member Avatar for Mohamed_65
1
4K
Member Avatar for isla.rose.3

Here is the original task: * The Fast Freight Shipping Company charges the following rates: Weight of Package Rate per Pound 2 pounds or less $1.10 Over 2 pounds but not more than 6 pounds $2.20 Over 6 pounds but not more than 10 pounds $3.70 Over 10 pounds $3.80 …

Member Avatar for ashaa
0
3K
Member Avatar for ALosh99

I am trying to define the archimedean spiral: when im trying to define the inclination angle (incl) of the tangent vector to the orbit ( i.e: tan(incl)) im getting an error :"'numpy.ufunc' object does not support item assignment". the same error when I want to calculate cos(incl), and sin(incl). Any …

Member Avatar for Gribouillis
0
4K
Member Avatar for Ross_1

Currently within my code for my system i can't seem to get my system to only open up in one window. When i run my code it opens with two screens instead of the main one. I know this is due to the inheritance of my classes just not sure …

Member Avatar for Gribouillis
0
301
Member Avatar for Juli_1

How do I change string values in a variable? example: string = 'Hello' print(string) change string to 'Bye' <-- How do I do that? print(string)

Member Avatar for Reverend Jim
0
403
Member Avatar for TrustyTony

Sometimes we want to not split by every space character, but we want to split only on those outside of brackets and quotes. This way we can have for example quoted string as single argument for command. EDIT: 1. Added hierarchical nesting of same kind of brackets. 2. Bunching multiple …

Member Avatar for gamesbook
1
3K
Member Avatar for Tomas_3

Hello guys, I am Toni Hacker, i browsed through this forum and I saw you guys really talk more about programming. i wanna make an operating system but i need a team. please its gonna be an open project. I need your advice and help. anybody care to help

Member Avatar for Raul Perez
0
309
Member Avatar for jludeman

I' m trying to see if it is possible to write a keyboard only wxpython program. All of the tutorials I'm finding on the web when run have no focused control at all. That's fine if you expect the user to click with a mouse. I'll try to give a …

Member Avatar for jludeman
0
220
Member Avatar for pwolf

it says the following: Write a function that converts the time to 24hr format. Examples [CODE] >>> time24hr('12:34am') '0034hr' >>> time24hr('12:15pm') '1215hr' [/CODE] so i wrote the following: [CODE] def time24hr(tstr): a = tstr.split(':') am = {'12':'00','1':'01','2':'02','3':'03','4':'04','5':'05','6':'06', '7':'07','8':'08','9':'09','10':'10','11':'11'} pm = {'12':'12','1':'13','2':'14','3':'15','4':'16','5':'17','6':'18', '7':'19','8':'20','9':'21','10':'22','11':'23'} if 'am' in tstr: return am[a[0]] + a[1][:2] …

Member Avatar for Abhinav_4
0
3K
Member Avatar for المهندز

iam asking about chimical equations how can i programme it to the computer how can i make the computer understand that c+o2=co2 or naoh + hcl =nacl+h2o i mean how he understand that acid +alkail= water +salt

Member Avatar for rubberman
0
264
Member Avatar for Lazarus777

how to take a dictionary from this list ? Shop = ["Apple" , "orange", "mangoo" . "Tomato" . "grape"] #Example# $python shop.py > > 1. apple > 2. orange > 3. mangoo > 4. tomato > 5. grape > > > What will u buy? use number (1-5) : 2 …

Member Avatar for Lazarus777
0
250
Member Avatar for Aishah_1

Hi, i was wondering how to change the lable text in Python after clicking a button. For example: `from Tkinter import * `def onclick():` pass import tkMessageBox root = Tk() root.title("Pantai Hospital") L1 = Label(root, text='Welcome to Pantai Hospital!') L1.pack() L2 = Label(root, text='Login') L2.pack() L3 = Label(root, text = …

Member Avatar for DanDanPy3.4
0
5K
Member Avatar for Ossy009

I'm stuck on adding a feature to my program where a user types in the email address and stores email and raffle into a database.Also the raffle entires will be selected at random from all stores entries.heres my code from __future__ import print_function from random import seed, randrange, shuffle, sample …

Member Avatar for Ossy009
0
650
Member Avatar for tony75
Member Avatar for tony75
0
6K
Member Avatar for sam.tubb.75

I'm very new to the Raycasting algorithim, and was reading a webpage on how it works with CPP code to accompany. I followed what the page described and converted it into Python/Pygame and then ran it, but my result was *very* different. I have a feeling it has something to …

Member Avatar for andybe
0
302
Member Avatar for jarograv

I have the following section of code that works perfectly when I run it as a .py file. When I convert it to a .exe using py2exe it appears that the linecache.getline() function is not working properly. I am able to create and write the .txt file fine, so I …

Member Avatar for Gribouillis
0
335
Member Avatar for lewashby

import pymongo uri = "mongodb://127.0.0.1:27017" client = pymongo.MongoClient(uri) database = client['fullstack'] collection = database['students'] students = [student['mark'] for student in collection.find({}) if student['mark'] == 99.0] print(students) In the program above how does this work? Why is the `if` statement after the execution code? I would expect the `if` to be …

Member Avatar for Gribouillis
0
398
Member Avatar for ALosh99

I plot the archimedaen spirlas for one branch, how can I plot more than one branches starting from the original, my code that I have written : n= 1000 a= 2. # will turn the spiral v= 1 omega = 0.1 r0 = v/omega T=100 N=10000 t=np.linspace(0,T,N+1) r= v*t theta …

0
118
Member Avatar for tony75

HI There is many method to bypass Antivirus detection! The Best way is writing your own toolsespecailly using python language. My question is How to protect your self againt PE portable excuteble and how we make Antivirus to detect for example metasploit payloads? I will appriciate for yur help

Member Avatar for powerade661
0
443
Member Avatar for checker

so here is my code [CODE]from math import sqrt class ageName: "class to represent a person" def _init_(self): self.name = "" self.age = 0.0 self.sqrtage = 0 g = ageName() g.name = raw_input("Enter a name, or stop to exit: ") g.age = int(raw_input("Enter an age: ")) g.sqrtage = sqrt(g.age) list1 …

Member Avatar for Gribouillis
0
2K

The End.