No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Re:
Design a function named max that accepts two integer values as arguments and returns the value that is greater? For example: if 7 and 12 are passed as arguments to the function, the function should return 12. Use the function in a program that prompts the user to enter two … |
|
Re:
i want to convert my pdf files with ImageMagic python module PythonMagick but i havent found any solution on net. import PythonMagick im = PythonMagick.Image('files.pdf') im.write("file_img%d.png") i am using below code and it returns only first page of my pdf file. any help would be greatly appreciated |
|
Re:
Design a program that asks the user to enter a series of 20 numbers. The program should store the numbers in an array and the display the following data: • The lowest number in the array • The highest number in the array • The total of the numbers in … |
|
I am stuck on the final part of the query, I know that this thing is easy, but I am out of ideas now, so sorry for this. I have prepared a query like this: SELECT A.projectName as PARENT, (select COUNT(*) from PSPROJECTITEM WHERE PROJECTNAME = A.PROJECTNAME) parentprojecount, B.ProjectName as … |
|
I have written the following code for Towers of Hanoi problem using non recursive approach. I guess it is not correct as the number of moves are not 2*n - 1, for eg, for 3 disks to be moved, it has to generate 7 moves. Thanks in advance. ###################### # … |
|
Re:
Hi, I'm very new in Python and I have to write an file interpretor (first ex from university). The file looks like: joker NAME_OF_BLOCK bla bla { block_field abv : bit : R ; block_field acd : byte : RW ; block_field zza : bit : R ; block_field aw … |
|
Re:
Hi All, I am a control engineer and i am trying to communicate with a sensor I have spoken to the manufacturer but they cannot help with the python side.I am trying to send a message to the sensor which tells it to connect. The sensors config is ip192.168.60.3 port … |
|
Re:
How could I make the return command in Python return a list AS a list, and not as a 'programmer' list? For example, for line in list: return (line) But for some reason it only returns the first element in the list, for example: myList = ['1','2','a','b'] for line in … |
|
|
Re:
This is a program intended to write text to any file specified var_file = (raw_input('nof$ ') #nof, number of files. try: text = str(raw_input('ttwtf$ ') #ttwtf, text to write to files. print text >>> var_file except ValueError: print "Error: Not a string" main() When the program starts the "`try`" part … |
0 down vote favorite I have written a code to convert decimal numbers into hexadecimal equivalent. The program prints correct value till '2559'. How to get correct values of hexadecimal for larger numbers. Here is my code: ######################################### # Decimal to Hexadecimal Conversion # ######################################### def DectoHex(n): if n <= … |
|
I am learning Python through LPTHW. There is an exercise where we need to create test scenarios. The following is the code for whom Test Case have to be made: ############################# # Sentence Parser # ############################# class ParserError(Exception): pass class Sentence(Object): def __init__(self, subject, verb, object): # remember, we take … |
|
A basic program which writes the user name who has logged in the windows machine: ###################### # User info # ###################### import os import datetime from time import strftime def foo(): usr_log = os.environ ['USERNAME'] sys_log = os.environ ['USERPROFILE'] current_time = strftime("%a, %d %b %Y %H:%M:%S") dt_str = str (datetime.date.today()) … |
|
################################# # Learning to make a game # ################################# # An attempt to make a game # Each room will be described by a class, whose base class will be Room # The user will be prompted to enter a number, each number will be assigned with a Room in … |
|
Re:
Hello, Can someone please help me with a little problem that I am having splitting strings? I am trying to remove everything more than 2 - digits to the right of a decimal point in a string. For some reason I am not realizing my desired results. If you could … |
|
Re:
I want to modify the sky to be grey but i want to be time gap between the two...but i dont know how to do it # Import a library functions called 'pygame' import pygame # Initialize the game engine pygame.init() # Define some colors black = (0, 0, 0) … |