473,549 Members | 2,699 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python Forum

Python programming language - Ask questions about python interpreter, control flow, data structures, modules errors, classes, standard library, gui, databases, unit testing, object oriented, structured programming and more.
0
1,625
thread by: hutchinsmitch | last post Aug 25 '14 by: hutchinsmitch
help!! Error message: End of script output before headers: customer_add.py import psycopg2 con = None import cgi; data = cgi.FieldStorage(); try:
1
1,477
thread by: gearedhead | last post Aug 23 '14 by: dwblas
name = input('What is your name?\n') print('Hi, %s.' % name) work = input('What do u do For Living?\n') print('Oh thats Great') hobby = input("What is ur Hobby?\n") if hobby == 'work': print ("But thats ur Work..!!")
0
1,157
shahram555
thread by: shahram555 | last post Aug 23 '14 by: shahram555
I have seen this code in a book.according to this book,as we run code and type 'classMaker()' will see this: >>> classMaker() making the class do you want to make an object of the class? ------------- and then we answer:yes, >>>classMaker() making the class do you want to make an object of the class?
0
1,080
thread by: mrmsbarnes | last post Aug 22 '14 by: mrmsbarnes
A previously closed question at export an array of floats to python concludes with sturlamolden saying, "Now return myarray and be happy." and Peter Wuertz saying, "Thank you! Thats the complete solution *g*" This is all good. But I am stuck on the python side where I want to see the array. I have a c shared library function like...
0
1,031
thread by: lisa92 | last post Aug 22 '14 by: lisa92
I want to obtain the pixel values for RGB from image.I did it in Matlab and Python but i obtained different values especially at the green value. I'll appreciate if you have an advice about this matter. Thanks Here is my code in python from PIL import Image import numpy as np im = Image.open("lena.jpg") imPixelVal = np.ones(np.size(im))...
1
1,309
thread by: frostedgoddess | last post Aug 20 '14 by: dwblas
a = int(input('Enter a number: ')) number = a/3.95 print(1 Messenger(s) =, number, Modus) this is the code, the brackets around the (s) do not function as they break the rest of the print code, how can I fix this?
3
2,087
thread by: Neeta Singh | last post Aug 19 '14 by: Neeta Singh
Pls refer to the given below program: class t2: a=0 def _init_(self): t2.a=10 def f1(self,temp): self.a=temp def f2(self): print self.a
2
1,568
thread by: gintare | last post Aug 16 '14 by: gintare
I would like that script would keep running, i.e. requesting urls with different words, depite errors. Currently script stops running if error occurs. #word comes from the list of words res6="http://glosbe.com/en/el/"+word try: resp = urllib.request.urlopen(res) if resp.getcode() == 200: html = resp.read() #proceed with...
1
1,232
thread by: gazal sharma | last post Aug 15 '14 by: dwblas
i have written program for coupled oscillator(numerical solution)using euler method. but i am not getting the exact graph.can somebdy help me out of it. K=2 g=9.8 L=8 m=2.0 Tm=10 N=125 h=Tm/float(N) import matplotlib.pyplot as plt import numpy as np
0
1,115
thread by: azuri | last post Aug 14 '14 by: azuri
Hi there, I need to use SWIG to wrap my C++ class which heavily uses blitz++ arrays to python. Has anybody done this before? I'm looking for a simple example .i file... My imports in CFits.h: #include <stdio.h> #include <iostream> #include <cstdlib> #include <blitz/array.h> #include <blitz/vector.h>
0
992
thread by: rigirish123 | last post Aug 14 '14 by: rigirish123
I have Populated the HTML Text Box in child window, this text box has a values from parent Window. Now I need to get this Value and assigned to Python Variable for doing some actions like splitting the text and display separately need help on this. HTML Text Field has a Value Populated, Need to assign this textbox value to a Variable using...
0
1,022
thread by: tibe | last post Aug 14 '14 by: tibe
I'm not professional in typing with the QWERTY. I'm learning python and I decided to increase speed of my typing. So I think maybe there's a better choice than QWERTY layout for a programmer. I know we can customize a layout by own but it needs technical and medical information! However there's some famous/new layouts around the web. here are...
2
2,533
thread by: pd4860 | last post Aug 14 '14 by: pd4860
I have cracked sending an email containing text and a value from a variable using some code I found online SERVER = "server" FROM = "from address" TO = SUBJECT = "subject" TEXT = "Line Count :- " + str(linecount)
13
1,789
thread by: rokstar24 | last post Aug 13 '14 by: dwblas
the text file is like: shfhsgfkshkjg gkjsfkgkjfgkfg model1 lkgjhllghfjgh kjfgkjjfghg endmodel model2 jfhkjhcgbkcjg xhbgkxfkgh
2
1,290
shahram555
thread by: shahram555 | last post Aug 13 '14 by: dwblas
c={'a':1,'b':2} c.has_key('a') Traceback (most recent call last): File "<pyshell#32>", line 1, in <module> c.has_key('a') AttributeError: 'dict' object has no attribute 'has_key' Why does this fail?
1
1,153
thread by: Jackpy | last post Aug 12 '14 by: dwblas
Every time that I want to open a module, do I have to append every time, or is there a way to permanently add the folder that I keep the modules in to the path? I just started with python and I'm keeping all the exercises from the textbook I'm using in the same folder.
1
1,441
shahram555
thread by: shahram555 | last post Aug 11 '14 by: Rabbit
import random for i in range(10): x=random.triangular(1,2,3) print(x)
1
1,402
thread by: Raviexact | last post Aug 5 '14 by: bvdet
Hi, I've created new signal , where i specify list and object datatype. dataChanged = QtCore.Signal(list, object) But list and object datatype don't convey properly that what will be in list and in the object. So it would be good if we could declare something like this, dataChanged = QtCore.Signal(lst_employees, obj_sender)
3
1,478
thread by: gullengd | last post Jul 25 '14 by: dwblas
can you convert an empty string to a number?
1
1,950
thread by: santoznma | last post Jul 23 '14 by: sicarie
Hello World! I am currently writing a script that reads an input file (in txt) and outputs a tab delimited file, which will be converted to csv ( to input to a SQLite Database). It recognizes special characters in a dictionary and inserts a tab '\t' every time it finds a character like '))' or '|'. I am Portuguese and I'm new to programming and...
1
1,546
thread by: pohweihao | last post Jul 23 '14 by: sicarie
f = open("centaur_1.mpg","rb") #create a for loop and split file into 20 parts buffer=f.read() # readinto a large buffer to check its size #f.close() #close the file filesize=len(buffer) print filesize splitsize=int(filesize/segmentsize) f.seek(0) # reset to beginning of file #smallfbuf= for i in range(splitsize+1):
1
1,890
thread by: LalangNina01 | last post Jul 23 '14 by: sicarie
I actually can print using the txt file to printer, however, when I change to docx or pdf I get many undefined characters which cannot be understood at all. Do you guys have any ideas on how to solve this. The code I used. import system import javax.print import java.io from java.lang import Thread filestream =...
1
1,340
thread by: rinipankaj | last post Jul 22 '14 by: sicarie
windows 7 is my os trying to install django while typing setup.py install in command prompt this occurs error:no commands supplied i type setup.py install in c:/>Django-1.5.7> directory i am new to programming..pls help me fast...
1
1,432
thread by: Clemence | last post Jul 22 '14 by: bvdet
Hi There. I'm trying to write a code that reads the filenames of objects of the form "gal_z7.25.sae" and "gal_z0.02563.sae" and stores the decimal digit parts ONLY to a list. So far I have the following: import glob import sys, os #Open folder with files
0
1,190
thread by: bd3161 | last post Jul 20 '14 by: bd3161
I downloaded python27 and installed, downloaded wxPython3.0 msw and installed in site packages, then downloaded boa and installed in site packages, then made a shortcut for the desktop. when I click it, boa just flashes and closes, any help would be appreciated.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.