15,190 Topics

Member Avatar for
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
564
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
615
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
231
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
317
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
391
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
263
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
197
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
782
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
341
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
Member Avatar for nodnil

Hi, Python v2.7 Tkinter Windows 7 I am having some troubles drawing a line. I have called create_line inside a for loop, in which I gave it coordinates that are returned from another function. However, instead of drawing separate lines, it joins the lines together. Here is a snippet of …

Member Avatar for nodnil
-1
262
Member Avatar for WolfShield

Hey everyone, Yesterday I wrote a simple Hello World program and saved it as .py. However, when I tried to run the .py file it didn't have a default program. So, I went to 'Choose Default Program', found 'python.exe' and clicked it. 'python.exe' did not show up in the 'Choose …

Member Avatar for WolfShield
0
185
Member Avatar for Gribouillis

I just started a new small python project on google code which goal is to easily create clickable graphs on a GKT+ goocanvas. The initial idea comes from this code snippet [url]http://www.daniweb.com/software-development/python/code/323792[/url] . I want to do about the same, but instead of simply drawing the graph, I want to …

Member Avatar for Gribouillis
1
168
Member Avatar for Python Joe

Hello everyone, I am a student at ITT-Tech studying computer network systems and system security. I am programming now for programming class, but it is very addictive and I really enjoy it. in my spare time I enjoy survival training, time with my kids, reading, and traveling.

Member Avatar for jingda
0
27
Member Avatar for Python Joe

[CODE] import Tkinter as tk import Image, time, datetime def splash_screen(): root = tk.Tk() root.overrideredirect(True) width = root.winfo_screenwidth() height = root.winfo_screenheight() root.geometry('%dx%d+%d+%d' % (width*0.8, height*0.8, width*0.1, height*0.1)) image_file = "NHK.gif" image = tk.PhotoImage(file=image_file) canvas = tk.Canvas(root, height=height*0.8, width=width*0.8, bg="black") canvas.create_image(width*0.8/2, height*0.8/2, image=image) canvas.pack() root.after(10000, root.destroy) root.mainloop() return splash_screen() my_menu()# is …

Member Avatar for Python Joe
0
493
Member Avatar for izthrower

Hey every one, the code above below a user to draw lines and create circles that will collide with the lines and have them roll down the lines. The problem im having is geting the screen to follow the circles. Also im having a problem having the user be able …

Member Avatar for vegaseat
0
196
Member Avatar for TrustyTony
Member Avatar for TrustyTony
1
265
Member Avatar for kuchi

We are developing application in python web development (No frameworks like Django) using just cgi module. In thing we have to use session management to transfer the variables between pages. I tried in google but no useful matter I found, if you know which module is to manage the variables …

Member Avatar for kuchi
0
101
Member Avatar for vr3690

I have a file with the following path :[code] D:/bar/クレイジー・ヒッツ!/foo.abc[/code] I am parsing the path from a XML file and storing it in a variable called "path" in the form of "file://localhost/D:/bar/クレイジー・ヒッツ!/foo.abc" Then, the following operations are being done : [code] path=path[17:] #to remove the file://localhost/ part from the path …

Member Avatar for vegaseat
0
228
Member Avatar for vegaseat

You need the Python tkSnack module to play notes of a given frequency and duration on your external sound system (attached to the PC's sound card). The code snippet gives just a tiny hint about the capabilities of tkSnack. It works with Tkinter, normally part of the Python installation. The …

Member Avatar for Layra
3
5K
Member Avatar for nighthawk10

Can somebody please help me with coding a program for online graph plotting using 'python flask'. The program has to take as input a .csv file and manipulate it and plot it accordingly.

Member Avatar for vegaseat
0
294
Member Avatar for Lardmeister

Tuples are immutable objects, they cannot be changed says the Python manual. [code]my_tuple = (1, 2, 3, [4, 5, 6]) # this works my_tuple[3][2] = 7 # clearly the item at index 3 in the tuple has changed print(my_tuple) # (1, 2, 3, [4, 5, 7]) [/code]

Member Avatar for vegaseat
0
184
Member Avatar for kenkit

I was planning to create a programme to try and locate text from an image I kknow that this is a complex issue but any assistance will be kindly appreciated,the programme should locate text and create a document containing the text found thanks.

Member Avatar for kenkit
0
86
Member Avatar for maddenfong

I am not trying to use a setup.py, i just want to use the basic script. the website says as an example: [code] cxfreeze hello.py --target-dir dist[/code] thanks in advance! I tried this but it did not seem to work: (The Command Line is in the folder with the Shooter.py) …

Member Avatar for vegaseat
0
156
Member Avatar for kuchi

I can access the parameters if the form submitted or hidden from the following snippet. form = cgi.FieldStorage() But I can't access the variables from URL. EX:- .../daniex.py?TYPE=R1 How can I get "TYPE" variable's value from python web lib?

Member Avatar for woooee
0
71

The End.