15,185 Topics

Member Avatar for
Member Avatar for potchi

Hi, Is there a way to get the full path of my war file in jython?? I have war file (myApp.war) that is stored in D:\myConstantDirectory\myApp.war I want to create a jython script that can retrieve the full path of my war file by just specifying search myApp.war and it …

Member Avatar for woooee
0
109
Member Avatar for brynFlew

I have made a very simple dice game, How can i output the results of the dice using this format. Thanks for your time. [CODE] ========== | 0 | | | | 0 | ========== ========== | 0 0 | | 0 0 | | 0 0 | ========== [/CODE] …

Member Avatar for Schol-R-LEA
0
319
Member Avatar for BLUEC0RE

Hey guys, I hate asking this but unfortunetly, Google does not know how to interpret "|" and probably assumes its an OR command or something :P . The line goes as follows (source found [URL="http://pysnippet.blogspot.com/2009/11/fuse-filesystem-in-userspace-part-1.html"]http://pysnippet.blogspot.com/2009/11/fuse-filesystem-in-userspace-part-1.html[/URL] here): [CODE]st.st_mode = stat.S_IFDIR | 0755[/CODE] I know it's doing something about the mode being …

Member Avatar for BLUEC0RE
0
151
Member Avatar for rayden150

I get this python error: unindent does not match any outer indentation level, and a red bar appears where "RIGHT HERE RED" is.., keep in mind that this is just a fraction of the entire program but i dont know where the spacing error occurs... pleeeaaase i beg you and …

Member Avatar for vegaseat
0
163
Member Avatar for novice20

Hi all, Here is a part of my code: [CODE]#-- if the ports are mapped properly if(map_dict1[int(MIO_outports1[i])] == int(Exp_map_inport[i]) ): flag = 1 elif(map_dict2[int(MIO_outports1[i])] == int(Exp_map_inport[i])): flag = 1 else: flag = 0 [/CODE] But I am not able to navigate to the 'elif' part. I am getting : [CODE] …

Member Avatar for TrustyTony
0
275
Member Avatar for potchi

Hi! I have a batch file (potchi.bat) that contains the lines ... set maxHeap = 2048 set initialHeap = 512 set mydir=%cd% ... and I want to pass these values to a jython script (myScript.py) such that fullpath = '%cd%/myApp.war' AdminApp.installInteractive(fullpath, -contextroot myApp) AdminTask.setJVMMaxHeapSize('[-serverName myServer -nodeName myNode -maximumHeapSize %maxHeap%]') AdminTask.setJVMInitialHeapSize('[-serverName …

Member Avatar for potchi
0
1K
Member Avatar for cool0329

hi guy just started python, i have a text here and want wo find the number of each letters, and sort the number from the most frequent to the least frequent. hope you guys can hepe me here is the text, just some random letters, acbbmnhctrgnmmxfnfbmqrhnchfwcqwtacvtfhmecttvfcnvphchmpgdmebjdcqwhdfnfrcawhdfrkanahtcjaqxahpkmqdardfcnhcqwjmprdcttvfpkdftwaqbmnfhdcqhdarcrhdfzmnwrzfnfrkmsfqhdfjkcrrfwhdnmpxdhdfzcttcqwrhmmwpkmqcqmkfqgmpqhnjnmcwzahdeaftwrmqfahdfndcqwhdfgahjdcwfqhanftjlcqardfwqmhclfrhaxfmeahzcrhmvfrffqhdfwcnsqfrrcqwhdfbarhdcwlcqardfwzahdahemnahzcrcgtfcngmtwzaqhfnwcjzahdrqmzpkmqhdfxnmpqwxmmwdfclfqrcawrgnmmxfgtcrkaqxdar

Member Avatar for raptr_dflo
0
428
Member Avatar for TrustyTony
Member Avatar for raptr_dflo
0
1K
Member Avatar for kiracho

write a python program , which takes one argument ,which is a word( as a string), and returns "true" if the word contains alternating vowels and consonants(i.e a consonant , followed by a vowel , followed by a consonant ....). Then write a short piece of code to read the …

Member Avatar for vegaseat
0
313
Member Avatar for WolfShield

I have a lot more code than I'm going to post here, but I am posting the relevant parts. What I have is a Calculator program. Here's the code: [CODE=Python] num1 = None num2 = None oper = None def calculate(num1, num2, oper): print("calculate() called") if(oper=="+"): answ = Decimal(num1) + …

Member Avatar for woooee
0
257
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
250
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
269
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
193
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
561
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

The End.