15,406 Topics

Member Avatar for
Member Avatar for Tcll

just making a thread that will hopefully stick for a while... >_> I just need a little help and need to know a few things before starting on this... the main thing being the need to know how to build a good update system >_> my program will have a …

Member Avatar for Tcll
0
127
Member Avatar for AdampskiB

[CODE]# 619480 import time from random import * def main(): lst = [] result, length = 0, 500000 while result <= 0.50: for i in range(length): lst.append(randint(1, length)) value = randint(1, length) t0 = time.clock() linearSearch(value, lst) result = time.clock() - t0 print("This LINEAR SEARCH took {0:4.2f}seconds with a length …

Member Avatar for AdampskiB
0
161
Member Avatar for TrustyTony

While looking into [URL="http://www.had2know.com/academics/gaussian-prime-factorization-calculator.html?blankone=2&result="]Gaussian primes [/URL]I came to think additional ways to check for is number integer or not, what you think is best way? [CODE]epsilon = 1e-11 def is_integer(n): """ traditional abs, epsilon check for near integer """ return abs(n-round(n)) < epsilon def is_integer2(n): return (float(n)- int(n)).as_integer_ratio()[1] == 1 …

Member Avatar for TrustyTony
0
292
Member Avatar for arunpawar

This is very basic issue with me right now. I don't know how to write a function or class in python. I mean i know the syntax but i don't know how to escape from the indentation while typing on IDLE. For example [CODE]def sum(): var1=10; var2=20; sum=var1+var2; #how to …

Member Avatar for arunpawar
0
362
Member Avatar for Cenchrus

Can someone tell me, step by step, how python interprets this code? [CODE] Numbers = [1,2,3,4,5,6,7,8,9,10] Numbers[8:3:-1] [/CODE] I know that the "-1" is the counting bit of it, and it goes in the negative direction, but I'm lost on everything else... :(

Member Avatar for Cenchrus
0
171
Member Avatar for natehome

can someone please look over this code and see if they can make it run faster. if you make any changes will you comment it so i can see what you did. this is a personal project. thanks you very much [CODE]#Image manipulation library from PIL import Image import datetime, …

Member Avatar for TrustyTony
0
151
Member Avatar for KrazyKitsune

Title says all. I need to make a code that gives the prime factorization of a number and put them in a (this is important) a list.

Member Avatar for TrustyTony
0
179
Member Avatar for Cupidvogel

