15,190 Topics

Member Avatar for
Member Avatar for Drau

hello, small question if i may :-) [CODE] try: x=int(input()) except ValueError as var: print(str(var.args[0])) [/CODE] if i input a string like - abcd this code prints me the full error message invalid literal for int() with base 10: 'abcd' while i need only the input - abcd to be …

Member Avatar for Drau
0
167
Member Avatar for potchi
Member Avatar for TJones

Hey everybody. All my Google searches for help led me here so I thought I'd post my actual problem directly. I'm in a 101 programming course and this is only our second Python assignment. What I need to do is use one-dimensional parallel arrays to allow input of four different …

Member Avatar for TJones
0
486
Member Avatar for pareshverma91

The problem is that I want login to a remote pc using ssh through a python script. I don't want to use any ssh-keys (rsa keys,dsa keys etc.) nor do I want to use some extra module not incorporated in python standard libraries (telnet etc I guessed it is used …

Member Avatar for itergosum
0
15K
Member Avatar for jkrueger

Hi, I got the cxfreeze working on the Mac OS X 10.6.7 and the distilled Python script runs fine on that Mac Book. Now I'm getting reports from Mac user clients that it doesn't work for them. It is a simple script that only calls from the Mac it's terminal. …

Member Avatar for jkrueger
0
377
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
110
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
164
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
276
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
259
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
252
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
861
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
271
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
130
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
108
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

The End.