15,179 Topics
| |
Write a program that asks the user to enter a series of 20 numbers. Store the numbers in a list and display the lowest, highest, total, and average of the numbers. Plus display enter a series of 20 numberes, find the lowest, highest, total, and average of the numbers in … | |
**Read title.** username = base64.b64encode(username)+'\n' This is what I thought would have worked, but it comes up with an error, "TypeError: can't concat bytes to str", meaning that I cannot add +'\n' to the end of the code. If there is anyway anyone knows how to write the byte of … | |
Hello! First time posting here so bare with me with my formating and other stuff. I've got a task were I'm going to create a caesar cipher. You should be able to write a sentance to the program and the shifting it should use. Then the letters should be shifted … | |
With the advent of Python33 the module time has received a high resolution timer/counter. Here we use time.perf_counter() in a decorator to conveniently time two test functions. | |
This language is built with python to give me a dynamic backend to make this possible. The language is based off ASM opcodes but generalizes them into basic coding practices. More info here: http://tcll5850.proboards.com/thread/271/umcsl note: WIP the language is meant to make it possible to convert between ASM and other … | |
give a grammar and example of if statement for each of the following languages: a)perl, b)python | |
String input has changed from Python2's raw_input(prompt) to Python3's input(prompt). The old Python2 numeric input(prompt) has gone away with Python3, all input is now string input. The snippet shows a few lines you can add to your program such that you only need to use input(prompt). This makes your code … | |
cut_list We have to use a cut_list by writing a function called cutlist that "cuts" a list. Whwew a list and an index is given, and returns a copy of the list, but the items before and after the index is swapped, but what i dont get is it should … | |
I am using Python 2.7.8. I installed the following: py2exe-0.6.9.win32-py2.7.exe and pywinusb-0.3.3 I have a script that I am trying to run. When I do I get the following error: C:\Python27\MyScripts\VMS\Python_Firmware_Upgrader-4_00_02\Python_Firmware_Upgrader\python-msp430-tools\win32>python ./setup-combined-tools py2exe.py changed directory to C:\Python27\MyScripts\VMS\Python_Firmware_Upgrader-4_00_02\Python_Firmware_Upgrader\python-msp430-tools running py2exe *** searching for required modules *** Traceback (most recent call last): … | |
I am not looking for anybody to do the work for me - I have a questions I am trying to get answered as I go thru trying to learn - I am ahead of myself but am looking to the future I am looking to create a soccer simultor … | |
What's wrong with: def project_to_distance(point_x, point_y, distance): dist_to_origin = math.square_root(point_x ** 2 + point_y ** 2) scale = distance / dist_to_origin temp1= point_x * scale temp2= point_y * scale print temp1, temp2 print project_to_distance(2, 7, 4) | |
This is a simple problem that for some reason I can't get to work. The problem I created for myself was to use call a function from a function using *args and print out the question and solution. I want the output to vary as the *args can accept any … | |
Hi guys, I have added the list of buttons for the channels and programs in the xbmc skin. I have one yellow box on the channel and program box for both buttons. I want to know how I can move the yellow box to go to the next program when … | |
The idea of this thread is to help the beginning wxPython GUI programmer with hints and helpful code. Please feel free to contribute! If you have any questions start your own thread! For info on wxPython modules see: http://www.wxpython.org/docs/api/wx-module.html | |
Hi I dont want the extra bracket inside the list thats been outputted so how would I fix that? This is the code: def my_code(list1, list2, index): index = ['a','b','c'] list2 = [2] list1 = [1,2,3] list1.insert(2,index) return list1 and it returns: [1, 2, ['a', 'b', 'c'], 3] I dont … | |
Hello. I work for a company that does alot of stuff with python and I was wondering what methods are better then the one I use for finding a bug in millions of lines of code. What I like to do is find out what the bug does. Let's just … | |
I want to use Python to make something similar to the fc command found in MS-DOS and Windows. How would I handle opening 2+ files and reading them a byte at a time for comparing? | |
Does anybody have some experience with the iPython notebook? How do you get started? | |
hi, pls i have written a set of codes for a program and i want to deselect the radiobutton and also clear the contents of the entry widgets,the entry widgets get cleared tho. thank you def adduser(): name = "Name: " + entry_box1.get() reference_number ="Reference_number: " + entry_box2.get() room_number = … | |
print ("The scope of this program is to multiply two matrices together\ and print the result") while True: matrix1_rows = input("How many rows does matrix one have? ") matrix1_columns = input("How many columns does matrix one have? ") print ("Matrix one is a", matrix1_rows, "x", matrix1_columns, "matrix") print() matrix2_rows = … | |
For class, I had to write a simple program that would calculate the surface area and volume of a torus. I did that, but my answers are long decimal numbers. How do I get the answer to round off? Thanks in Advance | |
Does anybody have a good example of a Functor in Python? | |
Run two calls to a function simultaneously with this threading @background decorator. | |
Hello, sorry for the rudeness for asking for help on the first post but I'm still a beginner in programming. I am trying to create a GUI for plotting function using Tkinter and Python. In the top a label will show the current position of the mouse in the canvas … | |
I downloaded daily build and did python3 setup.py build and then python3 setup.py install So far so good! I tried import wx and no errors I tried to run the program [here](http://wiki.wxpython.org/Getting%20Started#Getting_started_with_wxPython) and all I got was the error below. Have anyone got wxPython working with Py3 especially on Linux … | |
Hi!, i need to convert the string of a function in binary. In this case, i need to convert the return of the function swap() into binary to compare it in Mensaje_codificado() but it doesn't work. This is my script: - Thanks! Binary function: def numero_binario(x): i = 0 b … | |
We have date "30-DEC-99" in oracle database but when our code reads that date is reading like "datetime.datetime(1899, 12, 30, 0, 0)", why the year 99 is reading like 1899 rather 1999? how do I fix this issue? please suggest. | |
| |
Hi, I have this def update_labelain0_val(self): val=get_ain0() self.labelain0_val.set(val) self.labelain0.config(bg="#32CD32") #0-12.9v -> 0-6000N valain0=float(val) valain0_calc=valain0*6000/12.9 valain0_calc=int(valain0_calc) self.labelain0_calc.set(valain0_calc) self.labelain0calc.config(bg="#FF8C00") threading.Timer(0.1, self.update_labelain0_val).start() return This is part of a class which update a label in a window. It is working fine. My problem is : how can i give a variable name o this … | |
well .. i found out that python is easy language prog. for beginner like me .. but at 1rst am looking for some advices from proff. programers and i found some videos by Dr.Andrew N.Harrington from chicago on http://anh.cs.luc.edu/python/hands-on/ .. |
The End.