15,181 Topics

Member Avatar for
Member Avatar for txwooley

I am working on a function to find the slope of a line if given x1, y1 and x2, y2. Not too hard. But I need the results to be floating point not integers even though the x and y inputs are integers. I have : [code=python] def slope(x1, y1, …

Member Avatar for txwooley
0
131
Member Avatar for jworld2

I have been looking for a way to compile my [B]whole[/B] program into a single executable file that can be run completely by itself. That also includes any image files that my program uses. Something like when the executable is run, all extra files are extracted into a temporary directory …

Member Avatar for jworld2
0
130
Member Avatar for ning2009

Hi, there I have the code (from Jice) using List below [CODE=syntax] targetlines=["*beam section,section=%s, elset=%s, material=%s", "%s", "%f, %f, %f"] resultlines=[targetlines[0] % (dResult['SEC'],section_type,mat_data), targetlines[1] % section_data, targetlines[2] % (math.sin(float(dResult['ANG'])*math.pi/180), math.cos(float(dResult['ANG'])*math.pi/180), 0)][/CODE] , which worked well However when I modified it to [CODE=syntax] targetlines=["*element,type=b31, elset=%s", "%s", "*beam section,section=%s, elset=%s, material=%s", "%s", …

Member Avatar for ning2009
0
92
Member Avatar for -obol-

Hey everybody im a real newbee at python and im just wondering how to split a string of words into pieces and print on separate lines for example: " sun is shining" to: sun is shining i know this might be a simple task for a lot of people but …

Member Avatar for jlm699
0
267
Member Avatar for Mearah

Hey, is there somebody who tried to use pyOpenGL with wxPython? I want to have a GUI, where I have a frame integrated, that shows a 3D image computed by an OpenGL algorithm build in the PyOpenGL environment. Mearah

Member Avatar for Mearah
0
664
Member Avatar for max.yevs

so i was trying to make a very simple counter (although not sure if that's what you call it) [code=python]import time a = 0 def main(): time.sleep(5) b = a + 1 print (b) del(a) a = b del(b) main() main()[/code] i know this is very unefficient and there is …

Member Avatar for adam1122
0
143
Member Avatar for leegeorg07

i have python 2.5 and 3 and i want to use 2to3 to convert all of my programs to python3 but i dont know how to use it, if it helps in the Lib folder of python3 it is called lib2to3. any help or examples welcome.

Member Avatar for leegeorg07
0
195
Member Avatar for amitattri1987

Hi, I'm a novice to apache server and its configuration for mod_python. As available on as availabe on [URL="http://www.thesitewizard.com/archive/addcgitoapache.shtml"]http://www.thesitewizard.com/archive/addcgitoapache.shtml[/URL]. (Please go through it. It is very simple but important to solve my query.) Platform: Windows XP Python 25 is installed as c:\python25\python.exe Apache server 2.2 is installed in program files. …

0
62
Member Avatar for txwooley

I have an assignment to: "Wrap this code in a function called compare(x, y). Call compare three times: one each where the first argument is less than, greater than, and equal to the second argument." So I came up with this: [code=syntax] def compare(x, y): if x < y: print …

Member Avatar for txwooley
0
109
Member Avatar for txwooley

I am trying to learn Python. I have browsed through a few tutorials and tried to follow them until they get too complex and I try to find another one to give a different perspective. I am currently trying (and very much enjoying) the very basic "How to Think Like …

Member Avatar for txwooley
0
103
Member Avatar for harrykokil

hi every one i created a slidebar in tkinter. as i move it forward the value of a variable increases. but as i move it backwards, the value also increases. it should decrease. do u guys have a simple slidebar implemeted and which affect the value of an attribute? thanks

Member Avatar for vegaseat
0
105
Member Avatar for flip121

I am in an introductory cs course, and we have a project due in a couple of weeks. I have asked my instructor if I can ask for help here and he did allow me to post the code and ask. The project is to write a simple game where …

Member Avatar for flip121
0
1K
Member Avatar for ning2009

Hi, there Let me put my resource line and target lines here firstly resource line: 56 J=7224,164 SEC=CON450X450 ANG=45 target lines: *beam section,section=R, elset=CON450X45056,material=con2 0.45,0.45 0.707107,0.707107,0 I have a dictionary below (created using woooee's code) Frame_Section contains {'CON450X450': [['MAT', 'CONC2'], ['SH', 'R'], ['T', '.45,.45']], 'B400': [['MAT', 'CONC2'], ['SH', 'R'], ['T', …

Member Avatar for ning2009
0
210
Member Avatar for katamole

Hi again, I'm trying to use a python wrapper for the last.fm api. It's pretty old but seems to be working ok (for now). See [url]http://code.google.com/p/pyscrobble/[/url] Anyway, I'm having trouble extracting some information from the output. [CODE] import scrobble user = scrobble.User('mattfeliks') # invoke user class recent = user.recent_tracks # …

Member Avatar for katamole
0
99
Member Avatar for ganil_22

Hi, I am looking for some good examples on calling c and C++ apis inside python code. Can anybody share good examples or links. Thanks, Anil kumar

Member Avatar for joph
0
51
Member Avatar for docesam

i want to start programming a new program (electronic health care center) in python and before start learning python i wanna make sure that python does have all the features i need to accomblish this project so i wanna ask you does python able to support these features : 1- …

Member Avatar for Mearah
0
164
Member Avatar for Mearah

Hey there, I am going to start a larger project. For this I just set up my programming invironment as follows: python2.5 numpy scipy matlibplot PyOpenGL ctypes I then tried to test the installation with a simple example. First I found the warning: [COLOR="Red"]No handlers could be found for logger …

0
136
Member Avatar for pong pong

hi I want to write this code in do while or if else, or any other way except for loop. here is the code [CODE]for i in range(65,90): for j in range(65,90): for k in range(65,90): token=chr(i)+chr(j)+chr(k) block = ((i<<16)+(j<<8)+(k)) cblock = pow(block,e,n) table[token]=cblock[/CODE] can anyone please help me to …

Member Avatar for leegeorg07
0
112
Member Avatar for max.yevs

alright i know you're tired of explaining simple things to me, but i've looked around and really can't figure how to do this... i'm trying to write a simple python script like when you type in a number for n, and press enter, it finds n+2? i thought it will …

Member Avatar for jlm699
0
113
Member Avatar for tschafer204

I have been working on something, and i'm stuck again... I have to print out an infile list in columns, and then print it out again in alphabetical order(sort). I can't figure how to print in columns, nor can i soft it. Any help?

Member Avatar for tschafer204
0
88
Member Avatar for shiva666

i am quite new to python ... currently i am a student learning for mu mcitp exams.. i made a small script ,, for active directory using python all the script does is basicly explor the AD for a number of tasks .. * 1 .Find a user (quick method) …

Member Avatar for shiva666
0
94
Member Avatar for flip121

I have a project that I am working on that is basically a game where players travel down a hall and race to the end. Obviously there are more rules but they are irrelevant for my problem. The problem I am having is that I cant get my board to …

Member Avatar for flip121
0
94
Member Avatar for shaun.b

Hi Everyone, I have got a program which takes a html file as an argument, parses it, and outputs the data to a CSV file. It does this no problem. BUT, i need it to take more than one html file, parse them and put all the data collected into …

Member Avatar for adam1122
0
194
Member Avatar for leegeorg07

i just thought i would ask as a reference for the future but if i was to have a loop like this: [code] import time mytime = time.asctime()[11:19] while mytime <= "13:14:15": mytime = time.asctime()[11:19] raw_input() [/code] how could i change it so that mytime would constantly update as at …

Member Avatar for leegeorg07
0
70
Member Avatar for katamole

Hi there, I'm quite new to python and have a question regarding list matching. What would be the most efficient method of searching for matching items in a list? Ideally, the code would look like: [CODE] list1 = ['spam', 'eggs', 'bacon'] list2 = ['spam', 'ham', 'king richard'] matchitems(list1, list2) ... …

Member Avatar for woooee
0
179
Member Avatar for zublacko

Ok I have a while loop set but can you guys give me an example of a while loop that takes information, reads the more specific detail and then another specific detail? In my code I cant figure out how to make the loop search another line or sentence. All …

Member Avatar for jlm699
0
92
Member Avatar for zublacko

Is there a way to find something from html code like <img and then find the src and alt of an image in the <img line? I can get the <img line out but i dont understand how to use find to find the start index and end index. For …

Member Avatar for jlm699
0
110
Member Avatar for ning2009

Hi, Guys, I use RG to handle some txt files in Python to rearrange format of these text files. These text files look like below MATERIAL NAME=STEEL IDES=S W=76819.55 T=0 E=1.99948E+11 U=.3 A=.0000117 FY=3.447379E+08 NAME=CONC2 IDES=C W=23560 T=0 E=2.48211E+10 U=.2 A=.0000099 NAME=OTHER IDES=N W=76819.55 T=0 E=1.99948E+11 U=.3 A=.0000117 NAME=CON3 IDES=C …

Member Avatar for ning2009
0
341
Member Avatar for leegeorg07

hi again i have this code: [code=python] #this program is a simple test OS for a till #it will loop constantly until a certain time (specified as CLOSING_TIME) COMPLETED!!! #it will check stock from a dictionary in a file (specified as STOCK) #i plan to add a profit calculator import …

Member Avatar for leegeorg07
0
124
Member Avatar for max.yevs

I've learned quite a bit since my last post, i.e. it kept disappearing on me just because of syntax, but now I'm interested in something: Is it possible to make it so that when you run the .py as is , that it opens another program or directory? I.e. when …

Member Avatar for max.yevs
0
119

The End.