15,175 Topics

Member Avatar for
Member Avatar for VulcanDesign

Hi all, I'm trying to use Python's urllib to get a Facebook profile page. I get the following error: [CODE]IOError: [Errno socket error] [Errno 10035] A non-blocking socket operation could not be completed immediately[/CODE] Here's my code: [CODE] import urllib member_profile_text = urllib.urlopen('http://www.facebook.com/profile.php?id=1073109649').read() [/CODE] I need to get this working …

Member Avatar for VulcanDesign
0
538
Member Avatar for TrustyTony

[I]This is one idea for thread of some lessons learned with experience about asking wrong question and answers 'thinking out of box'. If there is need to have sticky, I suggest that this thread become sticky development thread and moderator can move the upvoted suggestions for next part in new …

Member Avatar for TrustyTony
0
221
Member Avatar for [V]

Ive noticed print() includes linebreaks, and its real easy to suppress them. Is there a way I can write lines to a file, but have the line breaks includes implicitly? eg: [CODE] file=open("testfile.txt","w") file.write("line 1") file.write("line 2") file.write("line 3") file.close() [/CODE] meanwhile the file will contain [code] line 1\nline 2\nline …

Member Avatar for vegaseat
0
131
Member Avatar for TrustyTony
Member Avatar for TrustyTony
0
909
Member Avatar for imperialguy

