15,190 Topics

Member Avatar for
Member Avatar for khozamtho

how to compile and run a python file,and how to change a directory in Python25.what should i import first in order to run a python code.like import math and ......

Member Avatar for woooee
0
205
Member Avatar for rajasekhar1242

Hi everyone, I am trying to get PDF file output from the python program to give a print. is there any solution? please give me a valuable reply...

Member Avatar for woooee
0
214
Member Avatar for bhanu1225

Hello everyone I have created [COLOR="Red"]Tkinter application on Mac OS X.[/COLOR] [COLOR="Green"]I need to take printout for the output of that program from that application only.[/COLOR] Kindly please give me a valuable response. Regards BHANU

Member Avatar for scru
0
122
Member Avatar for ning2009

Hi, there my code is below [ICODE] resultlines=[targetlines[0] % dResult['SEC'], targetlines[1] % line1b, targetlines[2] % (section_type,dResult['SEC'],mat_data), targetlines[3] % section_data, targetlines[4] % (math.sin(float(dResult['ANG'])*math.pi/180), math.cos(float(dResult['ANG'])*math.pi/180), 0)] for line9 in resultlines: line9=line9+"\n" binf.write(line9)[/ICODE] , which generated the format with empty lines below *beam section,section=I,elset=UC356X368X202,material=STEEL 0.1873,.3746,.3747,.3747,.027,.027,.0165 1.000000, 0.000000, 0.000000 *element,type=b31,elset=LCHS965-14-3 39,3490,1612 *beam section,section=PIPE,elset=LCHS965-14-3,material=S355 0.4825,.0143 …

Member Avatar for amitattri1987
0
412
Member Avatar for tivrfoa

Hi! I'm using IDLE. [CODE]Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> test = 1 >>> if test: print "ok" SyntaxError: invalid syntax (<pyshell#2>, line 2) >>> [/CODE] Does someone can help me? Thanks.

Member Avatar for tivrfoa
0
171
Member Avatar for smb3d

Hi, I've written a python cgi app that lists image files in a directory then when the user clicks on a link it converts the image to a .jpg and displays it in a simple html page. I'm using tempfile.NamedTemporaryFile to create a temp file that the converter can write …

Member Avatar for smb3d
0
150
Member Avatar for Crinkly

Can the edit wizard be altered to allow more than 4 packs to be used? Now more of us use large screens more than four can be useful.

Member Avatar for Crinkly
0
80
Member Avatar for max.yevs

i made another extremely simple script, but i've looked through all the random python commands(10.6) and can't figure out how can i write a nonunique random script? as in all the random numbers can be the same? like random.sample? say i have a list [1,2,3,4] and i want to pick …

Member Avatar for max.yevs
0
122
Member Avatar for max.yevs

yet another quick question... I wrote this at the end of a script [code]y = 1 n = 0 i = input("Again? Y/N: ") if i is 0: print ("Good bye!") exit if i is 1: execfile ("program2.py")[/code] now of course if i is 0, they won't be able to …

Member Avatar for adam1122
0
105
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
132
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
131
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
93
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
270
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
676
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
196
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
106
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
100
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
141
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

The End.