14,952 Topics

Member Avatar for
Member Avatar for ipman99

I just started to learn python few days ago. This is a small program I made to practise. print("Find Volumes of some Popular Solids") print("") names=['(1) Sphere','(2) Right Circular Cone','(3) Cylinder'] x=0 while x < 3: print(names[x]) x +=1 print('\n' + 'Enter the number of the solid, you want to …

Member Avatar for snippsat
0
2K
Member Avatar for Valmian

Hello, First of all, I'm sorry if my question seems silly, but I am very unfamiliar with Python. I am using a particular python code base which, in a Linux system, solves the problem I am working on (I am using Windows). A major part of the python code's task …

Member Avatar for Jim_9
0
16K
Member Avatar for PyGuy123456789

Given Problem: A professor at Hardtack University has an unusual method of grading. The students may or may not all take the same number of tests. The individual tests are weighted, and these weights are used to compute the student's average. Important: the weights for all of the tests for …

Member Avatar for Gribouillis
0
411
Member Avatar for Dat One Lefty

how could i download a empty file from a website and see if the lines are the same as a diffrent file on my computer?

Member Avatar for Taywin
0
205
Member Avatar for Chris.T

0 down vote favorite I'm using Wireshark packet analyzer & when I filter for all "Websocket" packets I see what I am sending /receiving to the host. When I check individual packets mine always show as [MASKED], but you can 'Umask Payload' which shows the data in clear text that …

Member Avatar for rubberman
-1
467
Member Avatar for Alok_3

Get difference of two text files in excel and highlighting the difference using python. eg. file1.txt alok|test1|test2|test3|test4 alok1|test2|aewer|262771|262772 Rest|t1|rang|banh|test Must|t1|rang|banh|test file2.txt alok|test11|test2|test3|test4 alok1|test2|aewer|262771|262772 Rest||rang|banh|test In excel the difference should be shouwn as below: file1.txt|alok||`test2`|test3|test4 file2.txt|alok|`test11`|test2|test3|test4 file1.txt|Rest|`t1`|rang|banh|test file2.txt|Rest||rang|banh|test `file1.txt`|`Must`|`t1`|`rang`|`banh`|`test` Basically if a record is present but with some field with different …

Member Avatar for Alok_3
0
507
Member Avatar for aragonnette

i want to convert my pdf files with ImageMagic python module PythonMagick but i havent found any solution on net. import PythonMagick im = PythonMagick.Image('files.pdf') im.write("file_img%d.png") i am using below code and it returns only first page of my pdf file. any help would be greatly appreciated

Member Avatar for AdeleB
0
7K
Member Avatar for tony75

Hi I ran python script on my windows and I got this error below ,how can I fix it? I'm using python 2.7.3 from pyasn1.codec.der import decoder ImportError: No module named pyasn1.codec.der

Member Avatar for tony75
0
11K
Member Avatar for Jonah_1

I am creating a text editor on a Mac and am having trouble with file saving. I can open, save as and save files but the save function stops working after I call `self.close`. I get this error: Exception in Tkinter callback Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line …

Member Avatar for Gribouillis
0
2K
Member Avatar for xopenex

hello, Using Python 2.7, PyQt4, Qt Designer, and used pyuic4... I think thats it... windows 7? I have a GUI i created in Qt Designer. It has one button and one LCD number. I was trying to get the button to start and reset a timer, and have the elapsed …

Member Avatar for Ehtisham_1
0
3K
Member Avatar for DragonMastur

I am trying to convert a file to a dictionary here is the contents of the file, Name: DragonMastur; Hand: None; Inventory: {"Gold": 0, "Brush": 0, "Twig": 0, "Sapling": 0, "Metal Axe": 0, "Grass": 0, "Metal Pickaxe": 0, "Metal": 0, "Log": 0, "Diamond": 0, "Stick": 0, "Stone": 0, "Wheat": 0, …

Member Avatar for Gribouillis
0
342
Member Avatar for pyguy25

Hello. I was wondering if anyone could help me with a caesar cipher program I am attempting to create. I was asked to write a caesar cipher encoder program. Ok. No problem. This is what i got: [code] import string def main(): print "This program will encode your messages using …

Member Avatar for FaZeSkwlSh00ter
0
7K
Member Avatar for NightOwl19

Heya guys, i've been learning python for few weeks now and it's one of the best decisions i have made in my life so far..it's quite an interesting language and very helpful for beginners, i must say..now i tried to do some tickling with django and somehow managed to install …

Member Avatar for Manjunath_3
0
360
Member Avatar for eman neercs

I'm trying to run a python script from the cron but get the error "No module named requests" Traceback (most recent call last): File "testscript.py", line 2, in <module> import requests ImportError: No module named requests The script will run from the console but not through a cron job. I …

Member Avatar for eman neercs
0
5K
Member Avatar for glao

Hello , I can't understand why this loop doesn't work as I wanted. Why the continue statement isn't executed. I want the code to count **only** the user input which is 1 or 2 and stop when the sum is >=25. i = 0 user = input('Enter '1' or '2': …

Member Avatar for glao
0
147
Member Avatar for Dat One Lefty

I am trying to make a MS-DOS like program like python. I am adding a system to see if a command exists. the file "known.txt" contains: ['catfish', 'cls', 'dl', 'hello', 'help', 'help1', 'help2', 'info', 'logout', 'ping', 'run', 'stop', 'time'] This is the code i am using to run it: if …

Member Avatar for Dat One Lefty
0
160
Member Avatar for Dat One Lefty

i keep getting this error: WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'F:/Term/cmdrun/new.log' how can i make the logging module stop loggin to new.log so it can be moved and renamed?

Member Avatar for Dat One Lefty
0
159
Member Avatar for Shailang

I am trying to work on some code that will fetch all hyperlinks from a webpage url using the python. The code works perfectly fine when i try to run the code at home network without my proxy. When i have to show the code to my teacher in my …

Member Avatar for Shailang
0
351
Member Avatar for mattster

Hi All, I've just tried to get going with Django using MySQL, but linking them has been a nasty headache. I am using Python v3.5, Django v1.9 and MySQL 5.6. I've definately got MySQL/Python talking, but Django always has the problem: File "X:\Program Files\Python\lib\site-packages\django-1.9-py3.5.egg\django\db\backends\mysql\base.py", line 25, in <module> import MySQLdb …

Member Avatar for cereal
0
600
Member Avatar for Jacktheclimber

Can someone please help me write a convertor for Hexidecimal to Decimal, has anyone found a way to allow for the entries to be able to be multiplied as integers, even if the input is a character and not a natural number. Thanks Jack

Member Avatar for vegaseat
0
198
Member Avatar for fonzali

hi , I have two different versions of python on my ubuntu machine : 2.7 and 3.4 . my question is how to tell sys.executable to use python 3.4 ? this is what I get when I run the code : `>>> import sys >>> print sys.executable /usr/bin/python which is …

Member Avatar for fonzali
0
989
Member Avatar for Tcll

so what I'm doing is building my own python IDE using PyQt. nothing can do what I need it to without a loss of something else, let alone properly. so I'm using a QPainter and getting the best results yet. however I'm having a problem trying to build indent guides …

Member Avatar for Tcll
0
474
Member Avatar for ajit.nayak

Dear all, I am looking for guideline to read data from website[photon](http://www.photon.info/photon_site_db_solarmodule_en.photon) . & load into csv file. Whenever new supplier selection or typesection change data should recorded into same excel with new sheet. Can some guide how to get started using python This code to develop for database. Is …

Member Avatar for jwenting
0
181
Member Avatar for rufael

we have the following code: I get the response (ValueError: Mixing iteration and read methods would lose data) Any help def extract_data(filename): def extract_data(filename): infile=open(filename, "r") #infile.readlines() v0 = infile.next() #or []/{}/ t=[] for line in infile.readlines(): t.append(line) return v0, t v0, t = extract_data("ball_file.txt")

Member Avatar for ~s.o.s~
0
511
Member Avatar for jarograv

Hi I am fairly new at pyhton and I am trying to create a program to append a new row of raw input to the bottom of my existing .csv file. So far I have this: [CODE]import csv x=1 y=1 n=0 citiesx=[] citiesy=[] city_names=[] total=input("How many cities do you have? …

Member Avatar for Wesley_1
0
13K
Member Avatar for Tomi_1

Hey people! Im new to the community, i will contribute with doubts hehe, so i have this list of lists: TABLE =[["_","_","_"], ["_","_","_"], ["_","_","_"]] i want to print it so it looks something like this: 1 2 3 _ _ _ _ _ _ _ _ _ how can i …

Member Avatar for vegaseat
0
150
Member Avatar for Brandon Hatch

I have no idea how to create a Gui from another Gui using python. What I have so far is simply a basic Gui which you select one of the options from a dropdown menu and create another Gui. Here's what I have so far... import sys from tkinter import …

Member Avatar for Brandon Hatch
0
2K
Member Avatar for Kadian

Write a python program called mystery that should ask you to enter the last digit of your cell phone number and also ask to enter your birth year. (Hint: Use the input command but be mindful that the value entered is a string.) a. Multiply the cell phone digit by …

Member Avatar for hericles
0
94
Member Avatar for Tcll

basically, I have some code defined to be executed in a restricted namespace: code = ''' def func(): print 'success' ''' NS = {} NS.update(__builtins__) exec code in NS try: f = NS['func'] print f # should print a function object f() except KeyError: print 'failure' as you can guess... …

Member Avatar for Tcll
0
514
Member Avatar for Philip_5

I am a beginner programmer and have been learning about how to use Java since February 2015 of this year. However, I just started learning how to write code in the Python Language, a few weeks ago and find it to be much easier to work with. My goal here …

Member Avatar for Lardmeister
0
405

The End.