Platform and Python installation info: [b]Platforms: Windows, OS X Python: Active State Python 2.7 wxPython: Version 2.9[/b] Here is a sample code in which I use a wxMessageBox: [code]import wx,os class Frame(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(100, 100),style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | …

Member Avatar for vegaseat
0
1K
Member Avatar for Toikkala

Hi! On school we got exercise to calculate how much the length of substance grow when we know original length and temperature change. So,the case goes that i have value temperature coefficient of different substances and i have to multiply them. I'd like to it without doing several condition statements. …

Member Avatar for woooee
0
249
Member Avatar for [V]

For some reason, I can create temp files but I cannot write to them. Nothing is saved, and the file is always empty. What am I doing wrong? I've tried making it in /tmp, Ive specified mode=w+b, they all do the same. (nothing) [CODE] import tempfile def main(): test = …

Member Avatar for woooee
0
235
Member Avatar for Schol-R-LEA

I am making a last-ditch effort to get Django 1.3 configured to talk to SQL Server (both running on the same Windows 7 system), before I have to make a final decision whether to move on to ASP.NET instead. I am using PyODBC (I had tried PyMSSQL but was recommended …

Member Avatar for Schol-R-LEA
0
860
Member Avatar for Ephexeve

I am reading a Python book for Pyton 2.5 (But I am doing Python 3). I am at the chapter classes and I got this part; "You can check whenever the function attribute was callable." [CODE]callable(tc,'talk',None)[/CODE] In Python3 we do not have callable anymore, so I checked on the internet, …

Member Avatar for TrustyTony
0
268
Member Avatar for Gsx

Hi, this program is working atm but i suck at loops and such and im just wondering if there is any better way to do it, and if i do not enter a number in 1 of the 3 boxes when showing the results of the networks it just says …

Member Avatar for TrustyTony
0
154
Member Avatar for rssk

hi all i have list like list1=[2,3,4] m = 'ma' [B]m = list1 * m[/B] wen i run the script i'm getting output like [B]TypeError: can't multiply sequence by non-int[/B] i need a output like [B][ma2,ma3,ma4][/B] so plzzzzz help me:(

Member Avatar for TrustyTony
0
220
Member Avatar for BLUEC0RE

Hey guys, I'm tinkering around with the fuse-python bindings and I can't seem to grasp how to run the example xmp.py from the library package (xmp.py is located here: stuff.mit.edu/iap/2009/fuse/examples/xmp.py). Looking at a lecture slide from MIT (located here: stuff.mit.edu/iap/2009/fuse/fuse.ppt), on slide 33, it shows the command line invoking of …

Member Avatar for BLUEC0RE
0
128
Member Avatar for WolfShield

Hey all, I am working on a calculator program and am using a StringVar() for the Entry widget. What I need is to delete the last char from the StringVar() when the user hits the 'Backspace' button. I have everything bound and all, I just don't know what the code …

Member Avatar for WolfShield
0
1K
Member Avatar for happymadman

Where are the connections stored, are they in a list, how to I access them? I have a (-messy-) program that will allow the users to set there name and when they send input to the server it will come up with "Received: Blah from username" but I would like …

Member Avatar for happymadman
0
107
Member Avatar for Simplicity.

Hi all, I have developed the code below to solve a non-linear scalar hyperbolic conservation law (Burgers' equation). I want to advance to solving a one dimensional system of Euler equations for Gas Dynamics (which is also a hyperbolic partial differential equation) in the similar manner. Can anyone advise on …

Member Avatar for TrustyTony
0
192
Member Avatar for ret801

can someone show me the syntax for inserting Number literals and strings into python strings like the print statement for example(i.e print("string %s"),(SumNum)) .. I have forgotten. and could someone explain the difference between syntax and semantics to me , i have forgotten that also XD

Member Avatar for ret801
0
136
Member Avatar for WolfShield

Hi, I am running Windows Vista. I am trying to run a .py file, but the computer says it doesn't know what program to run it with. So, I clicked 'Choose Default Program', then I found 'python.exe' and clicked it. But 'python.exe' didn't show up in the 'Choose Default Program' …

Member Avatar for thetazva
0
228
Member Avatar for vegaseat

Continued fraction expansion is a simple way to approximate common trigonometry functions to a relatively high precision. In this example we only look at sin and cosine. The results compare well with the results of high precision packages like SymPy. The Python module decimal is used to achieve the high …

Member Avatar for TrustyTony
3
558
Member Avatar for TrustyTony

To be more clear, I post this 'unnecessary optimization' of Vegaseat's code in new thread instead of end of old one. Just to show that this is even simpler than [URL="http://www.daniweb.com/software-development/python/code/363346/1554115#post1554115"]checking if given day is first weekday of the month[/URL].

Member Avatar for TrustyTony
0
1K
Member Avatar for TrustyTony

Little clean up of vegaseat's code for generating pi decimals. Added number of decimals desired and string type return for easy use with ''.join()

Member Avatar for TrustyTony
1
614
Member Avatar for novice20

Hi, I want to do something like this: I have two lists: list1 = range(6) list2 = range(10,15) i want a dictionary like this: adict ={0:10, 1:11, 2:12, 3:13, 4:14, 5:15 } I did the following: [CODE]list1 = range(6) list2 = range(10,15) adict = dict(zip(list1,list2))[/CODE] i get : [B]TypeError: list …

Member Avatar for novice20
0
230
Member Avatar for WolfShield

I would like to make a LUDICROUSLY high number calculator in Python. I am thinking 60 numbers and a decimal point. So numbers could be in a format like these: 60 numbers, 30 numbers decimal point 30 numbers (30nums.30nums), or decimal point 60 numbers (.60nums). E.g. 999,999,999,999,999,999,999,999,999,999.999999999999999999999999999999 But, I am …

Member Avatar for WolfShield
0
316
Member Avatar for WolfShield

Hey guys, I am making a calculator program and don't want the user to type directly into the Entry, so I made the Entry 'readonly'. But that makes it to dark for my liking, so I am trying to set the readonlybackground='white', but it gives me an error saying that …

Member Avatar for WolfShield
0
388
Member Avatar for HiHe

I was trying to create a simple Python GUI with a label on a frame. I can't get the label's position and size to work: [code]# a simple wxPython GUI program # showing a label with color text # however, label position and size do not work! import wx class …

Member Avatar for vegaseat
0
309
Member Avatar for jum2011

Hi, I just received a project in my class where i have to write my own turtle class in python which I will have to use to draw a Koch snowflake. Currently I have no idea on how to get started on the turtle class? If anyone knows or has …

Member Avatar for vegaseat
0
262
Member Avatar for [V]

I wrote this python script (part of a bigger program) to launch a php script and wait for the output. The PHP script takes almost 15 minutes to run, as it is spawning several perl & C programs of its own. When I launch the php script by itself, it …

Member Avatar for TrustyTony
0
196
Member Avatar for chrisvj11

I am using Python and wxPython to attempt to make a 2d game. When w is pressed, the tiles (except the character) should move so it looks like you are moving. The problem is, when the key is pressed, nothing moves. I added a line of code(no longer there) to …

Member Avatar for chrisvj11
0
781
Member Avatar for hisan

Hello All, Ii want to know how can i check whether the response from the server is inJSON format or XML format . Please let me know how to do this,

Member Avatar for sneekula
0
339
Member Avatar for WolfShield

I am going through the Tk/Tkinter tutorial and when I try to run the menubar program I get two windows instead of a menubar on one window. Here is the code: [CODE=Python] from tkinter import * from tkinter import ttk root = Tk() root.option_add('*tearOff', FALSE) win = Toplevel(root) menubar = …

Member Avatar for HiHe
0
179
Member Avatar for kmilof

hi! i want to make a program, that moves an object in vertical line 'till the program ends,but when it reaches the upper border, automatically appear in the lower border. i have this [CODE]from utalcanvas import * import time show() window_size(500,500) window_style( "Mi Ventana", "black") window_coordinates(0,0,1000,1000) circulo = create_filled_circle(500,20,50,"green") for …

Member Avatar for predator78
0
224

The End.