Hi, I want to iterate over a list, printing each item and subsequently deleting it, so that at the end, the list is empty, while all the numbers are printed out. I have tried two tactics (to me the logic for both is the same, just checked to spot the …

Member Avatar for Cupidvogel
0
88
Member Avatar for wilhelmO

Hello and good afternoon. I'm new to python an Tkinter. My task : a triggered camera writes 12 images every 70 seconds in a specific folder. The newest 12 images should be visible in a frame at 12 labels ( labels are able to display images ? ). I made …

Member Avatar for Gribouillis
0
159
Member Avatar for jantrancero

What i want to build is this: Sending a command to another computer and get the results back on the computer where i started on. Additional info: I have a web server running with python on 192.168.10.100:5000. When i go to this address i get a web page and on …

Member Avatar for Gribouillis
0
3K
Member Avatar for Andr3

Hey all! I have some questions about pythons capability of processing video fails. I would like to run and edit some files with pythhon. Can i use pygame or wxPython or do i need some other libaries? And does somebody have some example codes or helpful materials of video processing? …

0
98
Member Avatar for vegaseat

Version 2.6 of wxPython has support for playing animated gif image files. The example sets up a panel on a frame and then uses wx.animate.GIFAnimationCtrl() to do the hard work. Actually pretty simple code.

Member Avatar for woooee
1
2K
Member Avatar for Cenchrus

I'm typing the code: [CODE] import cmath import math print r"pow(2,3) returns 2^3 pow(2,3,1) returns 2^3 modulo 1" pow(2,3) pow(2,3,1) [/CODE] and I'm getting this error: File "sample2.py", line 26 print r"pow(2,3) returns 2^3 pow(2,3,1) returns 2^3 modulo 1" pow(2,3) pow(2,3,1) ^ SyntaxError: invalid syntax Why is this invalid syntax?

Member Avatar for woooee
0
887
Member Avatar for ni5958

Hi, i need to write a recursive function which gets a list and an integer k and returns a list of all the possibilities of creating sub lists to the length of k with the elements from the original list. i hope i was clear enough.. here are some examples: …

Member Avatar for Gribouillis
0
3K
Member Avatar for hisan

Hi All i have downloaded "xmldiff-0.6.10" from their official site (http:// [url]www.logilab.org/859[/url]). I have tried installing the same on my 32 bit Windows 7 OS using the command "setup.py install" but below exceptions are thrown in the console. please help me out in installing this package on Windows Exceptions thrown …

Member Avatar for robert99x
0
160
Member Avatar for betty2

Hi, how best can one put different images on a stack to form a single array. For example, |image1.flatten()| |image2.flatten()| |image3.flatten()| So that each row of the array would be a specific image.

Member Avatar for TrustyTony
0
39
Member Avatar for Ismatus3

Hello everyone, I generate an executable for an application in Python with Tkinter interface , on my machine when I double click on the executable the application execute well. The problem arises when I move the entire file on another machine, while there on a machine that executable runs from …

Member Avatar for telmo96
0
127
Member Avatar for khajvah

Hello people. I learning phyton and have a problem. [CODE]def Cel2Fah(temp): Fahren = str((9.0/5.0)*temp+32); return Fahren;[/CODE] I was asked to write a function which converts celsius to fahrenheit([url]http://www.pyschools.com/quiz/view_question/s2-q5[/url]). It says: "Return a string of 2 decimal places", but i dont know how to.

Member Avatar for telmo96
-1
111
Member Avatar for MarkWalker84

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 …

Member Avatar for mr_snarf
0
2K
Member Avatar for pwolf

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 …

Member Avatar for pwolf
0
293
Member Avatar for chris99

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 …

Member Avatar for chris99
0
2K
Member Avatar for BnayaArbel

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!

Member Avatar for Tech B
0
138
Member Avatar for WolfShield

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 …

Member Avatar for WolfShield
0
245
Member Avatar for tcl76

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

Member Avatar for tcl76
0
224
Member Avatar for Cenchrus

"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 …

Member Avatar for vegaseat
0
166
Member Avatar for Ismatus3

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 :)

Member Avatar for Ismatus3
0
109
Member Avatar for tcl76

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

Member Avatar for tcl76
0
636
Member Avatar for pwolf

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 …

Member Avatar for pwolf
0
580
Member Avatar for sofia85

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 …

0
77
Member Avatar for skix

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 …

Member Avatar for Notouch
0
11K
Member Avatar for D33wakar

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.

Member Avatar for D33wakar
0
104
Member Avatar for hovestar

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 …

Member Avatar for TrustyTony
0
494
Member Avatar for pwolf

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 …

Member Avatar for pwolf
0
173
Member Avatar for Cenchrus

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 …

Member Avatar for Cenchrus
0
166
Member Avatar for dh273

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 …

Member Avatar for tls-005
0
16K
Member Avatar for rhguh

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 …

Member Avatar for rhguh
0
294
Member Avatar for hadoque

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 …

Member Avatar for hadoque
0
9K
Member Avatar for Cupidvogel

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 …

Member Avatar for Cupidvogel
0
111
Member Avatar for pwolf

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 …

Member Avatar for pwolf
0
212
Member Avatar for Shockbox

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 …

Member Avatar for smantscheff
0
58
Member Avatar for Pythonbeginner!

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 …

Member Avatar for TrustyTony
0
169
Member Avatar for scsi

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 …

Member Avatar for TrustyTony
0
151
Member Avatar for lrh9

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 …

Member Avatar for TrustyTony
0
206
Member Avatar for amir1990

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!!!

Member Avatar for amir1990
0
99
Member Avatar for sun_2588

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 …

Member Avatar for TrustyTony
0
309
Member Avatar for natehome

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 …

Member Avatar for natehome
0
1K
Member Avatar for surakesh

<< 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” …

Member Avatar for thines01
0
332
Member Avatar for natehome

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, …

0
90
Member Avatar for amir1990

Hi, i have this code: s = "hi john' re.serach(r'j\w+h', s).group() and up to here there is no problem but i want to put the letter h in a str variable l = "h" re.search(r'j\w+'l, s).group() but when i do this i receive an error??

Member Avatar for amir1990
0
82
Member Avatar for chris99

I'm using windows 7, hoping to use Tkinter to open an internet window when a button is clicked that goes to a specific page in google chrome. Is this possible? [CODE]class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text="Rejuvenation", command=self.info) self.button.pack() def info(self): pass #Will go …

Member Avatar for inuasha
0
267

The End.