15,406 Topics
![]() | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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 | |
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 | |
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 … | |
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 … | |
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, … | |
**Bold Text Here**Hi there I'm just wondering what the best or a good table layout would be for a little project I'm trying to do at work. I work at a temp to perm agency where companies use us for the probationary peroid of employement and then hire the workers … | |
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 … | |
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 … | |
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 … | |
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': … | |
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 … | |
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? | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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") | |
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? … | |
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 … | |
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 … | |
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 … | |
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... … | |
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 … | |
since the forum has been quiet for a while I thought to post this program , it might start new discussions . the idea is not new but it should be interesting to starters . as usual any comments is appreciated | |
Can someone please help me? I am using python 2, on mac yosemite thanks Also this is a project by me its a private server for closed toontown online so i have permission to use this. defaultText = "" def __inject_wx(_): code = textbox.GetValue() exec(code, globals()) def openInjector_wx(): app = … | |
Hey,fellow coders!:D I need some help with how to loop the following script until the right input is given:>>> className=input("Are you enetring results for class a, class b or class c:>>>") | |
I use python 3.4.2 + django 1.8 + Mysql database. + Table persons with blob fields in which a photo of a person My question is how can I retrieving and saving a photo with django. | |
Write an expression whose value is the result of converting the str value associated with s to an int value. So if s were associated with "41" then the resulting int would be 41. | |
I am using Tkinter to make a gui to display the output from a usb camera. It is for a microscopy experiment with the idea being that the gui shows a low resolution live stream, but at the click of a button a high resolution image is taken. I have … | |
I have my instructions in the top of my code. But for some reason when I input a decimal and then return my error message like it is supposed to then I input a valid amount it prints everything twice, once for the valid input then once for the valid … | |
Hi Everyone. History: i am self taught developer (5 years + ). mostly doing simple automations in 3dsmax / foundy nuke, maya etc. i worked at a studio (film / animation) as Technical Artist. My weaker side is (server / client). i have done basic sockets tutorials etc to send … | |
Hi, I have text file where I have these lines with numbers: e, 1, 2 e, 1, 3 e, 2, 1 e, 3, 4 etc. I need remove similar lines, in this case line e, 2, 1. Is it possible? | |
Please take a look at the following codes and explain what’s happening here: a = 256 b = 256 a is b #True its ok c = 257 d = 257 c is d #False why e = 258; f=258; e is f //True // why? | |
Here is the CSV file that I am working with: `"A","B","C","D","E","F","G","H","I","J" "88",18,1,"<Req TID=""34"" ReqType=""MS""><IISO /><CID>2</CID><MemID>0000</MemID><MemPass /><RequestData><S>[REMOVED]</S><Na /><La /><Card>[REMOVED]</Card><Address /><HPhone /><Mail /></ReqData></Req>","<Response T=""3"" RequestType=""MS""><MS><Memb><PrivateMembers /><Ob>0-12-af</Ob><Locator /></Memb><S>[REMOVED]</S><CNum>[REMOVED]</CNum><FName /><LaName /><Address /><HPhone /><Email /><IISO /><MemID /><MemPass /><T /><CID /><T /></MS></Response>",0-JAN-10 12.00.02 AM,27-JUN-15 12.00.00 AM,"26",667,0 "22",22,1,"<Req TID=""45"" ReqType=""MS""><IISO /><CID>4</CID><MemID>0000</MemID><MemPass /><RequestData><S>[REMOVED]</S><Na /><La /><Card>[REMOVED]</Card><Address /><HPhone /><Mail /></ReqData></Req>","<Response … | |
I want to change the color of a text in a given label of a Tkinter using dynamic function Say I have a string s where the data may comes from any serial interface "A or D" If A arrives in my string I want to print that in green … | |
Hi, I am not using Python but I have script in python: part of script `elif line.find("CONECT") > -1: con = line.split() line_value = line_value + 1 #print line_value #print con[2] try: line_j = "e" + ', ' + str(line_value) + ', ' + con[2] + "\n" output_file.write(line_j) print(line_j) line_i … | |
So my semester is almost over and I was dumb when I signed up for intro to programming distance learning, I thought I would understand it, but now I guess I know I can't. Anyways here is the problem. A speeding ticket fine policy in Podunksville is $50 plus $5 … | |
Hi Everyone, I am trying to automate SOAP Web Services using SUDS Python. We use a very complex SOAP XML web operation. So, my requirement here is to generate or create xml request. I will be providing all the required values for the Web Operation to go SUCCESS in an … | |
Hello guys,i have been stuck for days while trying to find how to solve this python problem. here is how the code looks like: set1=['78','18','79','56'] set2=['13','40','16','04'] set3=['63','70','78','60'] set4=['10','35','66','13'] set5=['32','41','71','70'] set6=['50','58','02','11'] set7=['13','40','41','05'] set8=['12','52','50','60'] set9=['71','13','66','12'] set10=['50','90','73','41'] set11=['09','18','44','54'] set12=['12','41','32','67'] Big_Set= [set1, set2, set3, set4, set5, set6, set7, set8, set9, set10, set11, set12] def … | |
I am importing event info from csv files and I'm having trouble with the event time. Event times are 12-hour time: hours:minutes am/pm. I converted the strings to datetime objects because the sort function wasn't working with the times as strings using `lambda`. Next, I drop the date info (that's … | |
At my current job me and the rest of the staff that work in my area are uisng a lot of files that when opened look like PDF files but there not. They're actually .exe files and the the program that opens them is called Omni Form Mailable Filler. I've … | |
I found that one can use dictionaries to hold Tkinter widget config and display parameters. This then permits one to have these dictionaries elsewhere in the code for easy modification instead of buried within the code for each widget. I particularly like to place these dictionaries toward the top of … | |
I have been learning NumPy arrays/matrices in Python. As I worked, I found that I desired a more readable form of 3d matrices. So I figured that writing one would be a good goal and learning exercise. The goal was to create a function that would print 3d NumPy matrices … |
The End.