15,181 Topics
| |
Hi, got a quick quickie... Im trying to send commands to a micrcontroller via a USB->serial converter. Im writing with wxPython on an XP machine it thats important. I have been using the win32 module along with USPP and so far so good, apart from one thing. As far as … | |
i have been working on this course work i got my hands on to learn python, and i have just been working on an exercise, i was wondering if i perhaps cheated though? The exercise says the following; write a function that takes a list of real numbers and returns … | |
I'm having trouble with an application in Tkinter. The program displays a button that has a picture on it and that button takes you to a website about that picture, but that is not where the issue lies. There is another module that I have found on an internet tutorial … | |
Hii im Python Programmer , and i want to start write application to android operating system. i can to develop with python? and i want that the Client will be run the application without something installed before (Like Python interepter and etc) How i can ? Thnaks! | |
Python was my first programming language and I have been programming for about 5 years now. I LOVE Python, but there is one thing I haven't got myself to believe yet. In the Zen of Python one of the entries is: "There should be one, and preferably only one, obvious … | |
hi, i would like to parse an input file (input.txt) into output file (output.txt) which i'll into excel. appreciate any advice on how to parse the input.txt into output.txt. thanks johnny | |
"del" allows you to delete elements from a list for example... [CODE] # Makes list, note in python when addressing an element, the first element is 0, the second is 1. a = [1,2,3,4] # [0,1,2,3] shows how python "reads" the location. # Prints elements in list a print a … | |
Hello friends , I just need to know if I can print a Tkinter window on paper , if yes i need to know how , it is a window of a form of a new inscription . Thank you very much :) | |
hi, attached is my sample file. i want to extract all lines starting from -- num until before -- Advanced. appreciate if anyone can show me. thanks johnny | |
well this is the first time i am trying to make a module, i saved the .py file into a new directory called MyModules and tried to import it in IDLE, but it returned the following error; Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> import polymod … | |
Hi, I have python script where I've extracted many p-values. The next step is to calculate the ROC-curve, or i.e. the AUC (the area under the curve), for these p-values. I'm not excactly sure on how to calculate the ROC (e.g. exactly what it takes as input) and I'm also … | |
Hello, I am fairly new to Python. I have only skimmed the surface in an introductory class I just finished in college. As my first program in Python, I am attempting to make a text editor. I am wondering if there is a universal command to bring up a Save … | |
If there's a list like below [CODE]s=['b','a','r','r','i','s','t','e','r'][/CODE] and if I tried to remove every 'r' from the list like this [CODE]>>> for x in s: if(x=='r'): s.remove(x)[/CODE] it gives the following result. [CODE]>>> s ['b', 'a', 'i', 's', 't', 'e', 'r'][/CODE] Why isn't the last 'r' removed from the list. | |
Hello I'm working on printing a grid of any size and labeling it numerically or alphabetically I have the code that creates the grid, but I have no idea how I would label it... Here is the code that crates the grid: [CODE] def grid(): y = 5 #int(raw_input("How tall … | |
okay, so i was doing an exercise for this beginning python course i got my hands on, and i just completed the exercise (took longer than it should have though) and for some reason, when i run it, it returns data i didn't expect, and when i run it again … | |
I've been googleing the syntax, function, and examples for these keywords, but to no avail: 1. as 2. with 3. assert 4. pass 5. yield 6. break 7. except 8. class 9. exec 10. in 11. raise 12. continue 13. finally 14. is 15. for 16. lambda 17. try Help … | |
You'll have to excuse me, I'm a complete python newbie, but am trying to import a pyd file that I've been sent by a friend. He assures me the file works fine on his computer but when I run [code] import myfile.pyd [/code], after having placed the pyd file in … | |
I am working on a project that requires a CSV file to be read into a multidimensional array. I loop through the array, and set multidimensionalarray[x][n] to the corresponding data in the CSV file, but I keep getting IndexError: list index out of range. I can't figure out why, and … | |
I'm trying to understand socket programming in python by experimenting a little. I'm trying to create a server that you can connect to by telnet and that echoes what you type in the telnet prompt. I don't want to start using threads just yet. This is my code. [CODE]import socket … | |
Hi, I am just starting to learn Python GUI programming with Tkinter. The majority of examples on net and books show the widgets and windows in typical MS Windows style (i.e the blue top border, holding the maximizing, minimizing and cancelling buttons), as shown in the first picture. Is there … | |
so im trying to make it so that pressing enter without inputting any value, will break the loop, however, an empty string can be used because of [ICODE]for i in range(len(x_str_array)): x[i] = int(x_str_array[i]) bit.[/ICODE] [CODE] 'Exercise 7.3' # modified program from exercise 7.2 a=1 z="" while x !=z: x_str … | |
Hi everyone, I'm trying to write a Python script, where it counts the specific results from a database. Running the following line in MySQL Client works: SELECT name, COUNT(*) FROM results WHERE name="bla bla"; And it returns all of the results fine. But I'm trying to put it into a … | |
Hey guys. Im having some problems with python. I need to create a function that takes in two arguments where the first is a sequence(string) of letters. The other is also a string but of integers, that tells me start and stop that I want to cut out from the … | |
Hello, i would like to ask you help with my code, i can't understand why exactly it doesn't work like i am expecting :). I am working through "How to Think Like a Computer Scientist" by Jeffrey Elkner, Allen B. Downey, and Chris Meyers so i am still doing my … | |
I am doing some hobby coding regarding neural networks, and I was wondering if this is a correct and good use of abstract base classes or not. [code=PYTHON]import abc import collections import math import weakref class AbstractNeuron(metaclass=abc.ABCMeta): def __init__(self, weights, f=math.tanh, bias=1, biasWeight=0): self.weights = weights self.f = f self.bias … | |
i have a problem with this code: [CODE]s = "johnny" j = 'j' y = 'y' re.search(rj'\w+'+y, s).group[/CODE] i want to put the j variable instead of the string, with the y variable its ok but with the j i got an error!!! | |
Hello Everyone, I am making a GUI using Tkinter... I have completed that the GUI now i want to put the validation on those Entry Widget,,,,,... i know, i have to use the re module...... but i really cannot understand that....can someone please give me the simple example...like if i … | |
im working on a tron game with pygame and i cant figure out how to make my tail that the player's car makes disappear after somany pixels. i want the tail to start shortening itself after like 500 pixels. if you can, can you post the full code edited (im … | |
<< This is my python code >> << (Step 1) - I am registering the class of this python file for this PythonUtil class by executing this code in the pythonwin.exe interpreter >> class PythonUtil: _public_methods_ = ['funct’] _reg_progid_ = "PythonUtil.Utilities" _reg_clsid_ = "{73B6791B-C161-4F26-9402-D4AE4BC602AB}" def funct(self, val, item=None): print “hi” … | |
im trying to write a tron game with python but when ever the tail starts to erase, it erases too much. try running it and you will see what i mean. when you run it drive over your tail and watch it delete too much. [CODE] import sys, random, time, … |
The End.