Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Calling a Returned Value to Another Function
Post: RE: Calling a Returned Value to Another Function

Nilamo, It was a homework. If you read my initial post you'll see my work. However, i figured it out.  Thanks for your help. -Valerydolce
valerydolce Homework 9 6,716 Mar-28-2017, 09:54 PM
  Photo Thread: Calling a Returned Value to Another Function
Post: RE: Calling a Returned Value to Another Function

Hi Zivoni, He used the 'PATH' value instead of a variable under function  get_dirs_from_path()
valerydolce Homework 9 6,716 Mar-10-2017, 05:04 PM
    Thread: Calling a Returned Value to Another Function
Post: RE: Calling a Returned Value to Another Function

I have to follow some steps ( mandatory ) to complete this task. get_environment_variable_value()The header for this function must be get_environment_variable_value(variable_name) This function mu...
valerydolce Homework 9 6,716 Mar-10-2017, 03:49 PM
    Thread: Calling a Returned Value to Another Function
Post: RE: Calling a Returned Value to Another Function

What should be the "some_env_var_name" in this case ? When i test the code below,  #! /usr/bin/python3 import os import sys def get_environment_variable_value(variable_name):     var_name = os.env...
valerydolce Homework 9 6,716 Mar-10-2017, 02:29 PM
    Thread: Calling a Returned Value to Another Function
Post: Calling a Returned Value to Another Function

Hi Gigs, I'm trying to call a value obtained from a function to another function. In this case, i want to call var_name into get_dirs_from_path() function. Below is what i did, but it's not working. ...
valerydolce Homework 9 6,716 Mar-10-2017, 12:55 PM
    Thread: Print format
Post: Print format

Hi Gigs, Below is a code that I'm working on: def class_tuple_create(filename):     try:         file = open (filename, 'r')     except:         print(filename, 'Cannot be opened')     else:         ...
valerydolce General Coding Help 2 3,965 Feb-12-2017, 05:05 PM
    Thread: Getting a "Cannot be Opened"" error Message
Post: RE: Getting a "Cannot be Opened"" error Message

So i finally got the code right and below is my final code : def team_average(filename):     numberOfGames = 0     soxWins = 0     try:         file = open(filename, 'r')     except:         print (fi...
valerydolce General Coding Help 14 8,894 Feb-09-2017, 02:58 PM
    Thread: Getting a "Cannot be Opened"" error Message
Post: RE: Getting a "Cannot be Opened"" error Message

So, i was trying to read the score from the end. Instead of using  scores = game[-1]   i used  scores = game[1]. However i got a new error  Error:Traceback (most recent call last):   File "./hw2.py",...
valerydolce General Coding Help 14 8,894 Feb-09-2017, 12:26 PM
    Thread: Getting a "Cannot be Opened"" error Message
Post: RE: Getting a "Cannot be Opened"" error Message

I did but it still returned the same error ! Regarding the indentation, i'm using the tabulation key instead of space.
valerydolce General Coding Help 14 8,894 Feb-09-2017, 12:00 PM
    Thread: Getting a "Cannot be Opened"" error Message
Post: RE: Getting a "Cannot be Opened"" error Message

Buran/oFnuts, Per your advise, I changed the code as shown below and i got a bunch of error def team_average(filename):         numberOfGames = 0         soxWins = 0         try:                 file ...
valerydolce General Coding Help 14 8,894 Feb-09-2017, 11:38 AM
    Thread: Getting a "Cannot be Opened"" error Message
Post: RE: Getting a "Cannot be Opened"" error Message

It's on a linux host that i access remotely.  below are the permissions Quote:total 3 -rwxr-xr-x 1 psimo it117-1G  602 Feb  9 05:57 hw2.py -rw-r--r-- 1 psimo it117-1G 1214 Feb  3 21:07 red_sox.txt
valerydolce General Coding Help 14 8,894 Feb-09-2017, 11:26 AM
    Thread: Getting a "Cannot be Opened"" error Message
Post: Getting a "Cannot be Opened"" error Message

Hi Folks, I'm having a "Cannot opened" error message even though i have the file in my directory. below is my code which consist of reading a file and determining the average game won. Quote:#! /usr...
valerydolce General Coding Help 14 8,894 Feb-09-2017, 11:16 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020